RFR (xs) 8145940: TempNewSymbol should have correct copy and assignment functions

Coleen Phillimore coleen.phillimore at oracle.com
Thu Jan 7 20:02:41 UTC 2016

Summary: Add clear() to the assignment operator and add copy constructor.

Ran all jtreg, colocated and non-colocated tests.   RunThese -jck with 
PrintSymbolTableSizeHistogram statistics:

   Percent removed          1.35
   Reference counts          194583


   Percent removed          1.53
   Reference counts          194245

Without a reference counting copy constructor, we could remove a 
TempNewSymbol's Symbol if a GC happens.  Consider:

TempNewSymbol ts = SymbolTable::new_symbol("abc");
// Hit GC

The ref count for "abc" is 1 when created by new_symbol, and the 
destructor could run after the copy into ts, decrementing the reference 
count to 0 again.  GC could unlink that symbol from the symbol table.  
Fortunately, we haven't seen this bug.

open webrev at http://cr.openjdk.java.net/~coleenp/8145940/
bug link https://bugs.openjdk.java.net/browse/JDK-8145940


More information about the hotspot-runtime-dev mailing list