Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions docs/design/coreclr/botr/readytorun-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -982,20 +982,6 @@ enum ReadyToRunHelper
// Deprecated/legacy
//

// JIT32 x86-specific write barriers
READYTORUN_HELPER_WriteBarrier_EAX = 0x100,
READYTORUN_HELPER_WriteBarrier_EBX = 0x101,
READYTORUN_HELPER_WriteBarrier_ECX = 0x102,
READYTORUN_HELPER_WriteBarrier_ESI = 0x103,
READYTORUN_HELPER_WriteBarrier_EDI = 0x104,
READYTORUN_HELPER_WriteBarrier_EBP = 0x105,
READYTORUN_HELPER_CheckedWriteBarrier_EAX = 0x106,
READYTORUN_HELPER_CheckedWriteBarrier_EBX = 0x107,
READYTORUN_HELPER_CheckedWriteBarrier_ECX = 0x108,
READYTORUN_HELPER_CheckedWriteBarrier_ESI = 0x109,
READYTORUN_HELPER_CheckedWriteBarrier_EDI = 0x10A,
READYTORUN_HELPER_CheckedWriteBarrier_EBP = 0x10B,

// JIT32 x86-specific exception handling
READYTORUN_HELPER_EndCatch = 0x110,
};
Expand Down
19 changes: 0 additions & 19 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,25 +524,6 @@ enum CorInfoHelpFunc
CORINFO_HELP_EE_PERSONALITY_ROUTINE,// Not real JIT helper. Used in native images.
CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET,// Not real JIT helper. Used in native images to detect filter funclets.

// ASSIGN_REF_EAX - CHECKED_ASSIGN_REF_EBP: NOGC_WRITE_BARRIERS JIT helper calls
//
// For unchecked versions EDX is required to point into GC heap.
//
// NOTE: these helpers are only used for x86.
CORINFO_HELP_ASSIGN_REF_EAX, // EAX holds GC ptr, do a 'mov [EDX], EAX' and inform GC
CORINFO_HELP_ASSIGN_REF_EBX, // EBX holds GC ptr, do a 'mov [EDX], EBX' and inform GC
CORINFO_HELP_ASSIGN_REF_ECX, // ECX holds GC ptr, do a 'mov [EDX], ECX' and inform GC
CORINFO_HELP_ASSIGN_REF_ESI, // ESI holds GC ptr, do a 'mov [EDX], ESI' and inform GC
CORINFO_HELP_ASSIGN_REF_EDI, // EDI holds GC ptr, do a 'mov [EDX], EDI' and inform GC
CORINFO_HELP_ASSIGN_REF_EBP, // EBP holds GC ptr, do a 'mov [EDX], EBP' and inform GC

CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, // These are the same as ASSIGN_REF above ...
CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, // ... but also check if EDX points into heap.
CORINFO_HELP_CHECKED_ASSIGN_REF_ECX,
CORINFO_HELP_CHECKED_ASSIGN_REF_ESI,
CORINFO_HELP_CHECKED_ASSIGN_REF_EDI,
CORINFO_HELP_CHECKED_ASSIGN_REF_EBP,

CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, // Return the reference to a counter to decide to take cloned path in debug stress.
CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, // Print a message that a loop cloning optimization has occurred in debug mode.

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#include <minipal/guid.h>

constexpr GUID JITEEVersionIdentifier = { /* 31a04b06-915e-42a0-bbd2-c9c397677ae5 */
0x31a04b06,
0x915e,
0x42a0,
{0xbb, 0xd2, 0xc9, 0xc3, 0x97, 0x67, 0x7a, 0xe5}
constexpr GUID JITEEVersionIdentifier = { /* 5fc51288-a3f3-4291-be1d-c626ccdd3235 */
0x5fc51288,
0xa3f3,
0x4291,
{0xbe, 0x1d, 0xc6, 0x26, 0xcc, 0xdd, 0x32, 0x35}
};

#endif // JIT_EE_VERSIONING_GUID_H
30 changes: 0 additions & 30 deletions src/coreclr/inc/jithelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,36 +262,6 @@
DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, ProcessCLRException, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, ProcessCLRException,METHOD__NIL)

#ifdef TARGET_X86
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, RhpAssignRefEAX, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, RhpAssignRefEBX, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, RhpAssignRefECX, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, RhpAssignRefESI, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, RhpAssignRefEDI, METHOD__NIL)
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, RhpAssignRefEBP, METHOD__NIL)

JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, RhpCheckedAssignRefEAX, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, RhpCheckedAssignRefEBX, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, RhpCheckedAssignRefECX, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, RhpCheckedAssignRefESI, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, RhpCheckedAssignRefEDI, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, RhpCheckedAssignRefEBP, METHOD__NIL)
#else
JITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, NULL, METHOD__NIL)

JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, NULL, METHOD__NIL)
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, NULL, METHOD__NIL)
#endif

JITHELPER(CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, JIT_LoopCloneChoiceAddr, METHOD__NIL)
JITHELPER(CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, JIT_DebugLogLoopCloning, METHOD__NIL)

Expand Down
19 changes: 3 additions & 16 deletions src/coreclr/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
// src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h
// If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION`
// and handle pending work.
#define READYTORUN_MAJOR_VERSION 19
#define READYTORUN_MAJOR_VERSION 20
#define READYTORUN_MINOR_VERSION 0x0000

#define MINIMUM_READYTORUN_MAJOR_VERSION 19
#define MINIMUM_READYTORUN_MAJOR_VERSION 20

// R2R Version 2.1 adds the InliningInfo section
// R2R Version 2.2 adds the ProfileDataInfo section
Expand Down Expand Up @@ -59,6 +59,7 @@
// R2R Version 18.6 adds READYTORUN_FIXUP_InjectStringThunks for mapping strings to pregenerated code thunks
// R2R Version 18.7 adds READYTORUN_HELPER_R2RToInterpreter
// R2R Version 19 removes the READYTORUN_HELPER_ByRefWriteBarrier helper
// R2R Version 20 removes the per-source-register x86 write barrier helpers (READYTORUN_HELPER_(Checked)WriteBarrier_E[reg])

struct READYTORUN_CORE_HEADER
{
Expand Down Expand Up @@ -467,20 +468,6 @@ enum ReadyToRunHelper
// Deprecated/legacy
//

// JIT32 x86-specific write barriers
READYTORUN_HELPER_WriteBarrier_EAX = 0x100,
READYTORUN_HELPER_WriteBarrier_EBX = 0x101,
READYTORUN_HELPER_WriteBarrier_ECX = 0x102,
READYTORUN_HELPER_WriteBarrier_ESI = 0x103,
READYTORUN_HELPER_WriteBarrier_EDI = 0x104,
READYTORUN_HELPER_WriteBarrier_EBP = 0x105,
READYTORUN_HELPER_CheckedWriteBarrier_EAX = 0x106,
READYTORUN_HELPER_CheckedWriteBarrier_EBX = 0x107,
READYTORUN_HELPER_CheckedWriteBarrier_ECX = 0x108,
READYTORUN_HELPER_CheckedWriteBarrier_ESI = 0x109,
READYTORUN_HELPER_CheckedWriteBarrier_EDI = 0x10A,
READYTORUN_HELPER_CheckedWriteBarrier_EBP = 0x10B,

// JIT32 x86-specific exception handling
READYTORUN_HELPER_EndCatch = 0x110, // Unused since READYTORUN_MAJOR_VERSION 14.0

Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/inc/readytorunhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,6 @@ HELPER(READYTORUN_HELPER_PersonalityRoutine, CORINFO_HELP_EE_PERSONALITY_
HELPER(READYTORUN_HELPER_PersonalityRoutineFilterFunclet, CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, OPTIMIZEFORSIZE)
#endif

#ifdef TARGET_X86
HELPER(READYTORUN_HELPER_WriteBarrier_EAX, CORINFO_HELP_ASSIGN_REF_EAX, )
HELPER(READYTORUN_HELPER_WriteBarrier_EBX, CORINFO_HELP_ASSIGN_REF_EBX, )
HELPER(READYTORUN_HELPER_WriteBarrier_ECX, CORINFO_HELP_ASSIGN_REF_ECX, )
HELPER(READYTORUN_HELPER_WriteBarrier_ESI, CORINFO_HELP_ASSIGN_REF_ESI, )
HELPER(READYTORUN_HELPER_WriteBarrier_EDI, CORINFO_HELP_ASSIGN_REF_EDI, )
HELPER(READYTORUN_HELPER_WriteBarrier_EBP, CORINFO_HELP_ASSIGN_REF_EBP, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_EAX, CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_EBX, CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_ECX, CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_ESI, CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_EDI, CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, )
HELPER(READYTORUN_HELPER_CheckedWriteBarrier_EBP, CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, )
#endif

HELPER(READYTORUN_HELPER_PInvokeBegin, CORINFO_HELP_JIT_PINVOKE_BEGIN, )
HELPER(READYTORUN_HELPER_PInvokeEnd, CORINFO_HELP_JIT_PINVOKE_END, )
HELPER(READYTORUN_HELPER_GCPoll, CORINFO_HELP_POLL_GC, )
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,6 @@ class CodeGen final : public CodeGenInterface
regNumber targetReg,
GenTreeIndir* indir,
bool* needsBarrier);
bool genEmitOptimizedGCWriteBarrier(GCInfo::WriteBarrierForm writeBarrierForm, GenTree* addr, GenTree* data);
GenTree* getCallTarget(const GenTreeCall* call, CORINFO_METHOD_HANDLE* methHnd);
regNumber getCallIndirectionCellReg(GenTreeCall* call);
void genCall(GenTreeCall* call);
Expand Down
69 changes: 0 additions & 69 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,23 +925,6 @@ regMaskTP Compiler::compHelperCallKillSet(CorInfoHelpFunc helper)
case CORINFO_HELP_PROF_FCN_TAILCALL:
return RBM_PROFILER_TAILCALL_TRASH;

#ifdef TARGET_X86
case CORINFO_HELP_ASSIGN_REF_EAX:
case CORINFO_HELP_ASSIGN_REF_ECX:
case CORINFO_HELP_ASSIGN_REF_EBX:
case CORINFO_HELP_ASSIGN_REF_EBP:
case CORINFO_HELP_ASSIGN_REF_ESI:
case CORINFO_HELP_ASSIGN_REF_EDI:

case CORINFO_HELP_CHECKED_ASSIGN_REF_EAX:
case CORINFO_HELP_CHECKED_ASSIGN_REF_ECX:
case CORINFO_HELP_CHECKED_ASSIGN_REF_EBX:
case CORINFO_HELP_CHECKED_ASSIGN_REF_EBP:
case CORINFO_HELP_CHECKED_ASSIGN_REF_ESI:
case CORINFO_HELP_CHECKED_ASSIGN_REF_EDI:
return RBM_EDX;
#endif

case CORINFO_HELP_STOP_FOR_GC:
return RBM_STOP_FOR_GC_TRASH;

Expand Down Expand Up @@ -2663,55 +2646,6 @@ void CodeGen::genReportEHClauses(EHClauseInfo* clauses)
}
}

#ifndef TARGET_WASM

//----------------------------------------------------------------------
// genUseOptimizedWriteBarriers: Determine if an optimized write barrier
// helper should be used.
//
// Arguments:
// wbf - The WriteBarrierForm of the write (GT_STOREIND) that is happening.
//
// Return Value:
// true if an optimized write barrier helper should be used, false otherwise.
// Note: only x86 implements register-specific source optimized write
// barriers currently.
//
bool CodeGenInterface::genUseOptimizedWriteBarriers(GCInfo::WriteBarrierForm wbf)
{
#if defined(TARGET_X86) && NOGC_WRITE_BARRIERS
return true;
#else
return false;
#endif
}

//----------------------------------------------------------------------
// genUseOptimizedWriteBarriers: Determine if an optimized write barrier
// helper should be used.
//
// This has the same functionality as the version of
// genUseOptimizedWriteBarriers that takes a WriteBarrierForm, but avoids
// determining what the required write barrier form is, if possible.
//
// Arguments:
// store - the GT_STOREIND node
//
// Return Value:
// true if an optimized write barrier helper should be used, false otherwise.
// Note: only x86 implements register-specific source optimized write
// barriers currently.
//
bool CodeGenInterface::genUseOptimizedWriteBarriers(GenTreeStoreInd* store)
{
#if defined(TARGET_X86) && NOGC_WRITE_BARRIERS
return true;
#else
return false;
#endif
}
#endif // !TARGET_WASM

//----------------------------------------------------------------------
// genWriteBarrierHelperForWriteBarrierForm: Given a write barrier form
// return the corresponding helper.
Expand All @@ -2722,9 +2656,6 @@ bool CodeGenInterface::genUseOptimizedWriteBarriers(GenTreeStoreInd* store)
// Return Value:
// Write barrier helper to use.
//
// Note: do not call this function to get an optimized write barrier helper (e.g.,
// for x86).
//
CorInfoHelpFunc CodeGenInterface::genWriteBarrierHelperForWriteBarrierForm(GCInfo::WriteBarrierForm wbf)
{
INDEBUG(genWriteBarrierUsed = true);
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/codegeninterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ class CodeGenInterface
TreeLifeUpdater<true>* treeLifeUpdater;

public:
bool genUseOptimizedWriteBarriers(GCInfo::WriteBarrierForm wbf);
bool genUseOptimizedWriteBarriers(GenTreeStoreInd* store);
CorInfoHelpFunc genWriteBarrierHelperForWriteBarrierForm(GCInfo::WriteBarrierForm wbf);

#ifdef DEBUG
Expand Down
98 changes: 0 additions & 98 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5325,11 +5325,6 @@ void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree)
// Consume both registers so that any copies of interfering registers are taken care of.
genConsumeOperands(tree);

if (genEmitOptimizedGCWriteBarrier(writeBarrierForm, addr, data))
{
return;
}

// At this point, we should not have any interference.
// That is, 'data' must not be in REG_WRITE_BARRIER_DST, as that is where 'addr' must go.
noway_assert(data->GetRegNum() != REG_WRITE_BARRIER_DST);
Expand Down Expand Up @@ -5668,99 +5663,6 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree)
gcInfo.gcMarkRegPtrVal(oldOp1Reg, type2);
}

//------------------------------------------------------------------------
// genEmitOptimizedGCWriteBarrier: Generate write barrier store using the optimized
// helper functions.
//
// Arguments:
// writeBarrierForm - the write barrier form to use
// addr - the address at which to do the store
// data - the data to store
//
// Return Value:
// true if an optimized write barrier form was used, false if not. If this
// function returns false, the caller must emit a "standard" write barrier.

bool CodeGen::genEmitOptimizedGCWriteBarrier(GCInfo::WriteBarrierForm writeBarrierForm, GenTree* addr, GenTree* data)
{
assert(writeBarrierForm != GCInfo::WBF_NoBarrier);

#if defined(TARGET_X86) && NOGC_WRITE_BARRIERS
if (!genUseOptimizedWriteBarriers(writeBarrierForm))
{
return false;
}

const static int regToHelper[2][8] = {
// If the target is known to be in managed memory
{
CORINFO_HELP_ASSIGN_REF_EAX, // EAX
CORINFO_HELP_ASSIGN_REF_ECX, // ECX
-1, // EDX (always the target address)
CORINFO_HELP_ASSIGN_REF_EBX, // EBX
-1, // ESP
CORINFO_HELP_ASSIGN_REF_EBP, // EBP
CORINFO_HELP_ASSIGN_REF_ESI, // ESI
CORINFO_HELP_ASSIGN_REF_EDI, // EDI
},

// Don't know if the target is in managed memory
{
CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, // EAX
CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, // ECX
-1, // EDX (always the target address)
CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, // EBX
-1, // ESP
CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, // EBP
CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, // ESI
CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, // EDI
},
};

noway_assert(regToHelper[0][REG_EAX] == CORINFO_HELP_ASSIGN_REF_EAX);
noway_assert(regToHelper[0][REG_ECX] == CORINFO_HELP_ASSIGN_REF_ECX);
noway_assert(regToHelper[0][REG_EBX] == CORINFO_HELP_ASSIGN_REF_EBX);
noway_assert(regToHelper[0][REG_ESP] == -1);
noway_assert(regToHelper[0][REG_EBP] == CORINFO_HELP_ASSIGN_REF_EBP);
noway_assert(regToHelper[0][REG_ESI] == CORINFO_HELP_ASSIGN_REF_ESI);
noway_assert(regToHelper[0][REG_EDI] == CORINFO_HELP_ASSIGN_REF_EDI);

noway_assert(regToHelper[1][REG_EAX] == CORINFO_HELP_CHECKED_ASSIGN_REF_EAX);
noway_assert(regToHelper[1][REG_ECX] == CORINFO_HELP_CHECKED_ASSIGN_REF_ECX);
noway_assert(regToHelper[1][REG_EBX] == CORINFO_HELP_CHECKED_ASSIGN_REF_EBX);
noway_assert(regToHelper[1][REG_ESP] == -1);
noway_assert(regToHelper[1][REG_EBP] == CORINFO_HELP_CHECKED_ASSIGN_REF_EBP);
noway_assert(regToHelper[1][REG_ESI] == CORINFO_HELP_CHECKED_ASSIGN_REF_ESI);
noway_assert(regToHelper[1][REG_EDI] == CORINFO_HELP_CHECKED_ASSIGN_REF_EDI);

regNumber reg = data->GetRegNum();
noway_assert((reg != REG_ESP) && (reg != REG_OPTIMIZED_WRITE_BARRIER_DST));

// Generate the following code:
// lea edx, addr
// call write_barrier_helper_reg

// addr goes in REG_OPTIMIZED_WRITE_BARRIER_DST
genCopyRegIfNeeded(addr, REG_OPTIMIZED_WRITE_BARRIER_DST);

unsigned tgtAnywhere = 0;
if (writeBarrierForm != GCInfo::WBF_BarrierUnchecked)
{
tgtAnywhere = 1;
}

// Here we might want to call a modified version of genGCWriteBarrier() to get the benefit
// of the FEATURE_COUNT_GC_WRITE_BARRIERS code. For now, just emit the helper call directly.
genEmitHelperCall(regToHelper[tgtAnywhere][reg],
0, // argSize
EA_PTRSIZE); // retSize

return true;
#else // !defined(TARGET_X86) || !NOGC_WRITE_BARRIERS
return false;
#endif // !defined(TARGET_X86) || !NOGC_WRITE_BARRIERS
}

// Produce code for a GT_CALL node
void CodeGen::genCall(GenTreeCall* call)
{
Expand Down
Loading
Loading