diff agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Fri Apr 11 09:56:35 2008 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Sun Apr 13 17:43:42 2008 -0400
@@ -467,7 +467,6 @@
     for (int index = 0; index < length; index += NEXT_OFFSET) {
       short accessFlags    = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
       short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
-
       FieldType   type   = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
       AccessFlags access = new AccessFlags(accessFlags);
       if (access.isStatic()) {
@@ -790,7 +789,11 @@
     short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
     FieldType type = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
     if (type.isOop()) {
-      return new OopField(this, index);
+     if (VM.getVM().isCompressedOopsEnabled()) {
+        return new NarrowOopField(this, index);
+     } else {
+        return new OopField(this, index);
+     }
     }
     if (type.isByte()) {
       return new ByteField(this, index);