Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-16Fix issue around relocs to ShadowConcreteMethodsMichal Strehovsky
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]
2018-08-16Merge pull request #6228 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-08-16The name/semantic of the CanonicalEntrypoint method on the NodeFactory is a ↵Fadi Hanna
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]
2018-08-13Fixed reverse ordering of unwind insts in the object file (#6220)sergey ignatov
2018-08-11Add an option to disable generation of reflection invoke thunksMichal Strehovsky
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]
2018-08-11Merge pull request #6213 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-08-10Add size-optimization switch passing from ilc to NUTC to CoreRT in ↵dotnet-bot
PureNative mode [tfs-changeset: 1710061]
2018-08-07Optimize WASM arguments and returns (#6181)Morgan Brown
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.
2018-07-31Merge pull request #6158 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-07-30Entries in the export table were not correctly sorted based on ordinals, but ↵Fadi Hanna
were emitted based on the ISortableNode sorting logic. This doesn't work with targeted patching [tfs-changeset: 1709015]
2018-07-30Make sure metadata nodes don't show up in the graph (#6152)Michal Strehovský
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.
2018-07-30Add support for sealed vtables in CppCodegen (#6148)Michal Strehovský
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.
2018-07-30Add an option to only generate metadata for complete types (#6149)Michal Strehovský
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.
2018-07-27[tfs-changeset: 1708860]dotnet-bot
2018-07-24Generate runs of interface dispatch cellsMichal Strehovsky
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]
2018-07-23Make generic composition details relative addressesMichal Strehovsky
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]
2018-07-19Fix a reflection bug caused by my previous checkin. Weak reflected types ↵Fadi Hanna
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]
2018-07-18Merge pull request #6112 from dotnet/nmirrorJan Kotas
Merge nmirror to master
2018-07-18In ProjectN, when compiling in multifile mode, all imported types that are ↵Fadi Hanna
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]
2018-07-18Make thread statics faster (#6108)Michal Strehovský
* 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`).
2018-07-18Merge pull request #6107 from dotnet/nmirrorMichal Strehovský
Merge nmirror to master
2018-07-18Refactoring the ISortableSymbolNode into ISortableNode and ISymbolNode, to ↵Fadi Hanna
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]
2018-07-17Add support for embedding runtime configuration (#6103)Michal Strehovský
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.
2018-07-04Fix MightHaveInterfaceDispatchMap to work with optimized CoreRT buildsMichal Strehovsky
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]
2018-06-29Fixing CoreRT git mirroring break.Fadi Hanna
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]
2018-06-29Merge pull request #6032 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-06-29Make emission of managed resources controlled by a policy (#6031)Michal Strehovský
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.
2018-06-28Typo (#6029)John Doe
* aggresively -> aggressively * algortithm -> algorithm * anindex -> an index * antecendent -> antecedent * barnching -> branching * becauase -> because * behaivor -> behavior * Boolen -> Boolean * Browing -> Browsing * calander -> calendar
2018-06-27Changing the interface method resolution logic used in building the sealed ↵Fadi Hanna
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]
2018-06-24Plumbing to generate calli PInvoke stubs (#6002)Jan Kotas
Contributes to #5587
2018-06-22Merge pull request #5992 from dotnet/nmirrorMichal Strehovský
Merge nmirror to master
2018-06-22Allow constructed byref-like typesMichal Strehovsky
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]
2018-06-221- Fix baseline TOC reading to handle missing/changed contents correctly (we ↵Fadi Hanna
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]
2018-06-18Add opt-in switch to disable metadata blocking (#5955)Michal Strehovský
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.
2018-06-17Merge pull request #5948 from dotnet/nmirrorJan Kotas
Merge nmirror to master
2018-06-17Fix CoreRT break in thread static name manglingMichal Strehovský
2018-06-15RI from ProjNdev3 up to CS1704145dotnet-bot
[tfs-changeset: 1704209]
2018-06-14Dwarf: add support for static members (#5592)Konstantin Baladurin
- change CU lang from C89 to C_plus_plus - ungroup gc, non-gc and thread statics in debuginfo
2018-06-12Hooking up the baseline TOC logic so that the compiler would reuse ordinals ↵Fadi Hanna
of a baseline build when provided with one during exportations. Cleanup dead code. [tfs-changeset: 1703636]
2018-06-04Order ExternalReferencesTable after DefaultConstructorMapMichal Strehovsky
Default constructor map depends on external references table and might add entries in it. [tfs-changeset: 1702602]
2018-06-04Clean up tracking default .ctor dependenciesMichal Strehovsky
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]
2018-05-31Fixing the cases of missing default constructor. This fix makes the default ↵Fadi Hanna
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]
2018-05-18Merge pull request #5821 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-05-18[tfs-changeset: 1700475]dotnet-bot
2018-05-13Merge pull request #5799 from MichalStrehovsky/appContextMichal Strehovský
2018-05-11Merge pull request #5801 from dotnet/masterMichal Strehovský
Merge master to nmirror
2018-05-11Add support for setting AppContext switchesMichal Strehovský
Adds an `--appcontextswitch` argument to the compiler (and accompanying `AppContextSwitchOverrides` MSBuild `ItemGroup`) to influence class library behaviors.
2018-05-11Extract class library composition into `.targets` (#5793)Michal Strehovský
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.
2018-05-09Fixing a bug with calls to USG vtable-methods wrapped in a calling ↵Fadi Hanna
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]
2018-04-26Devirtualize delegate creation to sealed virtuals (#5749)Michal Strehovský
These could be in sealed vtable slots.