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-23Add wasm debug info (#6186)Morgan Brown
* Add source line debug metadata. Works with javascript output. * Add names of arguments and locals when they're stored on the stack (and thus easily visible in the debugger) * Add debugging information to documentation
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-08-06Fix calling sealed virtual methods now that sealed vtables are always ↵Morgan Brown
enabled. (#6180)
2018-08-02WASM: Multidimensional array instantiation fix (#6096)Blealtan
* Handle multidimensional array instantiation (#5421) newobj instruction on multidimensional array is now processed with ArrayHelpers.NewObjArray. Enabled instantiating multidimensional arrays. * Add testing for multidimensional array instantiation. Only nullity and lengths are checked due to get & set not working on multidimensional arrays.
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-05-23Fixes emitting end offsets for R2R header regions by: (#5844)Morgan Brown
1. Incoporating offsetFromSymbolName in offset calculations 2. Sorting node emission so sizes are computed before trying to emit them
2018-05-20Optimize WebAssembly value types (#5738)Morgan Brown
Optimize structs by making them be structs or scalars in llvm instead of arrays. Store locals that don't have GC pointers on the local stack instead of the shadow stack. Only saves a few % of release build size, but saves 15% in debug builds and makes debugging significantly easier.
2018-05-17Double/Float casting and comparisons, push floats as 64bit to stack (#5813)yowl
Fix double cast push floats and doubles to stack as double add some more tests around float/double comparisons
2018-05-15improved llvm generated variable names (#5794)Jeff Greene
2018-05-11fix dup instruction result to no longer reference the original memory in ↵Jeff Greene
WASM (#5784) fix dup instruction result to no longer reference the original memory added additional dup test cases
2018-04-26Enable Interface dispatch for WASM (#5748)Jeff Greene
Interface dispatch
2018-04-25Fix issues related to WebAssembly interface dispatch: (#5735)Morgan Brown
1. Don't add a vtable offset to interface slot numbers 2. Ensure values are loaded before applying conv to them to avoid loading too wide of a value (found when interface dispatch loads a uint16 and then converts to IntPtr)
2018-04-07Initialize modules and run StartupCodeMain in wasm (#5621)Morgan Brown
Code to call InitializeModules on startup and associated bug fixes and workarounds. Handles mismatched struct calling conventions between LLVM and Clang and works around the dup opcode incorrectly reloading values. Enables StartupCodeMain and fix associated bugs in pinvokes. Implements main return codes
2018-03-28Use a shared DynamicInvoke for delegates and reflection (#5615)Michal Strehovský
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.
2018-03-06Static constructors for WebAssembly (#5425)Morgan Brown
* Implement static constructor triggering. Also includes several bug fixes found in the process: * Don't make the ClassConstructorRunner depend on module intialization * Moves non-GC statics and thread statics from globals to the type's data regions. GC statics can't be moved until we can call InitializeModules on startup. * Devirtualizing interface calls to structs in order to be able to compile the class constructor runner. * Add a prolog block before Block0 to allow branching to Block0, which happens in retail builds * Correct use of unreachable in traps and at the end of finally blocks to fix more retail build problems * Stop reusing spill slots when a spilled value is spilled again. This avoids cases where the spills feeding into a block don't use the same slot * Enable thunks for NativeCallable methods and call RhpReversePInvoke for them * Fix alignment for cases where a small type is followed by a larger one * Workaround for Emscripten atomics bug
2018-03-02Sealed VTables implementation for CoreRT/ProjectX (tested on both). Changes ↵Fadi Hanna
include: 1) New node type for the sealed vtables 2) Logic in EETypeNode to emit the proper sealed vtable related bits, and not emit sealed newslot methods in the regular vtable 3) Changes in the algorithm that computes the virtual method slot to handle sealed vtable entries 4) Avoid creation of interface dispatch maps for special array types (mdarrays and arrays of pointers) Current size gains we get with the shared library is about 3% for amd64 ret on ProjectX. Average app size reduction is about 5% [tfs-changeset: 1690448]
2018-02-28Implement intrinsic call to RuntimeHelpers.InitializeArray for WASM (#5377)Blealtan
* Implement intrinsic call to InitializeArray. RuntimeHelpers.InitializeArray is implemented as a call to LLVM intrinsic llvm.memcpy.p0i8.p0i8.i32, which copies from generated global constant to provided target array. Currently the base size of the array object is hardcoded to 8, since no EEType is provided in the intrinsic call. Fix #5345. Add testing code for InitializeArray in HelloWasm. Roslyn generates RuntimeHelpers.InitializeArray for arrays of integral types with initializer of length greater or equal than 3. Here we use this feature to generate a call to RuntimeHelpers.InitializeArray for test. Catagorize array argument types in InitializeArray Differently handle vectors, multidimensional arrays and object typed arrays in InitializeArray intrinsic.
2018-02-22Fix binplacing of libLLVM during VS build (#5427)Jan Kotas
2018-02-22Fix F5 debugging of ILCompiler project (#5422)Jan Kotas
Trying to debug ILCompiler in Visual Studio was failing with missing assemblies. The problem was caused by recently added libLLVMdep.depproj reference that made NuGet delete certain files from the output tools directory. The fix is to move the .depproj reference to a different part of the build next to other similar .depproj reference where it won't be confusing NuGet.
2018-02-07Implement break opcode as llvm.debugtrap (#5344)Blealtan
* Implement break opcode as llvm.debugtrap. In Emscripten, `llvm.debugtrap` is implemented as a round-trip call to `debugger;` statement JavaScript which will invoke debugger in browsers; and in LLVM it's implemented as `unreachable` instruction of WASM. This should be a better match than `llvm.trap` on `break` opcode semantics. Fix #4511 Set IsDebuggerPresent to TRUE in case of WASM. Although `Debugger._isDebuggerAttached` is not set, this modify itself will allow `Debugger.Break` to work. Add test in HelloWasm for `Debugger.Break`.
2018-02-06Cleanup NuGet rids (#5353)Jan Kotas
Switch rid to generic linux in most places and stop pretending that we are on ubuntu-14.04. ubuntu-14.04 is left just at the two places that still need it.
2018-02-04Fixed ldind failure and properly zext unsigned types that are smaller than ↵Jeff Greene
32bit (#5342)
2018-02-04Add support for building wasm on OSX and Ubuntu 16 (#5297)Christian Scheuer
* Enable wasm building on OSX. Upgrade libLLVM to 4.0.0 and LLVMSharp to 5.0.0 LLVM upgrade: Fix 'Use still stuck around after Def is destroyed' of the deleted basic blocks Add wasm support in runtest.sh Remove HelloWasm.csproj reference to .ilproj on non-windows OS because of dependency on ilasm Fix LinkNative target to execute correct commands for Unix wasm builds. Added support for building on Ubuntu 16.04.3 Update documentation on how to build WebAssembly.
2018-02-03Implement castclass & isinst for WebAssembly (#5325)Blealtan
* Implement castclass & isinst for wasm (#4510) Implement castclass and isinst opcodes in ILToWebAssemblyImporter by doing related function calls to methods in System.Runtime.TypeCast. Fix #4510 Add castclass & isinst test in HelloWasm. This includes three types of casting: * castclass/isinst to classes. * castclass/isinst to interfaces. * castclass/isinst to array types. For now, the second and third part of test is failing due to runtime implementation problems which should be further digged into.
2018-01-31Implement localloc for WebAssembly (#5298)Morgan Brown
* Implements localloc and fixes other issues required to make Int32.ToString work (which relies on stack allocation, Spans and various value type special cases). Includes: * Allocating localloc buffers on the C++ stack since they're guaranteed not to have GC references and LLVM might be able to optimize them a bit better * Handling newobj for value types by allocating them in a spill slot * Implementing the ByReference.get_Value intrinsic * Fixing various shadow stack management bugs around calls. In particular, return values are now spilled to avoid the next call overwriting them. * A few new tests
2018-01-29Implemented Array instructions for WebAssembly (#5172)Jeff Greene
implemented array instructions, implemented internal calling convention, switched to managed runtime calls, Refactored call to not require stack operations, finished work to map pinvokes into the same generated methods/signatures
2018-01-21force alignment for all stack allocations in WebAssembly (#5207)Jeff Greene
* force alignment for all stack allocations made alignment less wasteful more closely match the alignment logic for fields
2018-01-13Implement WebAssembly delegates (#5143)Morgan Brown
* Implement WebAssembly delegates and fix other minor codegen issues.
2017-12-31Implement cpobj opcode for wasm (#5151)Wayde Reitsma
* Implement cpobj opcode for wasm Implements the ILToWebAssembly.ImportCpObj method using an LLVM load and store. Adds a test for for wasm cpobj to the HelloWasm test using an IL project.
2017-12-27Link WebAssembly runtime (#5141)Morgan Brown
* Changes to hook up the portable runtime and bootstrapper. Includes implementing allocation using RhpNewFast as well as some floating point codegen fixes required to make the new code compile. Removes usage of buggy dladdr API in WebAssembly, fixes order of conditional branch expressions, which fixes printing when C# optimizations are enabled, adds debug and release flags to emcc, updates WebAssembly documentation to reflect the new build flavor and linking steps. Adds thunks for RuntimeExport methods to fix linker errors for missing runtime exports.
2017-12-17[ILVerify] Implement tail-ret and invalid method end verification (#5122)Samuel Arzt
* Implemented tail-ret sequence verification. * Added test cases for tail-ret sequence. * Fixed ILImporter not calling EndImportingInstruction when returning from switch. * Added ReportMethodEndInsideInstruction to ILImporter. * Changed ReportMethodEndInsideInstruction to be reported inside FindJumpTargets. * Added additional tail-ret tests. * Changed tail-ret verification to be done in ImportCall. * Changed ReportMethodEndInsideInstruction to be reported for all il stream read operations.
2017-12-08Added real support for Unbox stubs to WebAssembly (#5052)Jeff Greene
* Added real support for Unbox stubs to WebAssembly
2017-12-01Drive devirtualization using scanner's resultsMichal Strehovský
2017-11-30enabled thread static fields in WebAssembly (#4999)Jeff Greene
* enabled thread static fields, changed vtable dispatch to not be dependent on EETypeNode, added typed node factory
2017-11-30Ordinal Multifile supportDavid Wrighton
- 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]
2017-11-17Added support for calling methods via virtual slots in WASM (#4931)Jeff Greene
* Added support for calling methods via virtual slots
2017-11-06added support for box/unbox/unbox_any for WASM using malloc (#4731)Jeff Greene
2017-11-05implement newobj for WASM using malloc (#4872)Jeff Greene
implemented newobj for WASM using malloc
2017-11-03Revert "implemented newobj for WASM using malloc (#4808)" (#4864)Morgan Brown
This reverts commit 3b9a7fc3fc60fdca245f431bfa40672f087a53d5.
2017-11-01implemented newobj for WASM using malloc (#4808)Jeff Greene
implemented newobj using malloc, added evaluation stack spillage and cut down on unneeded llvm casts
2017-10-30Stabilize object file images (#4818)Simon Nattress
* 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.
2017-10-23Emit switch in wasm (#4769)Juan Antonio Cano
* Implement switch opcode Fix #4519
2017-10-23Search/replace Debug.Assert(false, => Debug.Fail( (#4782)Jan Kotas
2017-10-23Emit donothing on nop. Fix #4529 (#4776)Juan Antonio Cano
2017-10-21Added support for ldsfld/stsfld/ldsflda/ldflda including general value type ↵Jeff Greene
support (#4729) Added support for ldsfld/stsfld/ldsflda/ldflda including general value type support, throw on invalid branches to the first basicblock in a routine and ensure type sameness for icmp
2017-10-17WebAssembly instance method support (#4695)Morgan Brown
* Fix instance method parameter management and a couple of codegen issues that showed up when more methods started compiling. Includes implementing ldfld for instance fields (progress toward #4530) and the leave opcode. This is enough to make the String.Length getter work.
2017-10-17Fix too verbose logging in CppCodeGen (#4738)Jan Kotas
2017-10-17Throw opcode with trap. (#4736)Juan Antonio Cano
* Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525 * Neg and not basic tests added to HelloWasm. Name parameter updated in LLVM build methods to reflect the operation being built. Use PushExpression method instead of direct push to stack. * Implement throw opcode. Fix for #4528 * Unreachable removed and trap call refactored in throw import method.
2017-10-15Implement Shift Opcodes for WebAssembly (#4721)Jeremy Koritzinsky
* Implement shift opcodes * Fix HelloWasm test. * FIx HelloWasm test program.
2017-10-15Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525 ↵Juan Antonio Cano
(#4725) * Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525 * Neg and not basic tests added to HelloWasm. Name parameter updated in LLVM build methods to reflect the operation being built. Use PushExpression method instead of direct push to stack.