提交 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 { ...@@ -176,19 +176,6 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
for (; cur.lessThan(limit);) { for (; cur.lessThan(limit);) {
Address klassOop = cur.getAddressAt(addressSize); 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 (FreeChunk.indicatesFreeChunk(cur)) {
if (! cur.equals(regionStart)) { if (! cur.equals(regionStart)) {
res.add(new MemRegion(regionStart, cur)); res.add(new MemRegion(regionStart, cur));
...@@ -200,12 +187,21 @@ public class CompactibleFreeListSpace extends CompactibleSpace { ...@@ -200,12 +187,21 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
} }
// note that fc.size() gives chunk size in heap words // note that fc.size() gives chunk size in heap words
cur = cur.addOffsetTo(chunkSize * addressSize); cur = cur.addOffsetTo(chunkSize * addressSize);
System.err.println("Free chunk in CMS heap, size="+chunkSize * addressSize);
regionStart = cur; regionStart = cur;
} else if (klassOop != null) { } else if (klassOop != null) {
Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0)); Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0));
long objectSize = obj.getObjectSize(); long objectSize = obj.getObjectSize();
cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize)); 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; return res;
......
...@@ -63,7 +63,7 @@ public class FreeChunk extends VMObject { ...@@ -63,7 +63,7 @@ public class FreeChunk extends VMObject {
public long size() { public long size() {
if (VM.getVM().isCompressedOopsEnabled()) { if (VM.getVM().isCompressedOopsEnabled()) {
Mark mark = new Mark(sizeField.getValue(addr)); Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
return mark.getSize(); return mark.getSize();
} else { } else {
Address size = sizeField.getValue(addr); Address size = sizeField.getValue(addr);
...@@ -83,7 +83,7 @@ public class FreeChunk extends VMObject { ...@@ -83,7 +83,7 @@ public class FreeChunk extends VMObject {
public boolean isFree() { public boolean isFree() {
if (VM.getVM().isCompressedOopsEnabled()) { if (VM.getVM().isCompressedOopsEnabled()) {
Mark mark = new Mark(sizeField.getValue(addr)); Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
return mark.isCmsFreeChunk(); return mark.isCmsFreeChunk();
} else { } else {
Address prev = prevField.getValue(addr); Address prev = prevField.getValue(addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册