On 02/19/2016 03:42 PM, Vladimir Ivanov wrote: >> http://cr.openjdk.java.net/~shade/8150180/webrev.hs.01/ > > Why don't you check that index is also a constant? Otherwise, C2 can't > constant fold the loads. > > + if (value->is_Con()) { > + return false; > + }
Right. Without that, constant-value + non-constant-index also bail unnecessarily. Actually, we should also bail only for getChar, but not putChar: http://cr.openjdk.java.net/~shade/8150180/webrev.jdk.01/ http://cr.openjdk.java.net/~shade/8150180/webrev.hs.02/ Cheers, -Aleksey