Skip to content

Commit 45487df

Browse files
committed
svm: adopt "JDK-8356372: JVMTI heap sampling not working properly with outside TLAB allocations"
1 parent c2ffd2d commit 45487df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ThreadLocalAllocation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private static Pointer allocateRawMemory(UnsignedWord size, BooleanPointer alloc
371371
return allocateRawMemoryOutsideTlab(size, allocatedOutsideTlab);
372372
}
373373

374-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+8/src/hotspot/share/gc/shared/memAllocator.cpp#L256-L318")
374+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+25/src/hotspot/share/gc/shared/memAllocator.cpp#L257-L329")
375375
@Uninterruptible(reason = "Holds uninitialized memory.")
376376
private static Pointer allocateRawMemoryInTlabSlow(UnsignedWord size) {
377377
ThreadLocalAllocation.Descriptor tlab = getTlab();
@@ -416,7 +416,7 @@ private static Pointer allocateRawMemoryInTlabSlow(UnsignedWord size) {
416416
return memory;
417417
}
418418

419-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-23-ga/src/hotspot/share/gc/shared/memAllocator.cpp#L240-L251")
419+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+25/src/hotspot/share/gc/shared/memAllocator.cpp#L239-L251")
420420
@Uninterruptible(reason = "Holds uninitialized memory.")
421421
private static Pointer allocateRawMemoryOutsideTlab(UnsignedWord size, BooleanPointer allocatedOutsideTlab) {
422422
allocatedOutsideTlab.write(true);

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/TlabSupport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ static void fillTlab(Pointer start, Pointer top, WordPointer newSize) {
176176
refillWasteLimit.set(initialRefillWasteLimit());
177177
}
178178

179-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-23-ga/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp#L150-L153")
179+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+25/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp#L143-L145")
180180
@Uninterruptible(reason = "Accesses TLAB")
181181
static void retireTlabBeforeAllocation() {
182182
long availableTlabMemory = availableTlabMemory(getTlab()).rawValue();
183183
refillWaste.set(refillWaste.get() + UninterruptibleUtils.NumUtil.safeToInt(availableTlabMemory));
184184
retireCurrentTlab(CurrentIsolate.getCurrentThread(), false);
185185
}
186186

187-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-23-ga/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp#L137-L148")
187+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+25/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp#L131-L141")
188188
@Uninterruptible(reason = "Accesses TLAB")
189189
private static void retireCurrentTlab(IsolateThread thread, boolean calculateStats) {
190190
ThreadLocalAllocation.Descriptor tlab = getTlab(thread);

0 commit comments

Comments
 (0)