1.1 --- a/src/share/vm/memory/iterator.hpp Thu Jan 27 13:42:28 2011 -0800 1.2 +++ b/src/share/vm/memory/iterator.hpp Thu Jan 27 16:11:27 2011 -0800 1.3 @@ -290,6 +290,22 @@ 1.4 virtual void do_tag(int tag) = 0; 1.5 }; 1.6 1.7 +class SymbolClosure : public StackObj { 1.8 + public: 1.9 + virtual void do_symbol(Symbol**) = 0; 1.10 + 1.11 + // Clear LSB in symbol address; it can be set by CPSlot. 1.12 + static Symbol* load_symbol(Symbol** p) { 1.13 + return (Symbol*)(intptr_t(*p) & ~1); 1.14 + } 1.15 + 1.16 + // Store symbol, adjusting new pointer if the original pointer was adjusted 1.17 + // (symbol references in constant pool slots have their LSB set to 1). 1.18 + static void store_symbol(Symbol** p, Symbol* sym) { 1.19 + *p = (Symbol*)(intptr_t(sym) | (intptr_t(*p) & 1)); 1.20 + } 1.21 +}; 1.22 + 1.23 #ifdef ASSERT 1.24 // This class is used to flag phases of a collection that 1.25 // can unload classes and which should override the