Skip to content

Commit

Permalink
Disable nop padding in R2R images and remove jumpstamps from the runt…
Browse files Browse the repository at this point in the history
…ime (dotnet/coreclr#26740)

Jumpstamps were used to version methods before we had the tiered compilation versioning mechanism. Jumpstamps had some negatives, that it was only supported on x86 and x64, that it required padding methods (bloated on disk IL code size), and that it required a runtime suspension to write the jumpstamps. By consolidating to one code versioning scheme we can delete a lot of code and support all architectures that tiered compilation does for rejit.

Commit migrated from dotnet/coreclr@7fd7985
  • Loading branch information
davmason authored Sep 30, 2019
1 parent c1b5005 commit 64cae8c
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 1,173 deletions.
3 changes: 0 additions & 3 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ if(FEATURE_INTERPRETER)
add_definitions(-DFEATURE_INTERPRETER)
endif(FEATURE_INTERPRETER)
add_definitions(-DFEATURE_ISYM_READER)
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DFEATURE_JUMPSTAMP)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
if (CLR_CMAKE_PLATFORM_LINUX OR WIN32)
add_definitions(-DFEATURE_MANAGED_ETW)
endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32)
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
///
/// AppDomain
///
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_AddRejitNops, W("AddRejitNops"), "Control for the profiler rejit feature infrastructure")
CONFIG_DWORD_INFO(INTERNAL_ADDumpSB, W("ADDumpSB"), 0, "Not used")
CONFIG_DWORD_INFO(INTERNAL_ADForceSB, W("ADForceSB"), 0, "Forces sync block creation for all objects")
CONFIG_DWORD_INFO(INTERNAL_ADLogMemory, W("ADLogMemory"), 0, "Superseded by test hooks")
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define READYTORUN_SIGNATURE 0x00525452 // 'RTR'

#define READYTORUN_MAJOR_VERSION 0x0003
#define READYTORUN_MAJOR_VERSION 0x0004
#define READYTORUN_MINOR_VERSION 0x0001
#define MINIMUM_READYTORUN_MAJOR_VERSION 0x003
// R2R Version 2.1 adds the READYTORUN_SECTION_INLINING_INFO section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal struct ReadyToRunHeaderConstants
{
public const uint Signature = 0x00525452; // 'RTR'

public const ushort CurrentMajorVersion = 3;
public const ushort CurrentMajorVersion = 4;
public const ushort CurrentMinorVersion = 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ public override ICompilation ToCompilation()
if (_ibcTuning)
corJitFlags.Add(CorJitFlag.CORJIT_FLAG_BBINSTR);

corJitFlags.Add(CorJitFlag.CORJIT_FLAG_PROF_REJIT_NOPS);

var jitConfig = new JitConfigProvider(corJitFlags, _ryujitOptions);

return new ReadyToRunCodegenCompilation(
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/vm/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"FEATURE_ICASTABLE",
"FEATURE_INTEROP_DEBUGGING",
"FEATURE_ISYM_READER",
"FEATURE_JUMPSTAMP",
"FEATURE_MANAGED_ETW",
"FEATURE_MANAGED_ETW_CHANNELS",
"FEATURE_MULTICASTSTUB_AS_IL",
Expand Down
8 changes: 1 addition & 7 deletions src/coreclr/src/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2565,13 +2565,7 @@ CodeHeader* EEJitManager::allocCode(MethodDesc* pMD, size_t blockSize, size_t re
#if defined(_TARGET_X86_)
// when not optimizing for code size, 8-byte align the method entry point, so that
// the JIT can in turn 8-byte align the loop entry headers.
//
// when ReJIT is enabled, 8-byte-align the method entry point so that we may use an
// 8-byte interlocked operation to atomically poke the top most bytes (e.g., to
// redirect the rejit jmp-stamp at the top of the method from the prestub to the
// rejitted code, or to reinstate original code on a revert).
else if ((g_pConfig->GenOptimizeType() != OPT_SIZE) ||
pMD->IsVersionableWithJumpStamp())
else if ((g_pConfig->GenOptimizeType() != OPT_SIZE))
{
alignment = max(alignment, 8);
}
Expand Down
Loading

0 comments on commit 64cae8c

Please sign in to comment.