Skip to content

Commit 31d4d6a

Browse files
christianhaeublbulasevich
authored andcommitted
Don't assume that partitions with offset 0 are fillers.
(cherry picked from commit a9bbe92ec669adb1620152922209108637fd0bf5)
1 parent adf733c commit 31d4d6a

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,9 @@ public String getName() {
288288
public long getSize() {
289289
throw VMError.shouldNotReachHereAtRuntime(); // ExcludeFromJacocoGeneratedReport
290290
}
291+
292+
@Override
293+
public boolean isFiller() {
294+
return true;
295+
}
291296
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ public long getSize() {
186186
return getEndOffset() - getStartOffset();
187187
}
188188

189+
@Override
190+
public boolean isFiller() {
191+
return false;
192+
}
193+
189194
private static class SizeComparator implements Comparator<ImageHeapObject> {
190195
@Override
191196
public int compare(ImageHeapObject o1, ImageHeapObject o2) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,9 @@ public long getEndOffset() {
8484
public long getSize() {
8585
return getEndOffset() - getStartOffset();
8686
}
87+
88+
@Override
89+
public boolean isFiller() {
90+
return false;
91+
}
8792
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/image/ImageHeapPartition.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ public interface ImageHeapPartition {
3939
* Returns the size of the partition (i.e., the sum of all allocated objects + some overhead).
4040
*/
4141
long getSize();
42+
43+
/* Returns true if this partition is only used as a filler. */
44+
boolean isFiller();
4245
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ public long getSize() {
27002700

27012701
private boolean acceptObjectInfo(ObjectInfo objectInfo) {
27022702
/* This condition rejects filler partition objects. */
2703-
return (objectInfo.getPartition().getStartOffset() > 0);
2703+
return !objectInfo.getPartition().isFiller();
27042704
}
27052705

27062706
private DebugDataInfo createDebugDataInfo(ObjectInfo objectInfo) {

0 commit comments

Comments
 (0)