Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java @ 2177:3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
Summary: move symbols from permgen into C heap and reference count them
Reviewed-by: never, acorn, jmasa, stefank
author | coleenp |
---|---|
date | Thu, 27 Jan 2011 16:11:27 -0800 |
parents | c18cbe5936b8 |
children | 924777755fad |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
68 public interface StringVisitor { | 68 public interface StringVisitor { |
69 public void visit(Instance string); | 69 public void visit(Instance string); |
70 } | 70 } |
71 | 71 |
72 public void stringsDo(StringVisitor visitor) { | 72 public void stringsDo(StringVisitor visitor) { |
73 ObjectHeap oh = VM.getVM().getObjectHeap(); | |
73 int numBuckets = tableSize(); | 74 int numBuckets = tableSize(); |
74 for (int i = 0; i < numBuckets; i++) { | 75 for (int i = 0; i < numBuckets; i++) { |
75 for (HashtableEntry e = (HashtableEntry) bucket(i); e != null; | 76 for (HashtableEntry e = (HashtableEntry) bucket(i); e != null; |
76 e = (HashtableEntry) e.next()) { | 77 e = (HashtableEntry) e.next()) { |
77 visitor.visit((Instance) e.literal()); | 78 Instance s = (Instance)oh.newOop(e.literalValue().addOffsetToAsOopHandle(0)); |
79 visitor.visit(s); | |
78 } | 80 } |
79 } | 81 } |
80 } | 82 } |
81 } | 83 } |