Age | Commit message (Collapse) | Author |
|
* Determinism test harness
Add a /determinism mode to runtest.cmd that will invoke ILC twice with different random determinism seeds. This causes graph expansion to be randomized based on seed (though deterministic for a given seed).
* Add Utf8String.CompareTo
Implementation taken from S.P.CoreLib. All the loop unrolling optimizations were excluded; we re-implement them if this function becomes a perf bottleneck.
* Define the mechanisms for determinism
To ensure deterministic output, all nodes that are emitted to the binary are sorted after compilation when retrieving the final marked nodes list. The overall approach is to sort nodes of the same type together (ie, all EETypeNodes come before NonGcStaticsNodes). Within nodes of the same type, a comparison function uses a CompilerComparer to compare the key identifying data of a node. For example, an EETypeNode is defined by a TypeDesc. The CompilerComparer provides a stable comparison function for comparing various type system primitives. Some nodes need to be emitted in an early and specific order for compiler correctness; this is provided by partitioning all sorted nodes into two phases: the first phase containined specifically ordered nodes, and a second phase for all other nodes whose ordering in the output binary doesn't matter.
Add SortableDependencyNode abstract class which provides the sortability layer on top of a DependencyNodeCore. Both ObjectNode and EmbeddedObjectNode derive from SortableDependencyNode to provide sortability across all nodes that are emitted to the output binary.
Introduce `ISortableSymbolNode` to provide sortability for nodes that are currently referred to in the compiler via the ISymbolNode interface. Such nodes are actually `ObjectNode` or `EmbeddedObjectNode` instances that we've lost type information for. Instances that implement `ISortableSymbolNode` redirect to the matching SortableDependencyNode methods.
Add `EmbeddedDataContainerNode` as a base class of `ArrayOfEmbeddedDataNode` to allow comparison of different instantiations.
Refactor the interface dispatch map index calculation so it's done when the dispatch map is emitted at the end of compilation. Previously it was done when the indirection cell in the dispatch map array got marked. This mechanism is incompatible with generating stable dispatch map indices. The arrays of embedded nodes now stabilize IDs as they emit their final data. This introduces an output ordering dependency - OptionalEETypeNodes must be emitted after the dispatch map since they encode dispatch map indices. Manually enforce this with C++ code generation, since it doesn't emit the real dispatch map structure and builds its own.
Modify InterfaceDispatchMapNode to use the type name in name mangling instead of an index into the dispatch map table.
Modify ObjectDumper to also amit a sha256 hash of each node's data. This dump is used to diff the map files and prove determinism.
* Fill out ordering functions for all nodes
Most of these are not very interesting. Here's the overall approach:
- Every different type of node needs a unique ClassCode. These were generated using Math.Random.
- The various metadata / native layout nodes plus arrays of EmbeddedObjectNodes get placed in the Ordered phase with specific ordering of each.
- All other nodes go in the Unordered phase
- To order nodes of the same type, the data that represents the key for the node in NodeFactory is compared. Ie, for an EEType, that would be its defining TypeDesc, whereas a FrozenStringNode is defined by the string it represents).
- The marked nodes list also contains raw DependencyNodeCore<T> nodes, which aren't emitted. Those are all shuffled after the emitted nodes and not sorted amongst themselves. That hasn't proven to be a problem with determinism and saves a bunch of hopefully unnecessary comparisons.
|
|
|
|
Yesterday's change to the class disqualifies it from living in `\Common` directory and the `Internal.TypeSystem` namespace.
[tfs-changeset: 1679305]
|
|
<typename>::'vftable' . The "const " prefix was left out of projectx symbol generation because of concern about having spaces in symbol names. But the debugger expect the "const " prefix since the rhbinder generate it. Adding the "const " prefix to EEType managed name for windows.
[tfs-changeset: 1679271]
|
|
Merge nmirror to master
|
|
We are missing the functionally of generic complexity computation in CoreRT. This affects debug record generation for lazy generic types. For now, fall back to using the canonical form for any lazy types.
Wit this we lose some debugging support when just using windbg or VS in native debug mode when debugging. However, it doesn't have any impact on the debuggability of things in the managed debugger.
[tfs-changeset: 1679165]
|
|
Merge nmirror to master
|
|
binder does.
This fixes an offset issue we were having with GCDescs for dynamic types, generated by the type loader.
[tfs-changeset: 1679098]
|
|
construction of types accessible through lazy generics code.
[tfs-changeset: 1679067]
|
|
- The existence of a static field block for a type which has canonically equivalent reflectable implementation requires the type that contains the static field to be necessary. This allows FieldInfo.GetValue/SetValue to work correctly
- If a constructed type has a generic virtual method defined upon it, and universal generics is enabled, force the virtual method to have a universal shared generic implementation
- Add a helper routine for getting the maximally constructed type symbol.
[tfs-changeset: 1679063]
|
|
EEType and build a blod of virtual method token to slot number.
[tfs-changeset: 1679025]
|
|
structs
For GVMs that use the canonical implementation, if their owning types are structs, the canonical template should be the unboxing stub instead of the real target. However, the template signature should not have the IsUnboxingStub set because all template lookups performed at runtime are performed with this flag not set, since it can't always be conveniently computed for a concrete method before looking up its template.
[tfs-changeset: 1678892]
|
|
|
|
Merge nmirror to master
|
|
with unix envirtonments. (#4760)
|
|
Generic method on lazy generic type should also have a lazy generic dictionary otherwise generic lookups over the containing type's arguments may get expanded unlimitedly
[tfs-changeset: 1678427]
|
|
|
|
|
|
Merge nmirror to master
|
|
ProjectNDependencyBehavior.EnableFullAnalysis is enabled
- Fix InstantiatedMethod.GetCanonMethodTarget to handle all possible cases of universal generic promotion instead of ones that only involve non-universal canonical generics
- Enable consistent results from HasReflectionInvokeStubForInvokableMethod when full analysis is enabled
- Enable CodeBasedDependencyAlgorithm to create reflection target method bodies
- Add asserts to NonExternMethodNode to ensure that we don't attempt to compile partially canonicalized methods
[tfs-changeset: 1678328]
|
|
|
|
Merge nmirror to master
|
|
This is temporary until we fix issue #72, but the scope for that issue seems rather large.
|
|
The current naming scheme for data blobs is not deterministic. This is fixed in this change by using the sha256 hasher to ensure a high degree of stable uniqueness. However, this might be a chance the uniqueness is violated. Debug code is added to detect this.
[tfs-changeset: 1677971]
|
|
- Remove requirement that all universal canon instantiations have vtables. (In particular, remove vtable handling from the template in the presence of ByRefLike structures
- Use necessary type for template of canonical byreflike types
[tfs-changeset: 1677901]
|
|
FrozenArrayNode depends on the preinitiailzed data which is not captured in its GetStaticDependencies routine. This is fixed.
[tfs-changeset: 1677823]
|
|
- Add sorting support to SignatureVariable
- Needed to allow all kinds of generic lookups to be sorted
- Fix typo in DictionaryLayoutNode
- only emit the fixed entries when asked to do so
- Adjust dependency handling in NativeLayoutDictionarySignatureNode
- The WriteVertex method always takes a dependency on DictionaryLayoutNode, so explicitly make it a static dependency
[tfs-changeset: 1677801]
|
|
actually handled as singletons
- Do not re-initialize the global dictionary whenever a NodeFactory is created
[tfs-changeset: 1677563]
|
|
- Make it possible to define a DictionaryLayoutProvider outside of ILCompiler.Compiler dll (visibility changes to public on various types/methods)
- Add a concept of fixed layout regions of dictionaries and non-fixed regions (So that dictionary layouts that are partially fixed could be supported)
- Add IntegerLookupResult and PointerToSlotLookupResult classes to the set of GenericLookupResults. (Now, all things that may be in a generic dictionary can be represented as GenericLookupResults)
- They are handled as singletons to reduce the need to shuffle NodeFactories to inconvenient locations
[tfs-changeset: 1677562]
|
|
[tfs-changeset: 1677319]
|
|
- Provide temporary mechanism to dynamically change dependency analysis for ProjectN abi scenarios
- Make ShadowConcreteMethodNode public so that it can be manipulated by code outside of the current module
[tfs-changeset: 1677100]
|
|
- Create signature encoder that is useable with multiple sources of valid tokens
[tfs-changeset: 1676780]
|
|
|
|
Merge nmirror to master
|
|
[tfs-changeset: 1675737]
|
|
* Fixed block re-verification after stack merge possibly causing endless loop.
* Refactored BasicBlock.EndOffset to BasicBlock.ImportState.
|
|
Merge nmirror to master
|
|
firing. Change it to sort ascending.
[tfs-changeset: 1675237]
|
|
Signed-off-by: Petr Bred <bredpetr@gmail.com>
|
|
* 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.
|
|
GetTypicalMethodDefinition should be used to get the MSIL token instead of GetMethodDefinition
[tfs-changeset: 1674872]
|
|
[tfs-changeset: 1674862]
|
|
GetTypicalMethodDefinition should be used to get the MSIL token instead of GetMethodDefinition
[tfs-changeset: 1674855]
|
|
array fields
For static array fields, the real element type which can be a descendent of the declaring type must be added to the preinitilizeded data. The element count should also be there.
[tfs-changeset: 1674701]
|
|
Merge nmirror to master
|
|
Changes include
1. Fixing a bug of resolving type references with namespaces
2. Do not fail fast if a type reference fails to resolve
3. Fix a bug of parsing merged assembly records
[tfs-changeset: 1674337]
|
|
Experimental WebAssembly support
|
|
|
|
falling through basic blocks
|
|
|