Age | Commit message (Collapse) | Author |
|
|
|
* Fix issues building the runtime, corelib and type loader for WebAssembly
* Fix test infrastructure to allow running with the wasm flavor
|
|
|
|
Add support to cmake files for wasm build
|
|
Also enabled cross compilation of x86 binaries on x64 host.
Ubuntu Dockerfiles:
<details>
<summary><b><ins>Baseline: x64 build on x64 host</ins></b></summary>
```dockerfile
FROM ubuntu
RUN cat /etc/*-release
RUN apt-get update
RUN apt-get install -y \
autoconf bash clang cmake gcc libtool curl \
libunwind-dev llvm make openssl lldb git uuid-dev
RUN git clone https://github.com/dotnet/corert -b master --single-branch
WORKDIR /corert
RUN ./build.sh # or ./build.sh x64
```
</details>
<details>
<summary><b><ins>PR: x86 build on x86 host</ins></b></summary>
```dockerfile
FROM i386/ubuntu
RUN cat /etc/*-release
RUN apt-get update
RUN apt-get install -y \
bash clang cmake gcc libtool curl \
libunwind-dev llvm make openssl lldb git uuid-dev
RUN git clone https://github.com/am11/corert -b linux-x86 --single-branch
WORKDIR /corert
RUN ./build.sh x86
```
</details>
<details>
<summary><b><ins>PR: x86 build on x64 host</ins></b></summary>
```dockerfile
FROM ubuntu
RUN cat /etc/*-release
RUN apt-get update
RUN apt-get install -y \
bash clang cmake gcc libtool curl \
libunwind-dev llvm make openssl lldb git uuid-dev \
g++-multilib
RUN git clone https://github.com/am11/corert -b linux-x86 --single-branch
WORKDIR /corert
RUN ./build.sh x86
```
</details>
|
|
|
|
This change adds support for Server GC.
To enable the Server GC for an application, the RH_UseServerGC environment variable (which is already supported by the runtime) should be set to 1.
|
|
Enable return address hijacking for thread suspension on Windows x64
* Code review feedback
|
|
- Fix initialization of stress log, cleaned up the overall initialization sequence
- Remove spurious NO_STRESSLOG definion that disabled some of the stresslogging
|
|
[tfs-changeset: 1650991]
|
|
Initital support for delegate marshalling.
- Enabled only in full runtime
- Doesn't work in non-windows platforms
- Only supports open static delegates
|
|
Fixed issues and concerns from mirroring to Github
[tfs-changeset: 1647030]
|
|
[tfs-changeset: 1646943]
|
|
store the address of the method to be called in a FuncEval.
[tfs-changeset: 1645909]
|
|
CoreRT, and adding all the conversion helper stubs
|
|
The runtime is not compatible with jump stubs inserted by incremental linking, and it does not seem to be helping us much anyway.
Fixes #2348
|
|
This change replaces external libunwind usage on Unix by a copy of the LLVM libunwind.
It also modifies libunwind to support reporting register location and implements
the unw_get_save_loc API to get this location.
For now, only memory locations are supported (register locations are not).
|
|
allocated dynamically in memory using VirtualAlloc. The thunk stubs pages are marked with RX permissions and the thunks data pages are marked with RW permissions.
Refactored some code in ThunkPool.cs to remove from it any knowledge about the thunk sections layout. Thunks layout and allocation become a black box to ThunkPool.cs. All the section layout information is moved to the native component, and section navigation is done by calls to some APIs.
The dynamically allocated thunks pages are enabled by a FEATURE_RX_THUNKS, and only in CoreRT's Full build for now. The portable build doesn't yet support thunks.
[tfs-changeset: 1638131]
|
|
[tfs-changeset: 1636196]
|
|
After feedback from Jan, we've already opened-sourced
a vetted C++ SHA1 algorithm in CoreClr, so rather than
impose a dependency on crypto at the lowest level,
we'll port that code into mrt100_app.dll.
Unfortunately, the actual act of *adding* a simple .cpp
file to MRT, let alone a new export, is harder than actually
implementing it, and requires touching TFS-only files.
So we'll add the import as a NYI stub as the first step,
then finish the work once it propagates to the CoreRt master branch
(that seems to be the most efficient work environment for
this kind of job.)
The new import converts a PK to a PKT by computing the
SHA1 and reverse-copying the last 8 bytes. Doing the
reverse-copy-8 in C++ prevents the non-FIPS-compliant SHA1
algorithm from turning into an attractive nuisance by
being exported directly from MRT.
SHA1.cpp and SHA1.h are verbatim copies of CoreClr's
versions, which we're committing now to establish
a diff history. Since adding a .cpp file is such a chore,
we'll include it in the build with the #if 0's" in the magic
places to keep the build system and file tracker
off the scent.
The "pbPublicKeyToken" can only be 8 bytes, so
strictly speaking, passing a length argument isn't
necessary but passing an unguarded buffer to C++
gets everyone looking at you like you have fleas
so we'll add the extra defense-in-depth parameter.
[tfs-changeset: 1630122]
|
|
to ProjectN. The nature of the changes in this changelist is very similar to the changes done in CoreCLR described in the linked PR:
1) This change synchronizes the ndp/FxCore/CoreRT/Native/gc and src/vm/gc directories of ProjectN and coreclr, respectively. There is one additional change present in this changelist that was not done to CoreCLR (and will need to be ported to CoreCLR), and that is the addition of IGCHeap::RegisterFrozenSegment and IGCHeap::UnregisterFrozenSegment to the interface. These functions are invoked from RedhawkGCInterface::RegisterFrozenSection and as such must be present on the interface. This is a very minor change that involved ensuring that Register/UnregisterFrozenSegment are defined for all builds (not just defined when FEATURE_BASICFREEZE is defined) and propagating the definition of those two functions to IGCHeap, instead of IGCHeapInternal where they resided on CoreCLR. Calling either of those two methods with FEATURE_BASICFREEZE not defined results in an assert.
2) Like the changes to the VM in CoreCLR, uses of GCHeap in CoreRT/Native/Runtime are redirected to the GCHeapUtilities class, which maintains the singular IGCHeap instance and provides a number of static methods used by the runtime to access and query the state of the heap. For most cases in Native/Runtime, this meant renaming uses of GCHeap to GCHeapUtilities. There is a notable exception to this in that GetMaxGeneration is turned into a virtual method call on IGCHeap on non-DAC code paths (see https://github.com/dotnet/coreclr/pull/6764#issuecomment-245462736 for details on why I chose to expose a virtual and non-virtual version of GetMaxGeneration)
3) This set of changes broke SOS GC heap dumping on CoreCLR when FEATURE_SVR_GC is defined, so this change contains a fix for that particular issue. As far as I know, FEATURE_SVR_GC is not defined on the ProjectN build, so this has no effect for now, but it will fix an issue that would be present if/when we enable Server GC. This particular fix is located in request.cpp.
There should be no surprises in this changelist except for portable.cpp, which declares a complete alloc_context struct out-of-line from the GC interface - this change updates the declared alloc_context struct to match the one exposed by the interface.
[tfs-changeset: 1627236]
|
|
|
|
and the runtime.
Overview - here's what generic instance descs were used for and how this functionality is provided now:
- They were needed to support generic unification. For the release scenario, this is no longer necessary because global analysis places generics.
For the F5 scenario, we will again have generic unification, but it will be done differently and is not in this code review yet.
- They were used for GC reporting of statics on generic types. Statics on statically built generic types are now merged into the static GC desc
of their containing module. Statics on dynamic types are reported via two new lists on the RuntimeInstance class, one for regular GC statics,
the other one for thread statics.
- They were also used to hold statics information for dynamically loaded types. This information is now attached to the EEType instead.
- Similarly, generic instance descs held information about the open generic type, the instantiation parameter, and the parameter variance information.
This information is now also attached to the EEType.
Detail notes:
- EEType.Constants.cs, EEType.cs, eetype.h, eetype.inl: Provide for attaching generic and static information to eetypes. The latter is only used for dynamic types.
- MiscHelpers.cpp, module.cpp, module.h, RuntimeInstance.cpp/.h: Remove GenericInstanceDesc logic, provide equivalent functionality.
- rhbinder.h, ZapHeaders.cpp: Bump version number, remove GenericInstanceDesc related fields from module header.
- EETypeCreator.cs: logic to set rareFlags appropriately for attached statics.
- TypeLoaderEnvironment.StaticsLookup.cs: the logic turned out to be wrong for the TLS index - the binder encoded always zero for the index, which cannot work
at runtime. So I changed the binder (see comment below), and I also changed the runtime logic to apply an indirection. For consistency, I did the same
for the thread static offset - this isn't necessary now but may become necessary for the F5 scenario.
- common.h: Add separateCompilation flag to g_BindOptions as prep work for F5 scenario.
- CompactLayoutReader.cpp: for release scenario, merge generic statics and their GC descs early rather than relying on generic instance descs.
- MethodTable.h, MakePdb.cpp, MdilModule.cpp/.h: attach "InstantiatedTypeZapNodes" data structure to method table rather than finding it via
a hash table lookup. This is just a cleanup change.
- MdilModule.cpp/.h: Remove generic instance desc logic, add logic to generate the "GenericComposition" data structure instead, attach that and
the generic definition to eetypes, add a rare flag for eetypes with sealed virtuals, add indirection cells where we used to indirect through generic
instance descs, remove unused "GetReadonlyBlobNode" method, change encoding of native layout info for thread statics (see comments above
for TypeLoaderEnvironment.StaticsLookup.cs).
- ZapImage.cpp/.h: remove generic instance desc sections.
- various copies of rhbind.exe and rhbindui.dll: these are used to build mrt100_app.dll. The change updates rhbind.exe to put the new version number
into the module header of mrt100_app.dll.
[tfs-changeset: 1622930]
|
|
|
|
[tfs-changeset: 1622102]
|
|
Thunk
This broke debugger stepping through interface dispatch in some circumstances
[tfs-changeset: 1618045]
|
|
Move to using the Universal Thunk for cases where we need to perform complex lookup to perform interface dispatch. This allows us to permit exceptions to occur in interface processing without ripping the process down. As a side benefit, we are able to reduce the amount of platform specific assembly code needed to build the product. NOTE: CoreRT still uses the old managed callout logic, as I don't have time on my schedule to write a SYS V ABI version of the universal transition thunk.
[tfs-changeset: 1618006]
|
|
This change implements code manager for Linux, context manipulation
and compiler changes necessary to enable exception handling.
All calls to libunwind are disabled for now on non-OSX though, since
our build system doesn't support specifying additional dynamic
libraries, which prevents us from using the libunwind.
Those pieces of code are under CAN_LINK_SHARED_LIBUNWIND ifdef so
that the ifdef can easily be located and removed after we add
the necessary support to the build system.
On OSX, the unwind functionality is part of the compiler support
libraries, so it works.
I have verified that everything works with the libunwind though
by manually invoking clang to link everything together and adding
the necessary libraries to its command line. The exception handling
test was passing with that.
|
|
These helpers have to be implemented in assembly for non-portable runtime flavor to make stackcrawling work.
|
|
|
|
|
|
This change ports AMD64 ExceptionHandling.asm and ManagedCalloutThunk.asm to
Unix.
|
|
|
|
Fixing TODOs about collisions with the system assert.h header
[tfs-changeset: 1589045]
|
|
- Add CoffNativeCodeManager that is able to decode the Windows OS native unwind info
- Append EH info to the Windows OS unwind info blob in the compiler
|
|
Add a new command-line switch to ILC: /multifile. When specified, only
the assemblies passed as input will have methods compiled. Referenced
types / methods from other assemblies are not compiled into the output
object file. This switch is most likely temporary as we hone our
compilation story and implementation.
Each managed module adds pointers to the start and end of a module
global data header to a custom section of the object file, .modules$I.
These entries are merged (on Windows, OSX / Linux needs a tweak to CLI
first) at link time producing a list of module headers.
In StartupCodeHelpers.cs, initialize global tables from each module
using the list of pointers that was written to .modules$I. This data is
discovered through two exports (__modules_a and __modules_z) which
through linker section merging, are placed either side of the module
header pointers in the final binary.
Alter interface dispatch to store its dispatch map table as an
ArrayOfEmbeddedDataNode and place it in the module header list. This
allows each module's EETypes to continue using index-based lookup of
dispatch maps.
Add a new field to EETypes which points at a ModuleManager* through an
indirection cell. This indirection cell is filled in at runtime
initialization and allows a type to find its dispatch map table.
ModuleHeaderSection.cs|h files define the section headers currently
supported. ModuleHeaderSection's enumerands are in line with the plan for
ReadyToRun.
Moved the module info lookup out of the bootstrapping code and into the
runtime
Place compilation module group logic to a dedicated set of classes,
CompilationModuleGroup, MultiFileCompilationModuleGroup, and
SingleFileCompilationModuleGroup which together abstract the logic for
decisions about which types / methods should be included in compilation
in single vs multi file.
Extract an interface from Compilation for the methods that root methods
/ types / Main so CompilationModuleGroup can root things without having
to know about the Compilation class.
|
|
|
|
Added StubDispatch.S containing the unix assembly interface dispatch helper and cache generation.
Defined a Unix flavor of AsmOffsets.cpp since assembler symbols are defined differently in GAS vs MASM
Add compiler flag that allows lock-free exchange of 16 byte data (used for InterlockedExchange of interface dispatch cache entries) and filled in PalInterlockedCompareExchange128 for Unix
Worked around missing ManagedCallout2's assembly code on Unix by directly invoking the function pointer passed into it.
Fix bug in PalVirtualAlloc to allocate memory when MEM_COMMIT is specified without MEM_RESERVE on Unix
|
|
|
|
Conflicts:
src/Native/Runtime/unix/PalRedhawkUnix.cpp
src/Native/gc/gc.cpp
|
|
|
|
Emit the supporting data structures for interface dispatch:
- Interface dispatch cell for each call site providing the resolution function entry point as well as the interface type and interface method slot number
- Interface map on EETypes specifying the list of interfaces they implement
- Dispatch map that provides, for each type, the lookup rows for interface type, interface method slot, and implementing method's VTable slot
- Dispatch map table that provides dispatch map pointers (the index into this table is stored on an EEType instead of a pointer to the map for space savings)
Added a work-around in the runtime to provide access to the dispatch map table until full module headers are implemented
|
|
[tfs-changeset: 1562851]
|
|
- Add lookup of all RyuJIT intrinsics
- Update manage implementations of the intrinsics to fit with what RyuJIT is capable of
- Make intrinsic expansions by the codegen to be optional by providing fallback paths
- Fix USE_PORTABLE_HELPERS to be defined for portable runtime only
These changes are under CORERT ifdefs as necessary to be reconciled with .NET Native for UWP later.
|
|
Remove redundant code in gcrhscan.cpp
|
|
- Add gc\gcscan.cpp to the build and remove code that was redundant with it from runtime\gcrhscan.cpp
- Move the entire stack root scanning to the EE side of GCToEEInterface
|
|
Per issue #455, split the definitions in AsmOffsets from the 32/64
bit specific parts and the platform specific parts.
|
|
Update cmake configuration files to support ARM64.
Added skeleton of AsmMacros.h and WriteBarriers.S for ARM64.
|
|
This move facilitates header file sharing between projects that is
necessary in the UWP apps branch of this code (in TFS).
|
|
Fix issue /dotnet/corert/#444 to ensure that pre-computed offsets match the C/C++ structures layout.
|