void symbolTable::add(symbolOop s) { assert(s->is_symbol(), "adding something that's not a symbol to the symbol table"); assert(s->is_old(), "all symbols should be tenured"); int hashValue = hash((char*) s->bytes(), s->length()); basic_add(s, hashValue); }
bool symbolTable::is_present(symbolOop sym) { char* name = (char*) sym->bytes(); int len = sym->length(); int hashValue = hash(name, len); symbolTableEntry* bucket = bucketFor(hashValue); if (bucket->is_empty()) return false; if (bucket->is_symbol()) return bucket->get_symbol()->equals(name, len); for (symbolTableLink* l = bucket->get_link(); l; l = l->next) if (l->symbol->equals(name, len)) return true; return false; }
void symbolTable::add_symbol(symbolOop s) { basic_add(s, hash((char*) s->bytes(), s->length())); }