diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2016-04-29 10:29:28 -0700 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2016-04-29 14:52:46 -0700 |
commit | 45798f661f8c8c042f3582cde8b611d1c9c7343f (patch) | |
tree | 0d75dad9935f95c5bf4bd309899a37456e4478bd /src/jit/emit.cpp | |
parent | 601b1051c1022d5f764224e35be59f02a6074ad0 (diff) | |
download | coreclr-45798f661f8c8c042f3582cde8b611d1c9c7343f.tar.gz coreclr-45798f661f8c8c042f3582cde8b611d1c9c7343f.tar.bz2 coreclr-45798f661f8c8c042f3582cde8b611d1c9c7343f.zip |
ARM64: Enabling Crossgen End-to-End Mscorlib
Fixes https://github.com/dotnet/coreclr/issues/4350
Fixes https://github.com/dotnet/coreclr/issues/4615
This is a bit large change across VM/Zap/JIT to properly support crossgen
scenario.
1. Fix incorrect `ldr` encoding with size.
2. Enforce JIT data following JIT code per method by allocating them together.
This guarantees correct PC-relative encoding for such constant data access
without fix-up.
3. For the general fix-up data acceess, use `adrp/add` instruction pairs with fix-ups.
Two more relocations types are implemented in all sides.
4. Interface dispatch stub is now implemented which is needed for
interface call for crossgen.
I've verified hello world runs with mscorlib.ni.dll.
Diffstat (limited to 'src/jit/emit.cpp')
-rw-r--r-- | src/jit/emit.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp index b9787fa7d6..a4a20693a4 100644 --- a/src/jit/emit.cpp +++ b/src/jit/emit.cpp @@ -4497,12 +4497,32 @@ unsigned emitter::emitEndCodeGen(Compiler *comp, } #endif +#ifdef _TARGET_ARM64_ + // For arm64, we want to allocate JIT data always adjacent to code similar to what native compiler does. + // This way allows us to use a single `ldr` to access such data like float constant/jmp table. + if (emitTotalColdCodeSize > 0) + { + // JIT data might be far away from the cold code. + NYI_ARM64("Need to handle fix-up to data from cold code."); + } + + emitCmpHandle->allocMem(emitTotalHotCodeSize + emitConsDsc.dsdOffs, emitTotalColdCodeSize, + 0, + xcptnsCount, + allocMemFlag, + (void**)&codeBlock, (void**)&coldCodeBlock, + (void**)&consBlock); + + consBlock = codeBlock + emitTotalHotCodeSize; + +#else emitCmpHandle->allocMem( emitTotalHotCodeSize, emitTotalColdCodeSize, emitConsDsc.dsdOffs, xcptnsCount, allocMemFlag, (void**)&codeBlock, (void**)&coldCodeBlock, (void**)&consBlock); +#endif // if (emitConsDsc.dsdOffs) printf("Cons=%08X\n", consBlock); |