6825642: nsk sajdi tests fail with NullPointerException
authoracorn
Thu, 02 Apr 2009 14:26:42 -0400
changeset 2359 7242a18bcd12
parent 2358 7c8346929fc6
child 2360 95bd335db62b
6825642: nsk sajdi tests fail with NullPointerException Reviewed-by: xlu, coleenp, kamg, swamyv
hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
hotspot/src/share/vm/runtime/vmStructs.cpp
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java	Wed Apr 01 16:38:01 2009 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java	Thu Apr 02 14:26:42 2009 -0400
@@ -306,6 +306,8 @@
 
       entryAddr = entryAddr.addOffsetTo(intConstantEntryArrayStride);
     } while (nameAddr != null);
+      String symbol = "heapOopSize"; // global int constant and value is initialized at runtime.
+      addIntConstant(symbol, (int)lookupInProcess(symbol).getCIntegerAt(0, 4, false));
   }
 
   private void readVMLongConstants() {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Apr 01 16:38:01 2009 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Thu Apr 02 14:26:42 2009 -0400
@@ -343,13 +343,13 @@
     }
     soleInstance = new VM(db, debugger, debugger.getMachineDescription().isBigEndian());
 
+    debugger.putHeapConst(soleInstance.getHeapOopSize(), Universe.getNarrowOopBase(),
+                          Universe.getNarrowOopShift());
+
     for (Iterator iter = vmInitializedObservers.iterator(); iter.hasNext(); ) {
       ((Observer) iter.next()).update(null, null);
     }
 
-    debugger.putHeapConst(soleInstance.getHeapOopSize(), Universe.getNarrowOopBase(),
-                          Universe.getNarrowOopShift());
-
   }
 
   /** This is used by the debugging system */
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Apr 01 16:38:01 2009 -0400
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu Apr 02 14:26:42 2009 -0400
@@ -1320,7 +1320,6 @@
   /****************/                                                      \
                                                                           \
   declare_constant(oopSize)                                               \
-  declare_constant(heapOopSize)                                           \
   declare_constant(LogBytesPerWord)                                       \
   declare_constant(BytesPerLong)                                          \
                                                                           \