hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java
changeset 8076 96d498ec7ae1
parent 5547 f4b087cbb361
child 8727 1642a45f024f
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java	Thu Jan 27 13:42:28 2011 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java	Thu Jan 27 16:11:27 2011 -0800
@@ -70,11 +70,13 @@
   }
 
   public void stringsDo(StringVisitor visitor) {
+    ObjectHeap oh = VM.getVM().getObjectHeap();
     int numBuckets = tableSize();
     for (int i = 0; i < numBuckets; i++) {
       for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
            e = (HashtableEntry) e.next()) {
-        visitor.visit((Instance) e.literal());
+        Instance s = (Instance)oh.newOop(e.literalValue().addOffsetToAsOopHandle(0));
+        visitor.visit(s);
       }
     }
   }