src/share/vm/classfile/symbolTable.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
8039525 Cdiff src/share/vm/classfile/symbolTable.hpp
src/share/vm/classfile/symbolTable.hpp
Print this page
*** 42,54 ****
class BoolObjectClosure;
class outputStream;
// Class to hold a newly created or referenced Symbol* temporarily in scope.
! // new_symbol() and lookup() will create a Symbol* if not already in the
// symbol table and add to the symbol's reference count.
! // probe() and lookup_only() will increment the refcount if symbol is found.
class TempNewSymbol : public StackObj {
Symbol* _temp;
public:
TempNewSymbol() : _temp(NULL) {}
--- 42,54 ----
class BoolObjectClosure;
class outputStream;
// Class to hold a newly created or referenced Symbol* temporarily in scope.
! // new_symbol() and lookup_and_add() will create a Symbol* if not already in the
// symbol table and add to the symbol's reference count.
! // probe() and lookup_only_and_hash() will increment the refcount if symbol is found.
class TempNewSymbol : public StackObj {
Symbol* _temp;
public:
TempNewSymbol() : _temp(NULL) {}
*** 105,115 ****
int* cp_indices, unsigned int* hashValues,
TRAPS) {
add(loader_data, cp, names_count, name, lengths, cp_indices, hashValues, THREAD);
}
! Symbol* lookup(int index, const char* name, int len, unsigned int hash);
SymbolTable()
: Hashtable<Symbol*, mtSymbol>(SymbolTableSize, sizeof (HashtableEntry<Symbol*, mtSymbol>)) {}
SymbolTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
--- 105,115 ----
int* cp_indices, unsigned int* hashValues,
TRAPS) {
add(loader_data, cp, names_count, name, lengths, cp_indices, hashValues, THREAD);
}
! Symbol* lookup_only(int index, const char* name, int len, unsigned int hash);
SymbolTable()
: Hashtable<Symbol*, mtSymbol>(SymbolTableSize, sizeof (HashtableEntry<Symbol*, mtSymbol>)) {}
SymbolTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
*** 159,182 ****
initialize_symbols();
}
static unsigned int hash_symbol(const char* s, int len);
! static Symbol* lookup(const char* name, int len, TRAPS);
// lookup only, won't add. Also calculate hash.
! static Symbol* lookup_only(const char* name, int len, unsigned int& hash);
// Only copy to C string to be added if lookup failed.
! static Symbol* lookup(const Symbol* sym, int begin, int end, TRAPS);
static void release(Symbol* sym);
// Look up the address of the literal in the SymbolTable for this Symbol*
static Symbol** lookup_symbol_addr(Symbol* sym);
// jchar (utf16) version of lookups
! static Symbol* lookup_unicode(const jchar* name, int len, TRAPS);
! static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash);
static void add(ClassLoaderData* loader_data,
constantPoolHandle cp, int names_count,
const char** names, int* lengths, int* cp_indices,
unsigned int* hashValues, TRAPS);
--- 159,182 ----
initialize_symbols();
}
static unsigned int hash_symbol(const char* s, int len);
! static Symbol* lookup_and_add(const char* name, int len, TRAPS);
// lookup only, won't add. Also calculate hash.
! static Symbol* lookup_only_and_hash(const char* name, int len, unsigned int& hash);
// Only copy to C string to be added if lookup failed.
! static Symbol* lookup_and_add(const Symbol* sym, int begin, int end, TRAPS);
static void release(Symbol* sym);
// Look up the address of the literal in the SymbolTable for this Symbol*
static Symbol** lookup_symbol_addr(Symbol* sym);
// jchar (utf16) version of lookups
! static Symbol* lookup_and_add_unicode(const jchar* name, int len, TRAPS);
! static Symbol* lookup_only_and_hash_unicode(const jchar* name, int len, unsigned int& hash);
static void add(ClassLoaderData* loader_data,
constantPoolHandle cp, int names_count,
const char** names, int* lengths, int* cp_indices,
unsigned int* hashValues, TRAPS);
*** 195,212 ****
static void symbols_do(SymbolClosure *cl);
// Symbol creation
static Symbol* new_symbol(const char* utf8_buffer, int length, TRAPS) {
assert(utf8_buffer != NULL, "just checking");
! return lookup(utf8_buffer, length, THREAD);
}
static Symbol* new_symbol(const char* name, TRAPS) {
return new_symbol(name, (int)strlen(name), THREAD);
}
static Symbol* new_symbol(const Symbol* sym, int begin, int end, TRAPS) {
assert(begin <= end && end <= sym->utf8_length(), "just checking");
! return lookup(sym, begin, end, THREAD);
}
// Create a symbol in the arena for symbols that are not deleted
static Symbol* new_permanent_symbol(const char* name, TRAPS);
--- 195,212 ----
static void symbols_do(SymbolClosure *cl);
// Symbol creation
static Symbol* new_symbol(const char* utf8_buffer, int length, TRAPS) {
assert(utf8_buffer != NULL, "just checking");
! return lookup_and_add(utf8_buffer, length, THREAD);
}
static Symbol* new_symbol(const char* name, TRAPS) {
return new_symbol(name, (int)strlen(name), THREAD);
}
static Symbol* new_symbol(const Symbol* sym, int begin, int end, TRAPS) {
assert(begin <= end && end <= sym->utf8_length(), "just checking");
! return lookup_and_add(sym, begin, end, THREAD);
}
// Create a symbol in the arena for symbols that are not deleted
static Symbol* new_permanent_symbol(const char* name, TRAPS);
*** 216,230 ****
// Needed for preloading classes in signatures when compiling.
// Returns the symbol is already present in symbol table, otherwise
// NULL. NO ALLOCATION IS GUARANTEED!
static Symbol* probe(const char* name, int len) {
unsigned int ignore_hash;
! return lookup_only(name, len, ignore_hash);
}
static Symbol* probe_unicode(const jchar* name, int len) {
unsigned int ignore_hash;
! return lookup_only_unicode(name, len, ignore_hash);
}
// Histogram
static void print_histogram() PRODUCT_RETURN;
static void print() PRODUCT_RETURN;
--- 216,230 ----
// Needed for preloading classes in signatures when compiling.
// Returns the symbol is already present in symbol table, otherwise
// NULL. NO ALLOCATION IS GUARANTEED!
static Symbol* probe(const char* name, int len) {
unsigned int ignore_hash;
! return lookup_only_and_hash(name, len, ignore_hash);
}
static Symbol* probe_unicode(const jchar* name, int len) {
unsigned int ignore_hash;
! return lookup_only_and_hash_unicode(name, len, ignore_hash);
}
// Histogram
static void print_histogram() PRODUCT_RETURN;
static void print() PRODUCT_RETURN;
src/share/vm/classfile/symbolTable.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File