RFR (L) JDK-8195100: Use a low latency hashtable for SymbolTable

Ioi Lam ioi.lam at oracle.com
Thu Aug 2 15:40:41 UTC 2018



On 8/2/18 8:26 AM, Gerard Ziemski wrote:
>
>> symbolTable.cpp:
>>
>>   342   // Otherwise, add the symbol to table. Copy to a C string first.
>>   343   char stack_buf[ON_STACK_BUFFER_LENGTH];
>>   344   ResourceMark rm(THREAD);
>>   345   if (len <= ON_STACK_BUFFER_LENGTH) {
>>   346     buffer = stack_buf;
>>   347   } else {
>>   348     buffer = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
>>   349   }
>>   350   for (int i=0; i<len; i++) {
>>   351     buffer[i] = name[i];
>>   352   }
>>   353   // Make sure there is no safepoint in the code above since name can't move.
>>   354   // We can't include the code in NoSafepointVerifier because of the
>>   355   // ResourceMark.
>>
>> The above is dead code and should be removed.
> That’s not dead code, but in fact you did find an issue here - we should be using the “buffer”, not “name” when we add to the table. Thanks!
>
>
Why do you need to make a copy here? buffer and name seems to have the 
exact same contents.

Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list