RFR (XS): 8148518: Unsafe.getCharUnaligned() loads aren't folded in case of -XX:-UseUnalignedAccesses
vladimir.x.ivanov at oracle.com
Tue Feb 16 10:56:26 UTC 2016
Vladimir, Aleksey, thanks for the reviews.
>> Current Unsafe::getCharUnaligned Java implementation isn't fully
>> optimized by C2: it never constant folds such loads from char fields.
>> C2 matches the types of a load and a location and does constant folding
>> only if they match. For getCharUnaligned it sees a load of a short
>> value, but the field is of type char.
> Does the same affect putCharUnaligned?
No, the logic is specific to unsafe loads.
More information about the core-libs-dev