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-04-12Use canonical method IL in scanner's ImportCall (#5686)Michal Strehovský
Simulates what JitInterface operates on.
2018-03-13Fix empty dispatch map optimization and unnormalized vtables (#5531)Michal Strehovský
Since we currently allow unnormalized things in the dependency graph (see #5264), we need to ensure scanner produces a dependency graph that can be queried for unnormalized vtable slices. This fixes a regression in a ASP.NET scenario. Also fixes #5508.
2017-08-28Update RyuJIT (#4407)Michal Strehovský
Picks up: * dotnet/coreclr#13561 * dotnet/coreclr#13577 Fixes #3608.
2017-06-15GVM dependency analysis performance fixes (#3872)Fadi Hanna
Refactor GVM algorithm for better performance Fix GVM resolution bug on derived types Fix bug with variance (https://github.com/dotnet/corert/issues/3454)
2017-06-13Enable inlining of virtual method calls (#3773)Michal Strehovský
2017-06-09Fix virtual method use reporting for canonical EETypes (#3842)Michal Strehovský
Canonical EETypes weren't reporting their virtual method dependencies, hoping that by the time they want to emit the VTable, someone else already reported them. Fixing that by moving virtual method reporting from `ConstructedEETypeNode` down to `EETypeNode`. At this point it's really obvious that the current object hierarchy (where `EETypeNode` represents an unconstructed EEType that shouldn't care about virtuals, but handles pretty much all of it anyway) doesn't work. Fixes #3659.
2017-06-03Make virtual invoke map report dependency on virtual method slot (#3785)Michal Strehovský
* Make virtual invoke map report dependency on virtual method slot Placing a virtual method in the map means that we'll need a slot for it. I wasn't sure I liked this as a fix in the past, because it makes the mapping table potentially bring unused methods into the compilation (e.g. if the method has multiple overrides), but I convinced myself that doing anything else would result in terrible user experience and whatever external tool we'll use to determine reflection roots in the future will need to apply the same rule. * Fix release test failure
2017-05-27Implement delegates to generic virtual methods (#3712)Michal Strehovský
Turns out I got most of this right in #3318. At that time I saw RyuJIT crashing but didn't have a checked version of it handy. Turns out it was just an eager assert that is easy to subdue.
2017-04-13Restore support for delegates to GVMs created from unshared code (#3318)Michal Strehovský
This used to work but it's now failing in the rolling build. It's easy enough to restore enough of the functionality to get the tests passing again. The rest of the work (creating the delegate from shared code) is tracked in #2796 (uncomment the commented out test line to hit a failure in the JIT).
2017-04-12Make DelegateCtor R2R helper perform virtual resolution (#2928)Michal Strehovský
Update the compiler to be able to leverage the newly added RyuJIT capabilities around delegate constructions. In the past, RyuJIT would only ask for the construction helper for the simplest cases (target method is not virtual, and no generic runtime lookup is needed). It would call the actual constructor method for everything else. With updated RyuJIT, we can now use the helper in all cases (if the construction pattern is verifiable). The change is bigger than I would like because: * We needed to update `DelegateCreationInfo` to capture the fact that the target of the delegate can now be runtime determined * There was an unimplemented feature around fat function pointers looked up from dictionaries (we couldn't express that the fat function pointer should point to the unboxing stub). * `ShadowConcreteMethod` didn't work great with unboxing stubs. I just made a new node that is a "shadow unboxing stub". * We needed to update both generic and nongeneric ready to run helpers to deal with the new delegate creation patterns. * JitInterface change. * Tests
2017-04-07Merge branch 'master' into nmirrorSimon Nattress
2017-04-06Fix #3211: Node ILCompiler.DependencyAnalysis.GCStaticsNode is not marked ↵Fadi Hanna
when ILCompiler.DependencyAnalysis.RyuJitNodeFactory is MarkingComplete (#3227)
2017-04-06Fix CoreRT generics test in Release buildSimon Nattress
The dynamic invoke tests were failing because the JIT was inlining all the target methods leaving nothing to actually invoke through reflection. Mark all the methods we invoke (including the empty constructors) with `[MethodImpl(MethodImplOptions.NoInlining)]`. [tfs-changeset: 1653296]
2017-04-06Dynamic Invoke StubsSimon Nattress
* Add CoreRT implementation for the dynamic invoke template table which maps invoke stub name / sig to the canonical method entrypoint * CoreRT based compilers use 32bit relative addresses to the stub containing EEType and method entry points (.NET Native uses RVAs). Set the bit on the reloc to indicate a 32bit rel reloc. * Fix a bug in generic method template map where generic methods on structs were getting IsUnboxingStub set incorrectly [tfs-changeset: 1653288]
2017-03-30Support GC Statics in type loader (#3120)Simon Nattress
Support GC Statics in type loader * Add support for CoreRT-style GC statics when creating new generic types from templates * Pass new `BagElementKind.GCStaticEEType` through in the template layout so the type's statics can be heap-allocated * Add managed accessors to the dynamic GC / non-GC data to EEType.cs
2017-03-28Implementation of the VirtualInvokeMap table to enable Reflection invocation ↵Fadi Hanna
to virtual and generic virtual methods. (#3100) Implementation supports both CoreRT and ProjectX models. Fixed interface EEType generation to unconditionally produce a dictionary slot for generic interfaces (to support static interface methods, and enable correct Reflection virtual invoke slot computation on ProjectX).
2017-03-24Enabled type loader on CoreRTSimon Nattress
* Enable template generation for generic types * Dictionary slots generated for types / methods cause that type / method to get a type loader template * Remove the template-specific list of slots and just use the owning type's dictionary layout * Add not-supported entry for template slots that aren't implemented yet [tfs-changeset: 1651962]
2017-03-16Enabling static fields access for Reflection (#2962)Fadi Hanna
1) Adding the StaticsInfoHashtable to track statics regions for compiled types. 2) Writing statics field data to the ReflectionFieldMapNode 3) Improving the IndirectionNode to allow it to point to an inner offset in a target symbol 4) CoreRT runtime support for static fields access 5) Collapsing of field entries in the ReflectionFieldMapNode based on canonicalization
2017-03-09Fix vtable stability issue with shared code (#2921)Michal Strehovský
Pull request #2096 made sure that lazily built vtables of `Foo<X>` and `Foo<Y>` contain the same entries if their canonical forms are the same, but didn't make sure the order of the entries is the same. This can lead to bugs at runtime where the wrong slot is used to dispatch a virtual method call. To make sure the vtables look the same, we need to also sort the vtable.
2017-03-02Fix delegate creation to shared generic method bodies (#2862)Michal Strehovský
The delegate creation code path wasn't updated for shared generics: * We need to use canonical entrypoints and fat function pointers where appropriate * This required adding infrastructure to track unboxing stubs from shared code. More work will be needed around here to add support for creating delegates *from* shared code.
2017-03-02Fix for issue 2855: GVM dependency tracking with shared generics. (#2858)Fadi Hanna
2017-02-28Delete test for unused GVMsMichal Strehovský
This test outlived its usefulness.
2017-02-28Unblock fat function pointer return buffer testsMichal Strehovský
2017-02-28Add test for initThisClass from a generic method on a nongeneric typeMichal Strehovský
This doesn't need a runtime lookup, but RyuJIT is asking for one.
2017-02-16Enabling GVM target resolution (hookup work) (#2635)Fadi Hanna
Enabling GVM target resolution (hookup work)
2017-02-14Stop emitting transformed calli instructionMichal Strehovský
2017-02-03Fix MDArray Address method for shared generics (#2646)Michal Strehovský
I admit this required special casing in places I don't like, but the `Address` methods on multidimensional arrays are... well, special. The problem with the `Address` method is that it needs to do an exact type check in it's body - the array element type that is expected at the callsite needs to match the runtime type of the array passed in. We need this because of array covariance (`string[`]` is allowed to be cast to `object[,]` and we need to disallow making a `ref object` to an array element if the runtime type of the array is not exactly `object[,]`). This changes mirrors how Address methods get compiled on CoreCLR. The story begins at the callsite: 1. We tell the codegen in `getCallInfo` that `Address` is a method that requires an instantiation argument (just like e.g. static methods on shared generic types), but disallow inlining it so that we are forced to generate a standalone body. Method's owning type becomes the instantiation argument. 2. We make sure the dependency tracking doesn't track the `Address` method as a runtime determined method. It's difficult to represent it in the RuntimeDetermined infrastructure (for the simple reason that RuntimeDetermined types need to be DefTypes). We can get away with it because the `Address` method doesn't actually do generic lookups anyway. 3. When we get to compile the method body, we pull the old switcheroo and replace the method with one that has the instantiation argument in the signature (so that we can refer to the argument from IL). We then use the hidden argument to do the type check within the method body.
2017-01-28Fix Generics test (#2611)Michal Strehovský
The fact we could reflection enable two instantiations of a method relied on pure luck on which invoke stub we choose to invoke the method. If we chose the one for `object`, we could use it to invoke the method instantiated over `string`. We ran out of luck in postcheckin. I'm fixning the test to only have one generic method instantiation to make it pass again to keep coverage for the other interesting cases. Making this actually work depends on the "Use type loader to build invoke stub dictionaries" workitem. Requires type loader.
2017-01-27Add instantiating unboxing stubs (#2566)Michal Strehovský
To support calling canonical interface methods on generic valuetypes, the compiler needs to generate unboxing+instantiating thunks that bridge the difference between two calling conventions. As a refresher: * Instance methods on shared generic valuetypes expect two arguments (aside from the arguments declared in the signature): a ByRef to the first byte of the value of the valuetype (`this`), and a generic context argument (EEType) * Interface calls expect `this` to be a reference type (with the generic context to be inferred from `this` by the callee) Instantiating and unboxing stubs bridge this by extracting a managed pointer out of a boxed valuetype, along with the EEType of the boxed valuetype (to provide the generic context) before dispatching to the instance method. We compile them by: * Pretending the unboxing stub is an instance method on a reference type with the same layout as a boxed valuetype * Having the unboxing stub load the `m_pEEType` field (to get generic context) and a byref to the actual value (to get a `this` expected by valuetype methods) * Generating a call to the instance method on the valuetype through a wrapper that has an explicit generic context parameter in it's signature.
2017-01-27Make reflection invoke work for valuetype instance methods (#2596)Michal Strehovský
This is a bunch of things: * Make the reflection dynamic invoke thunk use the transformed calli intrinsic to do the call (to handle fat function pointers) * Generic dictionary nodes are prefixed with the hash code, but I put the padding in the wrong location. That's what I get for writing code off memory without crosschecking with Project N binder... * Make MethodCodeNode depend on it's unboxig stub. This is in the hacky section with a big comment explaining why we need it for now. (Method being compiled determines it's reflectability.) * Emit a pointer to the unboxing stub in the reflection mapping table if needed. * Remove a another usage of GetRvaFromIndex from the type loader * Add a test
2017-01-20Fix handling of constrained method calls from shared generic code (#2527)Michal Strehovský
Don't track runtime determined dependencies if we're generating a call to a constrained method. The more complicated case is tracked in #2526.
2017-01-12Add support for thread static base dictionary lookups (#2479)Michal Strehovský
This adds support for generating helpers and dictionary entries to support thread static base lookups for generic types in shared generic context. I slightly tweaked how dictionary slots get emitted because the "every slot is an `ISymbolNode`" paradigm wasn't very flexible.
2016-12-16Implement ldvirtftn in shared generic contexts (#2339)Michal Strehovský
* Static methods on generic types use the type's generic dictionary Dependency analysis was incorrectly assuming these have their own dictionary (they don't). * Emit R2R generic helpers for ldvirtftn
2016-11-16Allow GVMs to be present on typesSimon Nattress
In order to compile larger bodies of code (such as XUnit) without full GVM support, emit a R2R helper at GVM callsites that fails fast at runtime. I left the check for GVMs in-place in `ConstructedEETypeNode.OutputVirtualSlots` to make sure we don't actually put them in the VTable since they'll eventually be dispatched via a lookup table.
2016-11-12Fix walking base hierarchy when computing dictionary slots (#2193)Michal Strehovský
When the generic ready to run lookup helper needs to know the generic dictionary vtable slot, it passes the canonical type to the helper that determines the slot. `GetNumberOfBaseSlots` needs to be able to deal with this, and the fact that the slots might be lazily determined. Converting to canon fixes this due to how we ensure canonically equivalent types have the same vtable in #2096. The other option would be to back out that change and completely revamp how we do lazy slots for generic types. I found this when I ran the reflection invoke test with shared generics enabled.
2016-11-12Add regression testSimon Nattress
2016-11-08Call the slow helper from delegate .ctor method (#2131)Michal Strehovský
This lets us get at least some test coverage for delegate invocation in shared generics mode before #2102 gets fixed.
2016-10-29Enable vtable layout test (#2103)Michal Strehovský
2016-10-28Add shared generics test to CI (#2098)Michal Strehovský