Age | Commit message (Collapse) | Author |
|
Generating relocs to a shadow concrete method should work the same as a reloc to the canonical body it represents. This is why the ShadowConcreteMethod implements ISymbolNode (indirectly, through IMethodNode). It works that way in the CoreRT object emitter, but it got broken when the UTC emitter stopped looking at mangled names and started assigning IDs to symbols instead. We hit a similar problem in EETypeNode and "NodeForLinkage" was born at that time.
This change:
1. Rolls back CS 1710918 that is trying to sidestep the problem by introducing complexity at the place where we need a canonical node (we need to decide whether we need one for linkage purposes, or for dependency analysis purposes, with a subtle runtime failure mode if we pick the wrong one).
2. Makes NodeForLinkage a property of the symbol reference instead of property of the defining object node so that we can use this on nodes that don't have object data associated with them.
3. Implements NodeForLinkage on ShadowConcreteMethodNode
[tfs-changeset: 1711076]
|
|
Merge master to nmirror
|
|
bit misleading, and were incorrectly used in a couple of places. I made a small refactoring to distinguish between the scenario where we need a IMethodNode for the purpose of dependency analysis (either a MethodEntrypointNode or a ShadowConcreteMethodNode), and the scenario where we really need a callable address of a canonical entry point.
(Fixes a test in the Recoil category, which had a nullptr value for a ConstrainedMethodUse generic dictionary slot. The call to CanonicalEntrypoint was returning a ShadowConcreteMethod node, which was not really valid for that purpose. In fact, i'm not really sure why this test compiled successfully in the first place instead of hitting a linking error).
[tfs-changeset: 1710918]
|
|
|
|
Touches a lot of files, but most of this is just plumbing.
In the absence of invoke thunks, reflection will use the calling convention converter. Reflection invoke will get about 7x slower, but will still work. Saves about 1.5-2% in terms of size on disk. The default is still to use the thunks, since we tweak everything towards fast defaults.
Implemented for both Project N and Project X. On the X side, I decided to go with a "policy" class instead of bools. This will let us cleanly do further optimization in the future, such as selectively generating thunks only for specific methods.
[tfs-changeset: 1710656]
|
|
Merge master to nmirror
|
|
PureNative mode
[tfs-changeset: 1710061]
|
|
Use LLVM arguments and returns where possible (no GC references) instead of passing them on the shadow stack. The argument optimization saves 3% optimized (5% compressed). The return change adds about 0.5% to the uncompressed file, but saves about 6% compressed. They both save size in debug. This also greatly simplifies debugging and reading code. Also includes a fix to the class constructor runner where it was calling cctors with the wrong signature and some test fixes.
|
|
Merge master to nmirror
|
|
were emitted based on the ISortableNode sorting logic. This doesn't work with targeted patching
[tfs-changeset: 1709015]
|
|
RD.XML root provider was adding ModuleMetadataNodes into the dependency graph even though we were not doing metadata analysis (analysis already happened during the scanning phase). This was crashing the code I added yesterday with an invalid cast because metadata nodes don't expect to be in the graph if we're not analyzing (nobody is going to look at them). The crash only happens one has RD.XML so we didn't catch it in the CI.
|
|
This cleans up the codebase by removing a bunch of workarounds. This was pretty easy after 045a28051c6b85b82fe42e944fcb2267768ebbe2 gave us the option to emit different data structures for places that don't support relative pointers and be able to switch dynamically at runtime.
|
|
When the option is set, metadata generation at the type level becomes all or nothing - either the entire type gets metadata, or none of it gets it. This makes a certain class of missing metadata issues easier to troubleshoot.
|
|
|
|
When interface dispatch was initially implemented in CoreRT, we took a number of shortcuts (dotnet/corert#626). Skipping the size on disk optimization around generating runs of interface dispatch cells with the same slot number was one of the shortcuts (each cell represented its own run).
With this, I'm implementing the same optimization that binder does. For PureNative shared library, this saves 100 kB. I didn't measure savings for apps, but I expect them to be similar.
[tfs-changeset: 1708487]
|
|
I'm looking at size regressions between .NET Native 1.7 and the current mainline branch. A thing that stood out is universally bigger EETypes. A contributor to this was getting rid of GenericInstanceDescs between 1.7 and 2.0 and replacing them by direct references to generic composition details from the EEType. Size-wise, this was mostly a wash, but we can actually do better - these new fields are not critical to be pointer-sized.
This change turns them into relative pointers. This saves 33 kB on a hello world app. I expect around 100 kB savings on the UWP People app based on my back-of-the-envelope calculation.
Project N baggage:
1. Update pntestcl build configuration to compile it with a C# compiler that is not 8 years old
2. Disable metadata validation transform on class libraries. This is hitting what appears to be a CCI metadata validator bug (Validator.cs:796) where it thinks a modified type should have the same interned key as the unmodified version of it. The act of resolving a modified type strips off the modifier. This ticks off the validator.
3. Fix a Reducer bug where it wasn't marking non-interface constraints as necessary. The C# unmanaged constraint is expressed as [modreq UnmanagedType] ValueType. We were not marking UnmanagedType as necessary.
4. Update checked in binder because this is a file format change
[tfs-changeset: 1708263]
|
|
should always be added to the TypeMap if they generated an EEType in the current compilation. My previous aiming at adding weak reflected imported types to the TypeMap table accidently broke that.
[tfs-changeset: 1708032]
|
|
Merge nmirror to master
|
|
also declared in the weak reflected types list (reflection metadata) get added to the TypeMap table.
This change enables ProjectX to behave in a similar manner, but only if such types are referenced and added to the dependency graph (There's no evidence so far that suggests the need to root all such weak reflected imported types in the graph).
[tfs-changeset: 1707792]
|
|
* Fix the TODO to inline `.cctor` check into the R2R helper. This avoids some method calls and stack frame setup.
* Remove array cast from the hot path. The runtime doesn't care what type the storage is, as long as it's a managed reference - in fact, it seems to be treated as an `Object` in `pCurrentThread->GetThreadStaticStorageForModule` anyway. I considered replacing the cast with an `Unsafe.As`, but just redeclaring the signatures as returning `object[]` seemed better (because now we actually guarantee the classlib won't pass anything but `object[]` to `RhSetThreadStaticStorageForModule`).
|
|
Merge nmirror to master
|
|
separate the sorting APIs into their own interfaces, independent of having symbols. Reasons:
1) There are some dependency nodes that need sorting, and are not necessarily symbol nodes (today they implement the SortableDependencyNode, which now with these changes will also implement the ISortableNode interface)
2) Avoid places where we have the messy 2 ClassCode and 2 CompareToImpl implementations, where one pair tail-calls the other (really the main reason behind this refactoring)
With these changes, the ClassCode and CompareToImpl are now part of the ISortableNode, The ISortableSymbolNode is now simply a merging of ISortableNode and ISymbolNode, to be used in places where we deal with both concepts.
SortableDependencyNode provides default/abstract virtuals to the interface methods, and are overridden in derived classes.
[tfs-changeset: 1707646]
|
|
Runtime configuration (e.g. whether to use server GC) can currently be provided either through environment variables at runtime, or through a RhConfig.ini file placed next to the executable. This adds another channel where we burn a blob similar to RhConfig.ini format into the executable. The order of precedence is environment variable > RhConfig.ini > embedded config.
The `ServerGarbageCollection` project property that is used to determine whether to link with a runtime that supports server GC will be also used to control whether to generate a configuration that enables server GC at runtime by default.
Fixes #6100.
|
|
This applies the same pattern that was added in CS 1706049. Without this, the code was trying to access virtual slot information for things like IFoo<!0>, which kind of works in Debug builds, but fails when scanner is used (optimized builds or --scan passed at the command line).
[tfs-changeset: 1706526]
|
|
The issue here is that the code enumerates the slots of a VTable node of a runtime determined interface instantiation (declType.GetTypeDefinition().RuntimeInterfaces), and in CoreRT the vtable slots are only produced when used by the code. Given that nothing uses these method definitions, we end up empty vtables, and end up with missing entries in the dispatch map and sealed vtable.
I'm rewriting the code to enumerate methods on the fully instantiated VTable,
[tfs-changeset: 1706049]
|
|
Merge master to nmirror
|
|
This makes it possible for the compiler to filter what managed resources should be included in the executable image.
I'm implementing a RESX blocking policy for framework assemblies. This will be used to block emission of framework exception messages. I'm planning to use this from the ProjectX side. Eventually, I would also like to expose this on the CoreRT compiler side. Submitting through git because it's just a better way to do development. I'll follow up on the TFS side and pipe it through NUTC.
|
|
* aggresively -> aggressively
* algortithm -> algorithm
* anindex -> an index
* antecendent -> antecedent
* barnching -> branching
* becauase -> because
* behaivor -> behavior
* Boolen -> Boolean
* Browing -> Browsing
* calander -> calendar
|
|
vtable and the interface dispatch map to work with type definitions instead of instantiated types, to correctly handle the cases where we get generic interface collapsing, and when the implementing method ends up in the sealed vtable (This was causing the interface resolution logic at runtime to fail).
This also fixes the cases of dynamic types, since we use fully canonical instantiations as templates, and these canonical instantiations can suffer from the same generic collapsing problem.
[tfs-changeset: 1705787]
|
|
Contributes to #5587
|
|
Merge nmirror to master
|
|
We were not allowing these because we couldn't properly fill out the vtable (can't really make unboxing thunks to put in the vtable). We actually need the vtable, but only because the generic dictionary lives there and reflection might touch it.
[tfs-changeset: 1705047]
|
|
were not handing MissingMemberExceptions, we were just handling TypeLoadExceptions)
2- Fix ordinal assignment bug for nodes that do not exist in a baseline TOC
3- Remove unnecessary counter instructions from type layout TOC data (the counters were initially made so that the TOC tool would know how many items to parse, but it no longer parses the type layout data. Instead, we just ildasm the contents for diffing).
[tfs-changeset: 1705044]
|
|
This adds a compiler option to disable the behavior that blocks metadata generation for framework implementation details.
Enabling the option regresses the size of a Hello world app from 3,891,200 bytes to 5,970,432. We don't want to enable this by default because normal apps have no business in reflecting on the implementation details of the framework. Implementation details vary from version to version and from runtime to runtime.
This is likely going to be needed for #5838 (the CoreFX tests try to access implementation details to test these - we did the work to disable any such tests on UAPAOT, but that's not the flavor of tests we run in CoreRT repo). Fixes #5951.
|
|
Merge nmirror to master
|
|
|
|
[tfs-changeset: 1704209]
|
|
- change CU lang from C89 to C_plus_plus
- ungroup gc, non-gc and thread statics in debuginfo
|
|
of a baseline build when provided with one during exportations.
Cleanup dead code.
[tfs-changeset: 1703636]
|
|
Default constructor map depends on external references table and might add entries in it.
[tfs-changeset: 1702602]
|
|
Changeset 1702272 added logic that uses a big hammer to track default ctors. There was some existing logic that was trying to surgically do the same thing but didn't really work.
I don't really see the reason to keep the surgical code in place.
[tfs-changeset: 1702600]
|
|
constructor of all constructed types show up in the map. This fix is a bit on the conservative side, and avoids more complex detection logic to only include default ctor entries for types that will really need them (detection with generics might be complex to implement, and might still have holes at the end), but that's acceptable given that the size on disk impact is negligible (less than 0.3% on average).
[tfs-changeset: 1702272]
|
|
Merge master to nmirror
|
|
|
|
|
|
Merge master to nmirror
|
|
Adds an `--appcontextswitch` argument to the compiler (and accompanying `AppContextSwitchOverrides` MSBuild `ItemGroup`) to influence class library behaviors.
|
|
Contributes to #5662. Still not putting that library under a `Condition = Exe` because I'm not quite sure how many concepts `System.Private.DeveloperExperience.Console` is conflating (it doesn't seem like it's doing only what the name implies).
I'm doing this mostly so that the compiler is more hack-friendly for an after work project of mine.
|
|
convention converter thunk.
The issue was that the TypeBuilder creates calling convention converter thunks that uses mismatching method signatures and instantiation type arguments.
The fix is to encode the signature of the declaring method (where the vtable method appears first on the type hierarchy), to make it match with the instantiation arguments that the call converter uses for substitution.
[tfs-changeset: 1699090]
|
|
These could be in sealed vtable slots.
|