提交 fc895a4c 编写于 作者: S sjohanss

8029329: tmtools tests fail with NPE (in the tool) when run with G1 and FlightRecorder

Summary: Now iterating over all committed (used) G1 regions instead of all reserved.
Reviewed-by: brutisso, dsamersoff, mgerdin
上级 d02acec9
......@@ -103,14 +103,14 @@ public class G1HeapRegionTable extends VMObject {
@Override
public void remove() { /* not supported */ }
HeapRegionIterator(Address addr) {
HeapRegionIterator(long committedLength) {
index = 0;
length = length();
length = committedLength;
}
}
public Iterator<HeapRegion> heapRegionIterator() {
return new HeapRegionIterator(addr);
public Iterator<HeapRegion> heapRegionIterator(long committedLength) {
return new HeapRegionIterator(committedLength);
}
public G1HeapRegionTable(Address addr) {
......
......@@ -42,6 +42,8 @@ import sun.jvm.hotspot.types.TypeDataBase;
public class HeapRegionSeq extends VMObject {
// G1HeapRegionTable _regions
static private long regionsFieldOffset;
// uint _committed_length
static private CIntegerField committedLengthField;
static {
VM.registerVMInitializedObserver(new Observer() {
......@@ -55,6 +57,7 @@ public class HeapRegionSeq extends VMObject {
Type type = db.lookupType("HeapRegionSeq");
regionsFieldOffset = type.getField("_regions").getOffset();
committedLengthField = type.getCIntegerField("_committed_length");
}
private G1HeapRegionTable regions() {
......@@ -67,8 +70,12 @@ public class HeapRegionSeq extends VMObject {
return regions().length();
}
public long committedLength() {
return committedLengthField.getValue(addr);
}
public Iterator<HeapRegion> heapRegionIterator() {
return regions().heapRegionIterator();
return regions().heapRegionIterator(committedLength());
}
public HeapRegionSeq(Address addr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册