RFR(S) 8210388 Use hash table to store archived subgraph_info records

Ioi Lam ioi.lam at oracle.com
Thu Sep 20 18:28:17 UTC 2018


http://cr.openjdk.java.net/~iklam/jdk12/8210388-hashtable-subgraph-info.v01/
https://bugs.openjdk.java.net/browse/JDK-8210388

Here's another small step towards CDS support for Lambda (JDK-8198698).

Replace the linear search of ArchivedKlassSubGraphInfoRecord with
a hashtable. Currently we have just 6 such records, but with Lambda support
that number is going to increase substiantially.

      Shared subgraphs table stats
      Number of entries       :         6
      Total bytes used        :        72
      Average bytes per entry :    12.000
      Average bucket size     :     6.000
      Variance of bucket size :     0.000
      Std. dev. of bucket size:     0.000
      Empty buckets           :         0
      Value_Only buckets      :         0
      Other buckets           :         1

I also took the chance to clean up the use of CompactHashtableWriter in
the symbol/string tables. In doing so, I fixed a bug where
SymbolTable::copy_shared_symbol_table was skipping symbols with zero 
hashcodes.
This should be done for the string table only.

Jiangli, could you help me with this comments?

     unsigned int hash = java_lang_String::hash_code(s);
     if (hash == 0) {
       // We do not archive Strings with a 0 hashcode because ......
       return true;
     }


Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list