Age | Commit message (Collapse) | Author |
|
This was not enabled because at the time the test was written, `IsThreadStatic` was a lie. It would have caught #6041 in a much cheaper way if we haven't forgotten to enable it when thread statics were brought up.
|
|
Contributes to #5587
|
|
When I did the `System.Reflection.Pointer` support for reflection invoke and delegate `DynamicInvoke`, I found these two thunks do pretty much the same thing. They got implemented separately because I was just porting Project N IL2IL code, but there's no reason why we need two.
With this change, Delegate.DynamicInvoke will just call into the shared helper that is also used for reflection invoke.
This is a bigger diff due to bunch of mechanical changes:
* The set of generated helpers had to be moved to a place from where both delegate and reflection infrastructure can see it. A type system context dot file did the trick. (Contributes to #3873.)
* The generated assembly got moved to the type system context so that the thunks can stay homed in it.
* Fix to CppCodegen name mangling so that these can be still referenced in CppCodegen.
|
|
- Issue was that our algorithm for computing equivalence between the ILToc and the thing we are compiling was using a string which was supposed to be unique per type
- Unfortunately, it wasn't in the case of nested types nested in other nested types
- Fix is straightforward, simply use AppendName instead of AppendNameForNamespaceType for the containing type.
[tfs-changeset: 1691597]
|
|
Includes changes necessiated by the move of Vectors to CoreLib.
|
|
The implementation relies on a new virtual method on `System.ValueType` that provides information about fields on a type. An override of this method is injected by the compiler when needed.
This implementation is different from what Project N does (where we inject actual overrides of both methods). The CoreRT implementation is a bit more space-saving because there is only one method that does fewer things.
This ends up being a 0.9% regression in size of a hello world app, but we do get some correctness with it and a potential to get the reflection stack completely out of the base hello world image (that one will be a huge win). We can get some of the regression back by:
* Getting RyuJIT to generate more efficient code for the offset calculation (dotnet/coreclr#16527)
* Making fewer things reflectable. We're currently generating the data for e.g. OSVERSIONINFO because it's used as a parameter in a method that is reflectable, and therefore the parameter gets boxed, and therefore it needs this data. It also drags in a fixed buffer internal type because it's a valuetype field on OSVERSIONINFO. This alone costs us 100+ bytes.
|
|
* acces -> access
* accesss -> access
* acknowleges -> acknowledges
* actitivy -> activity
* Additonally -> Additionally
* Activable -> Activatable
* adjustting -> adjusting
* Aggresive -> Aggressive
* agressively -> aggressively
* agressive -> aggressive
* Aleady -> Already
* alernate -> alternate
* aligh -> align
* Alloctor -> Allocator
* allready -> already
* Althought -> Although
* Amonst -> Amongst
* anthing -> anything
* Anthyhing -> Anything
* Aquired -> Acquired
* aquire -> acquire
* Architecure -> Architecture
* Arthimatic -> Arithmetic
* artiface -> artifact
* artifical -> artificial
* Arugment -> Argument
* assigining -> assigning
* atomicly -> atomically
* auxillary -> auxiliary
* avilability -> availability
|
|
This serves two purposes:
- Compute MaxStack for generated IL. We were estimating the MaxStack by reporting the number of bytes of IL but this was inhibiting inlining in RyuJIT
- Add code to validate stack balance for IL we generate. This lets us catch issues before they reach codegen. This should help productivity because it lets us avoid having to either build a checked RyuJIT to troubleshoot this, or debug the IL manually on paper.
|
|
This is fixing several problems with how we did `ToString`:
* The existing scheme required every `TypeDesc`/`MethodDesc`/`FieldDesc` descendant to override `ToString`. Of course we were not consistent with this and as a result, most of our synthetic type system entities had non-existent representation in the debugger. Overriding is a lot of boilerplate.
* We were not flexible with the stringified names. E.g. instantiated types became too long because we were module- and namespace- qualifying everything.
* (Minor) The runtime type loader was shipping with ToString support in retail configuration that was largely unused.
With the new scheme, besides fixing the problems above, I'm adding a bunch of conveniences:
* `MethodDesc` now also have signatures in their `ToString`.
* Well-known primitive types have short aliases
* System.Private prefix is shortened to S.P.
I tested that the `TYPE_LOADER_TRACE` still works after this. The runtime type loader overrides the `ToString` in all the places that matter.
|
|
- Add ordinal import mechanism to ready to run header
- Add concept of various different types of export to nodes (Now nodes can be exported by symbol name or by ordinal)
- Abstraction of how nodes from exported modules are imported (ImportedNodeProvider)
- Import/Export table nodes (MrtProcessedImportAddressTable, MrtProcessedExportAddressTable)
- Runtime decodable jump stubs
- Tweaks to floating dictionary computation to behave correctly when no floating section is present, and to tolerate floating sections without version numbers
- Not integrated with the open source version of the compiler, but the basic nodes and necessary infra are present
Also
- Allow a TypeSystemContext to specify the module in which the Canon types are logically located
- Overrideable apis for the CompilerTypeSystemContext to allow customization of the set of methods logically present on Enums and Delegates
- New apis on CompilationModuleGroup to allow more granular policy to be specified about what is to be compiled
- Adjust GetName helper for MethodSignature to produce names that are more unique
- Fix bug in floating generic dictionary implementation where it assumed that the floating section was present in all dictionaries
- ARM64 indirect jump generation (with a assert to be disabled when it is debugged)
[tfs-changeset: 1682436]
|
|
Over the years, I had a "sigh, I wish Canon types were MetadataTypes" moment several times. I just had another of those.
I don't actually remember why we made these inherit `DefType` instead of `MetadataType`. We can come up with the right answers to all questions a `MetadataType` needs to answer. Canon types not being `MetadataType` is also the sole reason why `RuntimeDeterminedType` can't be a `MetadataType` either.
[tfs-changeset: 1680914]
|
|
required to make certain cases of generics work in ProjectX, since the STS typesystem has representation for those, and requires them to be mirrored on the CoreRT side (for correct dependency analysis and dictionary building)
[tfs-changeset: 1679775]
|
|
|
|
instantiation (#4641)
* Added test case for generic instantiation with generic constraint instantiated with generic parameter.
* Implemented instantiation of generic parameter constraints in constraints check.
* Changed GetInstantiatedConstraints to use ArrayBuilder instead of List.
* Added recursive constraint instantiation.
* Added instantiation context to be able to instantiate generic generic constraints.
* Added additional tests for CheckConstraints with InstantiationContext.
|
|
Rewrite the test data to IL and add an extra test for good measure.
Fixes #4665.
|
|
|
|
|
|
|
|
(#4576)
* Fixed assigning interface with variance to object generating verification error.
* Added test cases for casting variant interface to object.
* Removed interface check in non variant path of CanCastToClass.
|
|
* Added VerifierError for ldftn/ldvirtftn of constructor.
* Implemented basic ldftn and basic delegate creation functionality.
* Added TestName attribute to TestCases to further shorten display name of tests.
* Implemented basic ldftn functionality and constraint checks. Moved type conversions to helper class.
* Added test cases for ldftn and newobj of constrained generic types.
* Added test cases for ldvirtftn. Fixed display of invalid test errors.
* Changed constraints checks to use ConstraintsHelper class. Added additional test cases for GenericParam as generic parameter with special constraints.
* Added additional constraints check for generic parameters with special constraints.
* Fixed typo in filename of TypeSystemConstraintsHelpers.
* Fixed typo in 'ILDisassember'.
* Slight code refactoring. Added reference to test case assert issue.
|
|
|
|
This fixes a long standing pet peeve of mine: F11 into the
`__managed_Main` method doesn't work and steps over the method instead.
This adds infrastructure so that we can do `DebuggerGuidedStepThrough`
on generated methods.
A slight annoyance is that for UTC, the FEEFEE sequence point needs to
be on a NOP that precedes the call, and that scheme doesn't work for
RyuJIT. But UTC will need to fix that anyway because we won't be
rewriting IL for them in the future and no-NOP is how
DebuggerGuidedStepThrough methods are in C# when used from within the
BCL.
|
|
Also took the opportunity to make the IsByRefLike flag not be a property
of the field layout (but use the newly approved custom attribute that
everyone else uses).
Fixes #4220.
|
|
Throwing an exception from the type system is a rather complicated thing because the type system is used in so many places. The basic requirements are:
* The runtime type system needs to throw the runtime exceptions (System.TypeLoadException, System.BadImageFormatException, etc.).
* The compile time type system needs to throw exceptions in a way that we can "serialize" the thrown exception into a chunk of code that will throw the desired exception at runtime. This is to emulate the CLR behavior you would get if you e.g. mess up your StructLayout, or feed the compiler garbage in general.
* The exception message thrown or serialized from the compiler can have different languages (the localization of the compiler doesn't have to match that of the running compiled executable).
With this change, all exception throwing happens through a ThrowHelper. We have two ThrowHelpers - one used by "compile time type systems" and another one used by the runtime type system. They share the logic to format the type names and exception message strings.
[tfs-changeset: 1665419]
|
|
- Pick up latest .NET Core 2.0 CLI and buildtools
- Remove all project.json references and convert everything to msbuild projects
- Stick to vanilla .NET CLI project shape as much as possible. Minimize dependencies on buildtools special behaviors
|
|
[tfs-changeset: 1662283]
|
|
|
|
The latest project templates do not have it, and it is only good for generating warnings like the following in the detailed build log:
Project file contains ToolsVersion="4.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="14.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.
[tfs-changeset: 1662024]
|
|
Refactor GVM algorithm for better performance
Fix GVM resolution bug on derived types
Fix bug with variance (https://github.com/dotnet/corert/issues/3454)
|
|
Generate runtime interop data for structs and delegates
|
|
|
|
* Remove problematic use of NotImplementedException
- Mostly convert to NotSupportedException
- For IsByRefLike, implement correctly
- References issues 190 and 3772
- Fixes #3760
|
|
* Implement `isInSIMDModule`
* Implement `appendClassName`
* Implement a type name formatter that roughly approximates
typestring.cpp in the CLR. Should be enough for the purposes of
recognizing SIMD intrinsics. Hopefully, we won't ever have to be
complete. This is the formatter used by reflection - the rules are
complex and long.
* Implement custom type layout for `Vector<T>`
|
|
Calling `InstantiateSignature` on `Foo<T__Canon, !0>` should have no
effect on the `T__Canon` part.
I was trying to avoid duplicating code when I was porting
RuntimeDeterminedTypes out of NUTC by reusing `InstantiateSignature` to
also do
`GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution`
but we really need the duplication.
|
|
CastingHelper (#3666)
* Handling interface->object assignment + test
* Adapted logic in CanCastToClass and use CastingHelper.CanCastTo in IsAssignable(TypeDesc src, TypeDesc dst)
|
|
Three parts:
1. Update casting logic to allow casting SzArray to rank 1 MdArray (but
not the other way around)
2. Update MdArray rank 1 methods to be able to operate on SzArrays
3. Update array creation path to emulate the behavior where allocating
rank 1 MdArray with 0 lower bounds actually gives you an SzArray
Third bullet point makes this the most annoying, because we can't
reliably support `newobj instance void int32[0...]::.ctor(int32)`
without hitting the type loader. I was also considering adding an
optional field on Rank 1 MdArrays that lets you get to the SzArray's
EEType from it. It might be better.
Fixes #3331.
|
|
This was special cased in CorInfoImpl because that's where CoreCLR
special cases it, but the entire system should consider these not having
a lazy cctor. This cctor is triggered differently.
Noticed while working on the IL scanner. Also made this check faster
while I was at it.
|
|
RuntimeDeterminedTypes
- Add RuntimeDeterminedFieldLayoutAlgorithm type
- Expose ValueTypeShapeCharacteristics directly from DefType instead of just representing the various flags
- Adjust compiler type system context to support usage of RuntimeDeterminedFieldLayoutAlgorithm
[tfs-changeset: 1657930]
|
|
Move two name mangling dot files under the Common folder
Add a regression test for the NativeStructType naming
|
|
Delegates
|
|
Follows the same divide and conquer pattern as the code to sort
TypeDescs (#3258 - compare between classes using `ClassCode` and have
the classes handle comparions within the class).
|
|
Follows the same divide and conquer pattern as the code to sort
TypeDescs (#3258 - compare between classes using `ClassCode` and have
the classes handle comparions within the class).
|
|
|
|
Use the new IPrefixMangledType interface to disambiguate structs with
the same name from different input assemblies.
|
|
Michal added concept of prefix mangled type/method couple of
days ago which enables us to add managled name for delegate and struct
marshalling stubs.
|
|
* Add concept of "prefix mangled type/method"
For type system entities (method/types) that are generated by the
compiler, we don't have a good way to guarantee a unique mangled name.
In the ECMA-based world, we rely on enumerating everything in the
assembly to generate a guaranteed non-conflicting name. On the
compiler-generated side, we don't have a good way to do such enumeration
because there's no central database of those things.
We were using multiple techniques to guarantee nonconflicting names:
1. Counter (problematic for stability when we go multithreaded)
2. Wrapping in a custom node type with special rules (extra code)
3. Getting a mangled name to use as type system name (in delegate
marshalling - kind of odd thing to do)
4. Hoping that two types names just won't conflict (I think there are
such patterns still remaining in struct marshalling)
I was in a place where I started inventing method 5 (for
`MethodBase.GetCurrentMethod` intrinsic expansion).
What we really want in all those places is just to say: "use the mangled
name of something we know we can generate a nonconflicting name for, and
append some prefix".
This change adds just that, and switches 1 and 2 from the above list to
the new plan.
|
|
Marsahal fixed size arrays, ansi string, and unicode string.
|
|
[tfs-changeset: 1652530]
|
|
This won't cover literals but otherwise, gets the
job done.
Note that LockFreeReaderHashTable was declared public
(and so were a ton of classes that derived from it,
so I couldn't just make it private.)
Including it in CoreLib.dll means no one above
CoreLib can include it - they'll just the public
one from CoreLib.dll.
|
|
This is basically three things:
1. `ByReference<T>` support
2. General support infra in the type system for Byref-like types (to be
reused for e.g. `Span<T>`).
3. TypedReference
Fixes #367.
|