Mercurial > hg > graal-jvmci-8
diff agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 6848:8e47bac5643a
7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Tue, 09 Oct 2012 10:11:38 +0200 |
parents | 5a98bf7d847b |
children | ec0c4951286c |
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Mon Oct 08 17:04:00 2012 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Tue Oct 09 10:11:38 2012 +0200 @@ -103,6 +103,7 @@ private int logMinObjAlignmentInBytes; private int heapWordSize; private int heapOopSize; + private int klassPtrSize; private int oopSize; /** This is only present in a non-core build */ private CodeCache codeCache; @@ -129,7 +130,7 @@ private static CIntegerType boolType; private Boolean sharingEnabled; private Boolean compressedOopsEnabled; - private Boolean compressedHeadersEnabled; + private Boolean compressedKlassPointersEnabled; // command line flags supplied to VM - see struct Flag in globals.hpp public static final class Flag { @@ -350,6 +351,12 @@ } else { heapOopSize = (int)getOopSize(); } + + if (isCompressedKlassPointersEnabled()) { + klassPtrSize = (int)getIntSize(); + } else { + klassPtrSize = (int)getOopSize(); // same as an oop + } } /** This could be used by a reflective runtime system */ @@ -374,8 +381,9 @@ ((Observer) iter.next()).update(null, null); } - debugger.putHeapConst(soleInstance.getHeapOopSize(), Universe.getNarrowOopBase(), - Universe.getNarrowOopShift()); + debugger.putHeapConst(soleInstance.getHeapOopSize(), soleInstance.getKlassPtrSize(), + Universe.getNarrowOopBase(), Universe.getNarrowOopShift(), + Universe.getNarrowKlassBase(), Universe.getNarrowKlassShift()); } /** This is used by the debugging system */ @@ -536,6 +544,10 @@ public int getHeapOopSize() { return heapOopSize; } + + public int getKlassPtrSize() { + return klassPtrSize; + } /** Utility routine for getting data structure alignment correct */ public long alignUp(long size, long alignment) { return (size + alignment - 1) & ~(alignment - 1); @@ -784,13 +796,13 @@ return compressedOopsEnabled.booleanValue(); } - public boolean isCompressedHeadersEnabled() { - if (compressedHeadersEnabled == null) { - Flag flag = getCommandLineFlag("UseCompressedHeaders"); - compressedHeadersEnabled = (flag == null) ? Boolean.FALSE: + public boolean isCompressedKlassPointersEnabled() { + if (compressedKlassPointersEnabled == null) { + Flag flag = getCommandLineFlag("UseCompressedKlassPointers"); + compressedKlassPointersEnabled = (flag == null) ? Boolean.FALSE: (flag.getBool()? Boolean.TRUE: Boolean.FALSE); } - return compressedHeadersEnabled.booleanValue(); + return compressedKlassPointersEnabled.booleanValue(); } public int getObjectAlignmentInBytes() {