mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
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:
parent
950858350d
commit
7b4f8073f0
223 changed files with 3783 additions and 3641 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue