diff options
author | Jan Vorlicek <jan.vorlicek@volny.cz> | 2021-05-13 00:04:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 00:04:12 +0300 |
commit | 4ca5d81c625b4eb130b70151d69f39aa8aa1f153 (patch) | |
tree | 263482d402b0d8280cce78265665174221ac73b5 /src/coreclr/inc | |
parent | 8eb76928630d688f7aed97b05a535f0d8deed567 (diff) |
Modify JIT to support double mapped memory (#52600)
* Modify JIT to support double mapped memory
This change modifies JIT so that it can generate code into
double mapped memory. The code is written into RW mapped memory,
but the relative offsets are computed using the related RX locations.
The change doesn't modify the runtime to provide double mapped memory
yet, the JIT2EE interface allocMem returns the same addresses as RW and
RX. The runtime changes will be part of follow-up PRs. However, it was
already tested with the double mapping enabled locally.
It also changes signature of allocMem to pass everything in a single structure
Diffstat (limited to 'src/coreclr/inc')
-rw-r--r-- | src/coreclr/inc/corjit.h | 28 | ||||
-rw-r--r-- | src/coreclr/inc/icorjitinfoimpl_generated.h | 10 | ||||
-rw-r--r-- | src/coreclr/inc/jiteeversionguid.h | 11 |
3 files changed, 28 insertions, 21 deletions
diff --git a/src/coreclr/inc/corjit.h b/src/coreclr/inc/corjit.h index aaf4dcb646f..51fe431bbb8 100644 --- a/src/coreclr/inc/corjit.h +++ b/src/coreclr/inc/corjit.h @@ -142,6 +142,24 @@ enum CheckedWriteBarrierKinds { CWBKind_AddrOfLocal, // Store through the address of a local (arguably a bug that this happens at all). }; +struct AllocMemArgs +{ + // Input arguments + uint32_t hotCodeSize; + uint32_t coldCodeSize; + uint32_t roDataSize; + uint32_t xcptnsCount; + CorJitAllocMemFlag flag; + + // Output arguments + void* hotCodeBlock; + void* hotCodeBlockRW; + void* coldCodeBlock; + void* coldCodeBlockRW; + void* roDataBlock; + void* roDataBlockRW; +}; + #include "corjithost.h" extern "C" void jitStartup(ICorJitHost* host); @@ -212,14 +230,7 @@ class ICorJitInfo : public ICorDynamicInfo public: // get a block of memory for the code, readonly data, and read-write data virtual void allocMem ( - uint32_t hotCodeSize, /* IN */ - uint32_t coldCodeSize, /* IN */ - uint32_t roDataSize, /* IN */ - uint32_t xcptnsCount, /* IN */ - CorJitAllocMemFlag flag, /* IN */ - void ** hotCodeBlock, /* OUT */ - void ** coldCodeBlock, /* OUT */ - void ** roDataBlock /* OUT */ + AllocMemArgs *pArgs ) = 0; // Reserve memory for the method/funclet's unwind information. @@ -430,6 +441,7 @@ public: // A jump thunk may be inserted if we are jitting virtual void recordRelocation( void * location, /* IN */ + void * locationRW, /* IN */ void * target, /* IN */ uint16_t fRelocType, /* IN */ uint16_t slotNum = 0, /* IN */ diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index ae03ef525fe..ebd9813e2c4 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -635,14 +635,7 @@ bool notifyInstructionSetUsage( bool supportEnabled) override; void allocMem( - uint32_t hotCodeSize, - uint32_t coldCodeSize, - uint32_t roDataSize, - uint32_t xcptnsCount, - CorJitAllocMemFlag flag, - void** hotCodeBlock, - void** coldCodeBlock, - void** roDataBlock) override; + AllocMemArgs* pArgs) override; void reserveUnwindInfo( bool isFunclet, @@ -700,6 +693,7 @@ void recordCallSite( void recordRelocation( void* location, + void* locationRW, void* target, uint16_t fRelocType, uint16_t slotNum, diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index b32d0edef00..1ae07e2b634 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -43,13 +43,14 @@ typedef const GUID *LPCGUID; #define GUID_DEFINED #endif // !GUID_DEFINED -constexpr GUID JITEEVersionIdentifier = { /* 12234eca-dfc2-48bc-a320-6155cf25ce17 */ - 0x12234eca, - 0xdfc2, - 0x48bc, - {0xa3, 0x20, 0x61, 0x55, 0xcf, 0x25, 0xce, 0x17} +constexpr GUID JITEEVersionIdentifier = { /* 529be99f-ce88-426e-a099-7528a691226c */ + 0x529be99f, + 0xce88, + 0x426e, + { 0xa0, 0x99, 0x75, 0x28, 0xa6, 0x91, 0x22, 0x6c } }; + ////////////////////////////////////////////////////////////////////////////////////////////////////////// // // END JITEEVersionIdentifier |