hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
changeset 8076 96d498ec7ae1
parent 5547 f4b087cbb361
child 8921 14bfe81f2a9d
equal deleted inserted replaced
8075:582dd25571b2 8076:96d498ec7ae1
    83       table. */
    83       table. */
    84   public Symbol probe(byte[] name) {
    84   public Symbol probe(byte[] name) {
    85     long hashValue = hashSymbol(name);
    85     long hashValue = hashSymbol(name);
    86     for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
    86     for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
    87       if (e.hash() == hashValue) {
    87       if (e.hash() == hashValue) {
    88          Symbol sym = (Symbol) e.literal();
    88          Symbol sym = Symbol.create(e.literalValue());
    89          if (sym.equals(name)) {
    89          if (sym.equals(name)) {
    90            return sym;
    90            return sym;
    91          }
    91          }
    92       }
    92       }
    93     }
    93     }
   101   public void symbolsDo(SymbolVisitor visitor) {
   101   public void symbolsDo(SymbolVisitor visitor) {
   102     int numBuckets = tableSize();
   102     int numBuckets = tableSize();
   103     for (int i = 0; i < numBuckets; i++) {
   103     for (int i = 0; i < numBuckets; i++) {
   104       for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
   104       for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
   105            e = (HashtableEntry) e.next()) {
   105            e = (HashtableEntry) e.next()) {
   106         visitor.visit((Symbol) e.literal());
   106         visitor.visit(Symbol.create(e.literalValue()));
   107       }
   107       }
   108     }
   108     }
   109   }
   109   }
   110 
   110 
   111   private static byte[] toModifiedUTF8Bytes(String name) throws IOException {
   111   private static byte[] toModifiedUTF8Bytes(String name) throws IOException {