6990754: Use native memory and reference counting to implement SymbolTable

Move symbols from permgen into C heap and reference count them

Reviewed-by: never, acorn, jmasa, stefank
This commit is contained in:
Coleen Phillimore 2011-01-27 16:11:27 -08:00
parent 950858350d
commit 7b4f8073f0
223 changed files with 3783 additions and 3641 deletions

View file

@ -290,6 +290,22 @@ public:
virtual void do_tag(int tag) = 0;
};
class SymbolClosure : public StackObj {
public:
virtual void do_symbol(Symbol**) = 0;
// Clear LSB in symbol address; it can be set by CPSlot.
static Symbol* load_symbol(Symbol** p) {
return (Symbol*)(intptr_t(*p) & ~1);
}
// Store symbol, adjusting new pointer if the original pointer was adjusted
// (symbol references in constant pool slots have their LSB set to 1).
static void store_symbol(Symbol** p, Symbol* sym) {
*p = (Symbol*)(intptr_t(sym) | (intptr_t(*p) & 1));
}
};
#ifdef ASSERT
// This class is used to flag phases of a collection that
// can unload classes and which should override the