提交 dca1970a 编写于 作者: N never

6868051: (SA) FreeChunk support for compressed oops is broken

Reviewed-by: kvn, dcubed
上级 3a963011
......@@ -176,19 +176,6 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
for (; cur.lessThan(limit);) {
Address klassOop = cur.getAddressAt(addressSize);
// FIXME: need to do a better job here.
// can I use bitMap here?
if (klassOop == null) {
//Find the object size using Printezis bits and skip over
System.err.println("Finding object size using Printezis bits and skipping over...");
long size = collector().blockSizeUsingPrintezisBits(cur);
if (size == -1) {
System.err.println("Printezis bits not set...");
break;
}
cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
}
if (FreeChunk.indicatesFreeChunk(cur)) {
if (! cur.equals(regionStart)) {
res.add(new MemRegion(regionStart, cur));
......@@ -200,12 +187,21 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
}
// note that fc.size() gives chunk size in heap words
cur = cur.addOffsetTo(chunkSize * addressSize);
System.err.println("Free chunk in CMS heap, size="+chunkSize * addressSize);
regionStart = cur;
} else if (klassOop != null) {
Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0));
long objectSize = obj.getObjectSize();
cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize));
} else {
// FIXME: need to do a better job here.
// can I use bitMap here?
//Find the object size using Printezis bits and skip over
long size = collector().blockSizeUsingPrintezisBits(cur);
if (size == -1) {
System.err.println("Printezis bits not set...");
break;
}
cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
}
}
return res;
......
......@@ -63,7 +63,7 @@ public class FreeChunk extends VMObject {
public long size() {
if (VM.getVM().isCompressedOopsEnabled()) {
Mark mark = new Mark(sizeField.getValue(addr));
Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
return mark.getSize();
} else {
Address size = sizeField.getValue(addr);
......@@ -83,7 +83,7 @@ public class FreeChunk extends VMObject {
public boolean isFree() {
if (VM.getVM().isCompressedOopsEnabled()) {
Mark mark = new Mark(sizeField.getValue(addr));
Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
return mark.isCmsFreeChunk();
} else {
Address prev = prevField.getValue(addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册