Skip to content

Commit f01e191

Browse files
committed
Add ee_alloc_context (NativeAOT)
This change is some preparatory refactoring for the randomized allocation sampling feature. We need to add more state onto allocation context but we don't want to do a breaking change of the GC interface. The new state only needs to be visible to the EE but we want it physically near the existing alloc context state for good cache locality. To accomplish this we created a new ee_alloc_context struct which contains an instance of gc_alloc_context within it. In a future PR we will add a field called combined_limit which should be used by fast allocation helpers to determine when to go down the slow path. Most of the time combined_limit has the same value as alloc_limit, but periodically we need to emit an allocation sampling event on an object that is somewhere in the middle of an AC. Using combined_limit rather than alloc_limit as the slow path trigger allows us to keep all the sampling event logic in the slow path. This PR introduces the abstraction for combined_limit and changes all the fast allocation helpers to use it, but it does not physically create the field yet. For now combined_limit is just an alias back to alloc_limit. Overall this PR should not cause any change in runtime behavior and compiled code should be largely identical to before assuming modest inlining and optimization by the compiler.
1 parent 42b2b19 commit f01e191

18 files changed

+126
-52
lines changed

src/coreclr/nativeaot/Runtime/AsmOffsets.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ASM_OFFSET( 0, 0, MethodTable, m_uFlags)
4646
ASM_OFFSET( 4, 4, MethodTable, m_uBaseSize)
4747
ASM_OFFSET( 14, 18, MethodTable, m_VTable)
4848

49-
ASM_OFFSET( 0, 0, Thread, m_rgbAllocContextBuffer)
49+
ASM_OFFSET( 0, 0, Thread, m_eeAllocContext)
5050
ASM_OFFSET( 28, 38, Thread, m_ThreadStateFlags)
5151
ASM_OFFSET( 2c, 40, Thread, m_pTransitionFrame)
5252
ASM_OFFSET( 30, 48, Thread, m_pDeferredTransitionFrame)
@@ -61,6 +61,8 @@ ASM_SIZEOF( 14, 20, EHEnum)
6161
ASM_OFFSET( 0, 0, gc_alloc_context, alloc_ptr)
6262
ASM_OFFSET( 4, 8, gc_alloc_context, alloc_limit)
6363

64+
ASM_OFFSET( 0, 0, ee_alloc_context, m_rgbAllocContextBuffer)
65+
6466
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
6567
ASM_OFFSET( 4, 8, InterfaceDispatchCell, m_pCache)
6668
#ifdef INTERFACE_DISPATCH_CACHE_HAS_CELL_BACKPOINTER

src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class AsmOffsets
2424
{
25-
static_assert(sizeof(Thread::m_rgbAllocContextBuffer) >= sizeof(gc_alloc_context), "Thread::m_rgbAllocContextBuffer is not big enough to hold a gc_alloc_context");
25+
static_assert(sizeof(ee_alloc_context::m_rgbAllocContextBuffer) >= sizeof(gc_alloc_context), "ee_alloc_context::m_rgbAllocContextBuffer is not big enough to hold a gc_alloc_context");
2626

2727
// Some assembly helpers for arrays and strings are shared and use the fact that arrays and strings have similar layouts)
2828
static_assert(offsetof(Array, m_Length) == offsetof(String, m_Length), "The length field of String and Array have different offsets");

src/coreclr/nativeaot/Runtime/DebugHeader.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ extern "C" void PopulateDebugHeaders()
163163
MAKE_DEBUG_FIELD_ENTRY(dac_gc_heap, finalize_queue);
164164
MAKE_DEBUG_FIELD_ENTRY(dac_gc_heap, generation_table);
165165

166+
MAKE_SIZE_ENTRY(ee_alloc_context);
167+
MAKE_DEBUG_FIELD_ENTRY(ee_alloc_context, m_rgbAllocContextBuffer);
168+
166169
MAKE_SIZE_ENTRY(gc_alloc_context);
167170
MAKE_DEBUG_FIELD_ENTRY(gc_alloc_context, alloc_ptr);
168171
MAKE_DEBUG_FIELD_ENTRY(gc_alloc_context, alloc_limit);
@@ -194,7 +197,7 @@ extern "C" void PopulateDebugHeaders()
194197

195198
MAKE_SIZE_ENTRY(RuntimeThreadLocals);
196199
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_pNext);
197-
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_rgbAllocContextBuffer);
200+
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_eeAllocContext);
198201
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_threadId);
199202
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_pThreadStressLog);
200203
MAKE_DEBUG_FIELD_ENTRY(RuntimeThreadLocals, m_pExInfoStackHead);

src/coreclr/nativeaot/Runtime/amd64/AllocFast.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NESTED_ENTRY RhpNewFast, _TEXT, NoHandler
2828

2929
mov rsi, [rax + OFFSETOF__Thread__m_alloc_context__alloc_ptr]
3030
add rdx, rsi
31-
cmp rdx, [rax + OFFSETOF__Thread__m_alloc_context__alloc_limit]
31+
cmp rdx, [rax + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
3232
ja LOCAL_LABEL(RhpNewFast_RarePath)
3333

3434
// set the new alloc pointer
@@ -143,7 +143,7 @@ NESTED_ENTRY RhNewString, _TEXT, NoHandler
143143
// rcx == Thread*
144144
// rdx == string size
145145
// r12 == element count
146-
cmp rax, [rcx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
146+
cmp rax, [rcx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
147147
ja LOCAL_LABEL(RhNewString_RarePath)
148148

149149
mov [rcx + OFFSETOF__Thread__m_alloc_context__alloc_ptr], rax
@@ -226,7 +226,7 @@ NESTED_ENTRY RhpNewArray, _TEXT, NoHandler
226226
// rcx == Thread*
227227
// rdx == array size
228228
// r12 == element count
229-
cmp rax, [rcx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
229+
cmp rax, [rcx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
230230
ja LOCAL_LABEL(RhpNewArray_RarePath)
231231

232232
mov [rcx + OFFSETOF__Thread__m_alloc_context__alloc_ptr], rax

src/coreclr/nativeaot/Runtime/amd64/AllocFast.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LEAF_ENTRY RhpNewFast, _TEXT
2525

2626
mov rax, [rdx + OFFSETOF__Thread__m_alloc_context__alloc_ptr]
2727
add r8, rax
28-
cmp r8, [rdx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
28+
cmp r8, [rdx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
2929
ja RhpNewFast_RarePath
3030

3131
;; set the new alloc pointer
@@ -118,7 +118,7 @@ LEAF_ENTRY RhNewString, _TEXT
118118
; rdx == element count
119119
; r8 == array size
120120
; r10 == thread
121-
cmp rax, [r10 + OFFSETOF__Thread__m_alloc_context__alloc_limit]
121+
cmp rax, [r10 + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
122122
ja RhpNewArrayRare
123123

124124
mov [r10 + OFFSETOF__Thread__m_alloc_context__alloc_ptr], rax
@@ -179,7 +179,7 @@ LEAF_ENTRY RhpNewArray, _TEXT
179179
; rdx == element count
180180
; r8 == array size
181181
; r10 == thread
182-
cmp rax, [r10 + OFFSETOF__Thread__m_alloc_context__alloc_limit]
182+
cmp rax, [r10 + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
183183
ja RhpNewArrayRare
184184

185185
mov [r10 + OFFSETOF__Thread__m_alloc_context__alloc_ptr], rax

src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,11 @@ TSF_DoNotTriggerGc equ 10h
336336
;;
337337
;; Rename fields of nested structs
338338
;;
339-
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
340-
OFFSETOF__Thread__m_alloc_context__alloc_limit equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
339+
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
340+
;;
341+
;; Combined_limit doesn't exist yet. It is planned to come as part of the randomized allocation sampling feature. For now this aliases alloc_limit
342+
;;
343+
OFFSETOF__Thread__m_eeAllocContext__combined_limit equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
341344

342345

343346

src/coreclr/nativeaot/Runtime/arm/AllocFast.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ LEAF_ENTRY RhpNewFast, _TEXT
2626

2727
ldr r3, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_ptr]
2828
add r2, r3
29-
ldr r1, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
29+
ldr r1, [r0, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
3030
cmp r2, r1
3131
bhi LOCAL_LABEL(RhpNewFast_RarePath)
3232

@@ -132,7 +132,7 @@ LEAF_ENTRY RhNewString, _TEXT
132132
adds r6, r12
133133
bcs LOCAL_LABEL(RhNewString_RarePath) // if we get a carry here, the string is too large to fit below 4 GB
134134

135-
ldr r12, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
135+
ldr r12, [r0, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
136136
cmp r6, r12
137137
bhi LOCAL_LABEL(RhNewString_RarePath)
138138

@@ -213,7 +213,7 @@ LOCAL_LABEL(ArrayAlignSize):
213213
adds r6, r12
214214
bcs LOCAL_LABEL(RhpNewArray_RarePath) // if we get a carry here, the array is too large to fit below 4 GB
215215

216-
ldr r12, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
216+
ldr r12, [r0, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
217217
cmp r6, r12
218218
bhi LOCAL_LABEL(RhpNewArray_RarePath)
219219

@@ -349,7 +349,7 @@ LEAF_ENTRY RhpNewFastAlign8, _TEXT
349349
// Determine whether the end of the object would lie outside of the current allocation context. If so,
350350
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
351351
add r2, r3
352-
ldr r3, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
352+
ldr r3, [r0, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
353353
cmp r2, r3
354354
bhi LOCAL_LABEL(Alloc8Failed)
355355

@@ -412,7 +412,7 @@ LEAF_ENTRY RhpNewFastMisalign, _TEXT
412412
// Determine whether the end of the object would lie outside of the current allocation context. If so,
413413
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
414414
add r2, r3
415-
ldr r3, [r0, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
415+
ldr r3, [r0, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
416416
cmp r2, r3
417417
bhi LOCAL_LABEL(BoxAlloc8Failed)
418418

src/coreclr/nativeaot/Runtime/arm64/AllocFast.S

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ GC_ALLOC_FINALIZE = 1
1010
//
1111
// Rename fields of nested structs
1212
//
13-
OFFSETOF__Thread__m_alloc_context__alloc_ptr = OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
14-
OFFSETOF__Thread__m_alloc_context__alloc_limit = OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
13+
OFFSETOF__Thread__m_alloc_context__alloc_ptr = OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
14+
//
15+
// Combined_limit doesn't exist yet. It is planned to come as part of the randomized allocation sampling feature. For now this aliases alloc_limit
16+
//
17+
OFFSETOF__Thread__m_eeAllocContext__combined_limit = OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
1518

1619

1720

@@ -44,7 +47,7 @@ OFFSETOF__Thread__m_alloc_context__alloc_limit = OFFSETOF__Thread__m_rgbAll
4447
// Determine whether the end of the object would lie outside of the current allocation context. If so,
4548
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
4649
add x2, x2, x12
47-
ldr x13, [x1, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
50+
ldr x13, [x1, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
4851
cmp x2, x13
4952
bhi LOCAL_LABEL(RhpNewFast_RarePath)
5053

@@ -139,7 +142,7 @@ LOCAL_LABEL(NewOutOfMemory):
139142
// Determine whether the end of the object would lie outside of the current allocation context. If so,
140143
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
141144
add x2, x2, x12
142-
ldr x12, [x3, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
145+
ldr x12, [x3, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
143146
cmp x2, x12
144147
bhi LOCAL_LABEL(RhNewString_Rare)
145148

@@ -207,7 +210,7 @@ LOCAL_LABEL(RhNewString_Rare):
207210
// Determine whether the end of the object would lie outside of the current allocation context. If so,
208211
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
209212
add x2, x2, x12
210-
ldr x12, [x3, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
213+
ldr x12, [x3, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
211214
cmp x2, x12
212215
bhi LOCAL_LABEL(RhpNewArray_Rare)
213216

src/coreclr/nativeaot/Runtime/arm64/AllocFast.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
;; Determine whether the end of the object would lie outside of the current allocation context. If so,
3131
;; we abandon the attempt to allocate the object directly and fall back to the slow helper.
3232
add x2, x2, x12
33-
ldr x13, [x1, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
33+
ldr x13, [x1, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
3434
cmp x2, x13
3535
bhi RhpNewFast_RarePath
3636

@@ -118,7 +118,7 @@ NewOutOfMemory
118118
;; Determine whether the end of the object would lie outside of the current allocation context. If so,
119119
;; we abandon the attempt to allocate the object directly and fall back to the slow helper.
120120
add x2, x2, x12
121-
ldr x12, [x3, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
121+
ldr x12, [x3, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
122122
cmp x2, x12
123123
bhi RhpNewArrayRare
124124

@@ -179,7 +179,7 @@ StringSizeOverflow
179179
;; Determine whether the end of the object would lie outside of the current allocation context. If so,
180180
;; we abandon the attempt to allocate the object directly and fall back to the slow helper.
181181
add x2, x2, x12
182-
ldr x12, [x3, #OFFSETOF__Thread__m_alloc_context__alloc_limit]
182+
ldr x12, [x3, #OFFSETOF__Thread__m_eeAllocContext__combined_limit]
183183
cmp x2, x12
184184
bhi RhpNewArrayRare
185185

src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ STATUS_REDHAWK_THREAD_ABORT equ 0x43
8787
;;
8888
;; Rename fields of nested structs
8989
;;
90-
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
91-
OFFSETOF__Thread__m_alloc_context__alloc_limit equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
90+
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
91+
;;
92+
;; Combined_limit doesn't exist yet. It is planned to come as part of the randomized allocation sampling feature. For now this aliases alloc_limit
93+
;;
94+
OFFSETOF__Thread__m_eeAllocContext__combined_limit equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
9295

9396
;;
9497
;; IMPORTS

src/coreclr/nativeaot/Runtime/i386/AllocFast.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ FASTCALL_FUNC RhpNewFast, 4
2929
;;
3030

3131
add eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_ptr]
32-
cmp eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
32+
cmp eax, [edx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
3333
ja AllocFailed
3434

3535
;; set the new alloc pointer
@@ -165,7 +165,7 @@ FASTCALL_FUNC RhNewString, 8
165165
mov ecx, eax
166166
add eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_ptr]
167167
jc StringAllocContextOverflow
168-
cmp eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
168+
cmp eax, [edx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
169169
ja StringAllocContextOverflow
170170

171171
; ECX == allocation size
@@ -282,7 +282,7 @@ ArrayAlignSize:
282282
mov ecx, eax
283283
add eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_ptr]
284284
jc ArrayAllocContextOverflow
285-
cmp eax, [edx + OFFSETOF__Thread__m_alloc_context__alloc_limit]
285+
cmp eax, [edx + OFFSETOF__Thread__m_eeAllocContext__combined_limit]
286286
ja ArrayAllocContextOverflow
287287

288288
; ECX == array size

src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ STATUS_REDHAWK_THREAD_ABORT equ 43h
140140
;;
141141
;; Rename fields of nested structs
142142
;;
143-
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
144-
OFFSETOF__Thread__m_alloc_context__alloc_limit equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
143+
OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
144+
;;
145+
;; Combined_limit doesn't exist yet. It is planned to come as part of the randomized allocation sampling feature. For now this aliases alloc_limit
146+
;;
147+
OFFSETOF__Thread__m_eeAllocContext__combined_limit equ OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
145148

146149
;;
147150
;; CONSTANTS -- SYMBOLS

src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ GC_ALLOC_FINALIZE = 1
1010
//
1111
// Rename fields of nested structs
1212
//
13-
OFFSETOF__Thread__m_alloc_context__alloc_ptr = OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
14-
OFFSETOF__Thread__m_alloc_context__alloc_limit = OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
13+
OFFSETOF__Thread__m_alloc_context__alloc_ptr = OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_ptr
14+
//
15+
// Combined_limit doesn't exist yet. It is planned to come as part of the randomized allocation sampling feature. For now this aliases alloc_limit
16+
//
17+
OFFSETOF__Thread__m_eeAllocContext__combined_limit = OFFSETOF__Thread__m_eeAllocContext + OFFSETOF__ee_alloc_context__m_rgbAllocContextBuffer + OFFSETOF__gc_alloc_context__alloc_limit
1518

1619

1720

@@ -44,7 +47,7 @@ OFFSETOF__Thread__m_alloc_context__alloc_limit = OFFSETOF__Thread__m_rgbAll
4447
// Determine whether the end of the object would lie outside of the current allocation context. If so,
4548
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
4649
add.d $a2, $a2, $t3
47-
ld.d $t4, $a1, OFFSETOF__Thread__m_alloc_context__alloc_limit
50+
ld.d $t4, $a1, OFFSETOF__Thread__m_eeAllocContext__combined_limit
4851
bltu $t4, $a2, RhpNewFast_RarePath
4952

5053
// Update the alloc pointer to account for the allocation.
@@ -137,7 +140,7 @@ NewOutOfMemory:
137140
// Determine whether the end of the object would lie outside of the current allocation context. If so,
138141
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
139142
add.d $a2, $a2, $t3
140-
ld.d $t3, $a3, OFFSETOF__Thread__m_alloc_context__alloc_limit
143+
ld.d $t3, $a3, OFFSETOF__Thread__m_eeAllocContext__combined_limit
141144
bltu $t3, $a2, RhNewString_Rare
142145

143146
// Reload new object address into r12.
@@ -199,7 +202,7 @@ RhNewString_Rare:
199202
// Determine whether the end of the object would lie outside of the current allocation context. If so,
200203
// we abandon the attempt to allocate the object directly and fall back to the slow helper.
201204
add.d $a2, $a2, $t3
202-
ld.d $t3, $a3, OFFSETOF__Thread__m_alloc_context__alloc_limit
205+
ld.d $t3, $a3, OFFSETOF__Thread__m_eeAllocContext__combined_limit
203206
bltu $t3, $a2, RhpNewArray_Rare
204207

205208
// Reload new object address into t3.

0 commit comments

Comments
 (0)