RFR JDK-8059510 Compact symbol table layout inside shared archive

Gerard Ziemski gerard.ziemski at oracle.com
Tue Oct 21 16:17:58 UTC 2014


hi Jiangli,

Still going through your web rev, but I have one additional question so 
far regarding: "SymbolTable::lookup”

  Symbol* SymbolTable::lookup(int index, const char* name,

                                int len, unsigned int hash) {

+  Symbol* s = _shared_table.lookup(name, hash, len);

+  if (s != NULL) {

+    return s;

+  }

+

Instead of statically allocating _shared_table could we declare it as a 
NULL pointer and only allocate it in
SymbolTable::init_shared_table as needed? Then we could have:

  Symbol* SymbolTable::lookup(int index, const char* name,

                                int len, unsigned int hash) {

+  if (_shared_table != NULL) {

+    Symbol* s = _shared_table.lookup(name, hash, len);

+    if (s != NULL) {

+      return s;

+    }

+  }

+

and avoid a NOP call to _shared_table in case where CDS is not used - that would also
make it easy to see that there is no lookup penalty while sharing is off.




cheers


More information about the hotspot-runtime-dev mailing list