RFR(S): 8158228: C1 incorrectly folds mismatched loads from stable arrays
vladimir.x.ivanov at oracle.com
Fri Jun 3 10:26:09 UTC 2016
>>> Like this we still have optimal code. What do you think?
>> I suggest to completely disable constant folding in Canonicalizer::do_LoadIndexed if LoadIndexed node is marked as mismatched.
>> Please, leave ciArray::element_value_impl as is.
> Okay, I noticed that C2 also does not fold mismatched accesses. Could you please explain why that is?
Primarily to keep the code sane :-) Unsafe accesses are the source of
mismatched accesses and additional checks are required to filter out all
problematic cases. So, I decided to leave them out when enabled constant
folding of unsafe loads. My main motivation for the change was to make
method handles for field / array element accesses as fast as using
bytecode, and mismatched accesses didn't justify all the complications
> Here's the new webrev:
More information about the hotspot-compiler-dev