Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/symbolTable.cpp @ 4800:94ec88ca68e2
7115199: Add event tracing hooks and Java Flight Recorder infrastructure
Summary: Added a nop tracing infrastructure, JFR makefile changes and other infrastructure used only by JFR.
Reviewed-by: acorn, sspitsyn
Contributed-by: markus.gronlund@oracle.com
author | phh |
---|---|
date | Wed, 11 Jan 2012 17:34:02 -0500 |
parents | 352622fd140a |
children | fc9d8850ab8b |
comparison
equal
deleted
inserted
replaced
4773:4f25538b54c9 | 4800:94ec88ca68e2 |
---|---|
202 | 202 |
203 Symbol* s = the_table()->lookup(index, name, len, hash); | 203 Symbol* s = the_table()->lookup(index, name, len, hash); |
204 return s; | 204 return s; |
205 } | 205 } |
206 | 206 |
207 // Look up the address of the literal in the SymbolTable for this Symbol* | |
208 // Do not create any new symbols | |
209 // Do not increment the reference count to keep this alive | |
210 Symbol** SymbolTable::lookup_symbol_addr(Symbol* sym){ | |
211 unsigned int hash = hash_symbol((char*)sym->bytes(), sym->utf8_length()); | |
212 int index = the_table()->hash_to_index(hash); | |
213 | |
214 for (HashtableEntry<Symbol*>* e = the_table()->bucket(index); e != NULL; e = e->next()) { | |
215 if (e->hash() == hash) { | |
216 Symbol* literal_sym = e->literal(); | |
217 if (sym == literal_sym) { | |
218 return e->literal_addr(); | |
219 } | |
220 } | |
221 } | |
222 return NULL; | |
223 } | |
224 | |
207 // Suggestion: Push unicode-based lookup all the way into the hashing | 225 // Suggestion: Push unicode-based lookup all the way into the hashing |
208 // and probing logic, so there is no need for convert_to_utf8 until | 226 // and probing logic, so there is no need for convert_to_utf8 until |
209 // an actual new Symbol* is created. | 227 // an actual new Symbol* is created. |
210 Symbol* SymbolTable::lookup_unicode(const jchar* name, int utf16_length, TRAPS) { | 228 Symbol* SymbolTable::lookup_unicode(const jchar* name, int utf16_length, TRAPS) { |
211 int utf8_length = UNICODE::utf8_length((jchar*) name, utf16_length); | 229 int utf8_length = UNICODE::utf8_length((jchar*) name, utf16_length); |