Skip to content

Commit a2d130a

Browse files
Fix runtime build when tiered compilation is disabled (#119355)
* Fix build when tiered compilation is disabled * Fix build * Check for precode in JIT helper indirection * Update src/coreclr/inc/dacvars.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/inc/vptr_list.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/amd64/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/arm/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/arm64/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/eventtrace.cpp Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/i386/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/loongarch64/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Update src/coreclr/vm/riscv64/asmconstants.h Co-authored-by: Aaron Robinson <[email protected]> * Revert HasPrecode change * Condition FEATURE_ON_STACK_REPLACEMENT tiered compilation * Add comment --------- Co-authored-by: Aaron Robinson <[email protected]>
1 parent c0a9bac commit a2d130a

File tree

19 files changed

+59
-16
lines changed

19 files changed

+59
-16
lines changed

src/coreclr/clrfeatures.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
if (NOT CLR_CMAKE_TARGET_ARCH_WASM)
1+
if (NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_MACCATALYST)
22
set(FEATURE_TIERED_COMPILATION 1)
33
set(FEATURE_REJIT 1)
4-
endif()
5-
6-
if (NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_MACCATALYST)
74
set(FEATURE_JIT 1)
85
endif()
96

src/coreclr/debug/daccess/dacdbiimpl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ void DacDbiInterfaceImpl::GetSequencePoints(MethodDesc * pMethodDesc,
914914

915915
ULONG32 entryCount;
916916
BOOL success = DebugInfoManager::GetBoundariesAndVars(request,
917-
InfoStoreNew,
917+
InfoStoreNew,
918918
NULL, // allocator
919919
BoundsType::Uninstrumented,
920920
&entryCount, &mapCopy,
@@ -5515,7 +5515,7 @@ void DacDbiInterfaceImpl::GetContext(VMPTR_Thread vmThread, DT_CONTEXT * pContex
55155515
{
55165516
UpdateContextFromRegDisp(&tmpRd, &tmpContext);
55175517
CopyMemory(pContextBuffer, &tmpContext, sizeof(*pContextBuffer));
5518-
pContextBuffer->ContextFlags = DT_CONTEXT_CONTROL
5518+
pContextBuffer->ContextFlags = DT_CONTEXT_CONTROL
55195519
#if defined(TARGET_AMD64) || defined(TARGET_ARM)
55205520
| DT_CONTEXT_INTEGER // DT_CONTEXT_INTEGER is needed to include the frame register on ARM32 and AMD64 architectures
55215521
// DT_CONTEXT_CONTROL already includes the frame register for X86 and ARM64 architectures
@@ -7196,7 +7196,7 @@ HRESULT DacDbiInterfaceImpl::AreOptimizationsDisabled(VMPTR_Module vmModule, mdM
71967196
*pOptimizationsDisabled = activeILVersion.IsDeoptimized();
71977197
}
71987198
#else
7199-
pOptimizationsDisabled->SetDacTargetPtr(0);
7199+
*pOptimizationsDisabled = FALSE;
72007200
#endif
72017201

72027202
return S_OK;
@@ -7339,7 +7339,7 @@ HRESULT DacDbiInterfaceImpl::GetDomainAssemblyFromModule(VMPTR_Module vmModule,
73397339
pVmDomainAssembly->SetHostPtr(pModule->GetDomainAssembly());
73407340

73417341
return S_OK;
7342-
}
7342+
}
73437343

73447344
DacRefWalker::DacRefWalker(ClrDataAccess *dac, BOOL walkStacks, BOOL walkFQ, UINT32 handleMask, BOOL resolvePointers)
73457345
: mDac(dac), mWalkStacks(walkStacks), mWalkFQ(walkFQ), mHandleMask(handleMask), mStackWalker(NULL),

src/coreclr/inc/dacvars.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ DEFINE_DACVAR(PTR_StubLinkStubManager, StubLinkStubManager__g_pManager, StubLink
9898
DEFINE_DACVAR(PTR_JumpStubStubManager, JumpStubStubManager__g_pManager, JumpStubStubManager::g_pManager)
9999
DEFINE_DACVAR(PTR_RangeSectionStubManager, RangeSectionStubManager__g_pManager, RangeSectionStubManager::g_pManager)
100100
DEFINE_DACVAR(PTR_VirtualCallStubManagerManager, VirtualCallStubManagerManager__g_pManager, VirtualCallStubManagerManager::g_pManager)
101+
#ifdef FEATURE_TIERED_COMPILATION
101102
DEFINE_DACVAR(PTR_CallCountingStubManager, CallCountingStubManager__g_pManager, CallCountingStubManager::g_pManager)
103+
#endif // FEATURE_TIERED_COMPILATION
102104

103105
DEFINE_DACVAR(PTR_ThreadStore, ThreadStore__s_pThreadStore, ThreadStore::s_pThreadStore)
104106

src/coreclr/inc/switches.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848

4949
#elif defined(TARGET_64BIT)
5050

51-
#define FEATURE_ON_STACK_REPLACEMENT
51+
#ifdef FEATURE_TIERED_COMPILATION
52+
// FEATURE_ON_STACK_REPLACEMENT is only needed for tiered compilation.
53+
#define FEATURE_ON_STACK_REPLACEMENT
54+
#endif // FEATURE_TIERED_COMPILATION
5255

5356
#if defined(HOST_UNIX)
5457
// In PAL we have a mechanism that reserves memory on start up that is

src/coreclr/inc/vptr_list.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ VPTR_CLASS(InteropDispatchStubManager)
3737
#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)
3838
VPTR_CLASS(TailCallStubManager)
3939
#endif
40+
#ifdef FEATURE_TIERED_COMPILATION
4041
VPTR_CLASS(CallCountingStubManager)
42+
#endif // FEATURE_TIERED_COMPILATION
4143

4244
VPTR_CLASS(PEImageLayout)
4345
VPTR_CLASS(ConvertedImageLayout)

src/coreclr/vm/amd64/asmconstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ ASMCONSTANTS_C_ASSERT(StubPrecodeData__Target == offsetof(StubPrecode
538538
#define StubPrecodeData__SecretParam 0x00
539539
ASMCONSTANTS_C_ASSERT(StubPrecodeData__SecretParam == offsetof(StubPrecodeData, SecretParam))
540540

541+
#ifdef FEATURE_TIERED_COMPILATION
541542
#define CallCountingStubData__RemainingCallCountCell 0x00
542543
ASMCONSTANTS_C_ASSERT(CallCountingStubData__RemainingCallCountCell == offsetof(CallCountingStubData, RemainingCallCountCell))
543544

@@ -546,6 +547,7 @@ ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForMethod == offsetof(CallCoun
546547

547548
#define CallCountingStubData__TargetForThresholdReached 0x10
548549
ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForThresholdReached == offsetof(CallCountingStubData, TargetForThresholdReached))
550+
#endif // FEATURE_TIERED_COMPILATION
549551

550552
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
551553
#define OFFSETOF__InterfaceDispatchCache__m_rgEntries 0x20

src/coreclr/vm/amd64/thunktemplates.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ LEAF_END_MARKED StubPrecodeCodeTemplate, _TEXT
5757
// FixupPrecode
5858
// ----------
5959

60-
#define FIXUP_PRECODE_CODESIZE 0x18
60+
#define FIXUP_PRECODE_CODESIZE 0x18
6161
#define FIXUP_PRECODE_DATASIZE 0x18 // 3 qwords
6262
.set FIXUP_PRECODE_NUM_THUNKS_PER_MAPPING,(THUNKS_MAP_SIZE / FIXUP_PRECODE_CODESIZE)
6363

@@ -101,6 +101,7 @@ LEAF_ENTRY FixupPrecodeCodeTemplate
101101
int 3
102102
LEAF_END_MARKED FixupPrecodeCodeTemplate, _TEXT
103103

104+
#ifdef FEATURE_TIERED_COMPILATION
104105
// ----------
105106
// CallCountingStub
106107
// ----------
@@ -144,6 +145,7 @@ LEAF_ENTRY CallCountingStubCodeTemplate
144145
int 3
145146
int 3
146147
LEAF_END_MARKED CallCountingStubCodeTemplate, _TEXT
148+
#endif // FEATURE_TIERED_COMPILATION
147149

148150
#endif
149151

@@ -168,6 +170,7 @@ PATCH_LABEL FixupPrecodeCode_Fixup
168170
jmp [rip + DATA_SLOT(FixupPrecode, PrecodeFixupThunk)]
169171
LEAF_END_MARKED FixupPrecodeCode, _TEXT
170172

173+
#ifdef FEATURE_TIERED_COMPILATION
171174
LEAF_ENTRY CallCountingStubCode, _TEXT
172175
mov rax,QWORD PTR [rip + DATA_SLOT(CallCountingStub, RemainingCallCountCell)]
173176
dec WORD PTR [rax]
@@ -176,3 +179,4 @@ LEAF_ENTRY CallCountingStubCode, _TEXT
176179
LOCAL_LABEL(CountReachedZero):
177180
jmp QWORD PTR [rip + DATA_SLOT(CallCountingStub, TargetForThresholdReached)]
178181
LEAF_END_MARKED CallCountingStubCode, _TEXT
182+
#endif // FEATURE_TIERED_COMPILATION

src/coreclr/vm/arm/asmconstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ ASMCONSTANTS_C_ASSERT(StubPrecodeData__SecretParam == offsetof(StubPrecodeData,
187187
#define StubPrecodeData__Target 0x04
188188
ASMCONSTANTS_C_ASSERT(StubPrecodeData__Target == offsetof(StubPrecodeData, Target))
189189

190+
#ifdef FEATURE_TIERED_COMPILATION
190191
#define CallCountingStubData__RemainingCallCountCell 0x00
191192
ASMCONSTANTS_C_ASSERT(CallCountingStubData__RemainingCallCountCell == offsetof(CallCountingStubData, RemainingCallCountCell))
192193

@@ -195,6 +196,7 @@ ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForMethod == offsetof(CallCoun
195196

196197
#define CallCountingStubData__TargetForThresholdReached 0x08
197198
ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForThresholdReached == offsetof(CallCountingStubData, TargetForThresholdReached))
199+
#endif // FEATURE_TIERED_COMPILATION
198200

199201
#ifdef PROFILING_SUPPORTED
200202
#define PROFILE_ENTER 0x1

src/coreclr/vm/arm64/asmconstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ ASMCONSTANTS_C_ASSERT(StubPrecodeData__Target == offsetof(StubPrecode
274274
#define StubPrecodeData__SecretParam 0x00
275275
ASMCONSTANTS_C_ASSERT(StubPrecodeData__SecretParam == offsetof(StubPrecodeData, SecretParam))
276276

277+
#ifdef FEATURE_TIERED_COMPILATION
277278
#define CallCountingStubData__RemainingCallCountCell 0x00
278279
ASMCONSTANTS_C_ASSERT(CallCountingStubData__RemainingCallCountCell == offsetof(CallCountingStubData, RemainingCallCountCell))
279280

@@ -282,6 +283,7 @@ ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForMethod == offsetof(CallCoun
282283

283284
#define CallCountingStubData__TargetForThresholdReached 0x10
284285
ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForThresholdReached == offsetof(CallCountingStubData, TargetForThresholdReached))
286+
#endif // FEATURE_TIERED_COMPILATION
285287

286288
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
287289
#define OFFSETOF__InterfaceDispatchCache__m_rgEntries 0x20

src/coreclr/vm/arm64/asmhelpers.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ NESTED_ENTRY OnCallCountThresholdReachedStub, _TEXT, NoHandler
579579
EPILOG_BRANCH_REG x9
580580
NESTED_END OnCallCountThresholdReachedStub, _TEXT
581581

582+
#endif // FEATURE_TIERED_COMPILATION
583+
584+
#ifdef FEATURE_ON_STACK_REPLACEMENT
585+
582586
NESTED_ENTRY JIT_Patchpoint, _TEXT, NoHandler
583587
PROLOG_WITH_TRANSITION_BLOCK
584588

@@ -595,7 +599,7 @@ LEAF_ENTRY JIT_PatchpointForced, _TEXT
595599
b C_FUNC(JIT_Patchpoint)
596600
LEAF_END JIT_PatchpointForced, _TEXT
597601

598-
#endif // FEATURE_TIERED_COMPILATION
602+
#endif // FEATURE_ON_STACK_REPLACEMENT
599603

600604
LEAF_ENTRY JIT_ValidateIndirectCall, _TEXT
601605
ret lr

0 commit comments

Comments
 (0)