22 Commits
Author SHA1 Message Date
Elinor Fung 36287c22bc Remove Unrestored/UnrestoredTypeKey flags, load levels, checks (#97674)
These were from NGEN support, so we can remove the flags, load levels, and assorted checks for them.
2024-01-31 14:52:50 -08:00
Aaron Robinson 93552a35f8 Rename EnC related defines (#91146)
* Rename FEATURE_ENC_SUPPORTED and EnC_SUPPORTED
2023-08-25 18:27:07 -07:00
JasperandJan Kotas 43e47b8e1d Remove _NoLogging methods from VM (#89641)
* Remove getIX_NoLogging

* Remove GetModule_NoLogging

* Remove IsRestored_NoLogging

* Remove GetOffset_NoLogging

* Remove GetMethodTable_NoLogging

* Remove HasClass[OrMethod]Instantiation_NoLogging

* Remove GetNumVirtuals_NoLogging

* Remove GetWriteableData[ForWrite]_NoLogging

* Remove GetMemberDef_NoLogging

* Remove GetApproxEnclosingMethodTable_NoLogging

* Remove GetTypeDefRid_NoLogging

* Remove GetCl_NoLogging

* Rename GetClass_NoLogging and remove old GetClassWithPossibleAV

* Update src/coreclr/vm/methodtable.h

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2023-07-28 14:42:28 -07:00
afa9a930b8 EnC Support for Generics (#85269)
* EnC non-functional changes
- Update inappropriate naming
- Update many logging statements
- Remove unused code

* EnC support for fields on generic types

* EnC support for methods on generic types

* Fix use after free introduced in EnC breakpoint.
Fix off by one for string logging.

* update new feature capabilities, JIT GUID

* Fix non-enc build

* Fix EnCFieldIndex check

* Remove IsFdPrivate assert

---------

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
2023-04-25 10:32:19 -07:00
Aaron Robinson b69fa27556 Prep for new diagnostic work and tests (#81571)
* Fix asserts fired during diag testing

* EnC flag is now applied to MethodDesc instead of
Instantiated MethodDesc.

* Renamed ambiguous method and updated some logging.
2023-02-03 22:42:31 -08:00
Aaron Robinson 4f63db1b9f Remove some Windows specific formatters (#78434)
* Remove remaining Windows printf modifiers

* Remove some uses of %S.
2022-11-17 09:06:12 -08:00
Aaron Robinson 3ea12efc12 Remove the GenericComPlusCall mechanism (#76415)
Remove unused asm constants.
Remove comments about context-bound objects and remoting.
Use common constants for VtblGap concept.
2022-09-29 22:00:13 -07:00
Aaron Robinson d1a21ec011 Undefined behavior with null (#73507)
* Undefined behavior with null
2022-08-07 14:17:50 -07:00
Adeel Mujahid 9d6396deb0 Fix typos (#72709) 2022-07-23 20:24:28 -07:00
David Wrighton a78c46d1dd Version resilient cross module code compilation and inlining (#71271)
- Refactor Module into ModuleBase and Module
  - The goal is to have allow a subset version of Module which can only hold refs, this is to be used by the manifest module in an R2R image to allow for version resilient cross module references.
  - Update handling of ModuleBase so that its used everywhere that tokens are parsed from R2R
  - Remove ENCODE_MODULE_ID_FOR_STATICS and ENCODE_ACTIVE_DEPENDENCY
    - These were only used for NGEN, and conflict with easy impelmentation for the ModuleBase concept
  - Remove locking in ENCODE_STRING_HANDLE processing, and tweak comments. Comments applied to the removed ngen based code, and the lock was only necessary for the old ngen thing.
  - Adjust ComputeLoaderModuleWorker for locating loader module
    - Follow comment more accurately, to avoid putting every generic into its definition module. This will make R2R function lookup able to find compiled instantiations in some cases. This may be what we want long term, it may not.
  - Remove MemberRefToDesc map and replace with LookupMap like the other token types. We no longer make use of the hot table, so this is more efficient
    - Also reduces complexity of implementation of ModuleBase

- Build fixup to describe a single method as a standalone blob of data
  - There are parallel implementations in Crossgen2 and in the runtime
  - They produce binary identical output
  - Basic R2RDump support for new fixup

- Adjust module indices used within the R2R format to support a module index which refers to the R2R manifest metadata. This requires bumping the R2R version to 6.2
  - Add a module index between the set of assembly refs in the index 0 module and the set of assembly refs in the R2R manifest metadata

- Adjust compilation dependency rules to include a few critical AsyncStateMachineBox methods

- Remove PEImage handling of native metadata which was duplicative

- Do not enable any more devirtualization than was already in use, even in the cross module compilation scenario. In particular, do not enable devirtualization of methods where the decl method isn't within the version bubble, even if the decl method could be represented with a cross module reference token. (This could be fixed, but is out of scope for this initial investigation)

Make the compilation deterministic in this new model, even though we are generating new tokens on demand
  - Implement this by detecting when we need new tokens during a compile, and recompiling with new tokens when necessary
  - This may result in compiling the same code as much as twice

Compile the right set of methods with cross module inlining enabled
- Add support for compiling the called virtual methods on generic types
  - This catches the List<T> and Dictionary<TKey,TValue> scenarios
- Support input of PGO data to control the set of methods
- Enable new `READYTORUN_FLAG_UNRELATED_R2R_CODE` flag on R2R images which is used to indicate which modules may have generic code not directly related to the metadata of the image
- Lookup R2R methods in an `alternate` location as well as the metadata defining module. This allows for many generics to be embedded without needing to use the new `READYTORUN_FLAG_UNRELATED_R2R_CODE` flag, which has global effects on performance.

- Add command line switches to enable/disable the new behavior

- Enhance the version resilience test to cover this new behavior
2022-07-01 15:54:24 -07:00
d17741d0c4 Change SString::GetUTF8NoConvert to GetUTF8 that converts the SString (#71101)
* Change SString::GetUTF8NoConvert to GetUTF8 that converts the SString

This enables SString to get out of the UTF16 state and helps move us away from "SString's natural encoding is UTF16"

* Remove some stack scratch buffers that are unneeded now (as we can now convert the SString itself and in some cases it was already in UTF8) and implement PR feedback.

* Add SetAndConvertToUTF8 method and remove the GetUTF8 method variants with a scratch buffer.

* Remove unneeded variables.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2022-06-22 18:01:38 -07:00
Aaron Robinson c3e0c8a3dc Remove more wprintf usages (#69912)
* Remove wprintf from eventpipe.

* Remove messagebox logic from utils and place its single usage
  under debug/.

* Convert Profiler GUID logging to use UTF-8
2022-05-31 15:59:00 -07:00
Buyaa Namnan 5734a2312a Fix value type unboxing bug (#69815) 2022-05-26 14:15:26 -07:00
Aaron Robinson 4f010449b1 Removal of IBC infrastructure (#68717)
* Removal of IBC infrastructure

* Crossgen2 - remove tuning flag.
2022-05-16 13:18:53 -07:00
Adeel Mujahid daa2965c8d Replace CorInfoIntrinsics with NamedIntrinsic (#62639)
* Replace CorInfoIntrinsics with NamedIntrinsic

* Implement NI_ARRAY_* intrinsics

* Rename IsJitIntrinsic to IsIntrinsic
2021-12-12 09:25:36 -08:00
Vladimir SadovandJan Kotas 5da8f31789 Completely lock-free ClassLoader::LookupTypeKey (#61346)
* embedded size

* next array

* read consistency while rehashing

* comments

* remove CRST_UNSAFE_ANYMODE and COOP mode in the callers

* typo

* fix 32bit builds

* couple changes from review.

* Walk the buckets in resize.

* remove a `REVIEW:` comment.

* Update src/coreclr/vm/dacenumerablehash.inl

PR review suggestion

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* remove use of `auto`

* DAC stuff

* Constructor and GrowTable are not called by DAC, no need for DPTR, added a comment about a cast.

* SKIP_SPECIAL_SLOTS

* More compact dac_cast in GetNext

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2021-11-14 14:32:50 -08:00
Elinor Fung 1eed12520a Remove MethodDesc::IsRestored (always true) (#58126) 2021-08-25 19:48:17 -07:00
David WrightonandJeremy Koritzinsky 5a5b1045ab Remove PlainPointer, RelativePointer and RelativeFixupPointer (#57707)
- Removed all uses of PlainPointer
- Remove all use of RelativeFixupPointer
- Remove all use of FixupPointer
- Remove RelativePointer

- Debugging all of this is now easier! Yay!

Fixes #57706 

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2021-08-24 14:30:37 -07:00
Elinor Fung 4061822131 Delete code under FEATURE_PREJIT (#57693) 2021-08-19 10:10:43 -07:00
Tomáš Rylek 88211b9a1f Runtime support for static virtual interface methods (#52173)
This change implements initial CoreCLR runtime support for static virtual interface methods and adds over 1700 test cases covering various aspects of this new runtime feature.

1) In the JIT, we are relaxing the assumption that ".constrained" must be always followed by a "callvirt" by allowing two more IL instructions to be constrained, "call" and "ldftn".

2) In the JIT interface, we're adding bits of code to CEEInfo::getCallInfo to properly handle the new static virtual methods. We're extending constrained method resolution to cater for the static virtual method case in a new method "ResolveStaticVirtualMethod".

3) In our work on the implementation we found a pre-existing JIT interface issue - the interplay between getCallInfo and embedGenericHandle doesn't work well in case of constrained calls as the existing API surface doesn't provide any means for communicating compile-time resolution of the constraint from getCallInfo to embedGenericHandle. In this change we're working around this by deferring to runtime resolution of the constraint in the presence of shared generics.

4) In the method table builder, we're newly tracking a flag saying whether we're implementing an interface declaring static virtual methods (fHasVirtualStaticMethods) that is used to speed up the runtime checks by skipping irrelevant interfaces.

5) For Crossgen / Crossgen2, this change only adds minimalistic support in the form of bailing out in getCallInfo whenever we hit a call to a static virtual method, cancelling AOT compilation of the caller and deferring it to runtime JIT.
2021-05-15 00:05:16 +02:00
David Wrighton 76954b4ed7 Avoid use of incorrect instantation argumens when checking for constraint satisfaction (#47258)
- The constraint processing logic in the runtime conflates the idea of constraint checking on open, closed over concrete types, and closed over non-concrete types
- This change adds a tweak to avoid using an instantiation context that isn't related to the type variable being instantiated

Fixes issue #45600 and adds a regression test from the customer.
2021-03-19 08:58:58 -07:00
Tomáš Rylek 69e114c1ab December infra rollout - remove duplicated 'src' from coreclr subrepo (src/coreclr/src becomes src/coreclr) (#44973)
* Move src/coreclr/src/Directory.Build.targets to src/coreclr
Merge src/coreclr/src/CMakeLists.txt into src/coreclr/CMakeLists.txt

* Mechanical move of src/coreclr/src to src/coreclr

* Scripts adjustments to reflect the changed paths
2020-12-08 03:19:44 +01:00