RFR (S) 8134758: Final String field values should be trusted as stable

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Sep 1 15:36:46 UTC 2015

On 9/1/15 4:34 AM, Aleksey Shipilev wrote:
> On 09/01/2015 04:31 AM, Vladimir Kozlov wrote:
>> Why you check constant.basic_type() == T_OBJECT?
>> In old compact strings version it was value field's type but now it is
>> always array.
> Because that line of reasoning got us here: the desynced version that
> gets overlooked for months in Compact String research, and wastes more
> time after the flaw is discovered. I'd prefer to handle all final fields
> in Strings universally, for every possible type, to avoid future surprises.

Okay, may be add comment.

>> This optimization only done for Sting which are constant. Is it enough
>> for you?
> Yes, it's a known constraint. It is still important for, say,
> concatenating with constant Strings literals, which is a very common case.



> Thanks,
> -Aleksey

More information about the hotspot-compiler-dev mailing list