RFR (S) 8141044: C1 should fold (this == null) to false

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Nov 3 21:42:12 UTC 2015


On 11/03/2015 12:52 AM, Aleksey Shipilev wrote:
> On 11/03/2015 12:27 AM, Krystal Mok wrote:
>> Let's imagine this kind of example (deriving from your earlier example):
>>
>> void foo(Bar obj) {
>>   obj.bar();
>>   // or if Bar obj came here from a return value of another method
>> }
>>
>> void bar() {
>>   quux(this);
>> }
>>
>> void quux(Object o) {
>>   if (o == null) throw new Exception();
>> }
>>
>> If the call path foo() -> bar() -> quux() is fully inlined in C1, then
>> for the bar() method the 'this' value wouldn't have been a Local[0],
>> thus it'd miss the optimization you implemented.
> 
> Ah, yes... That is probably a deal-breaker for the A*FU cases I am
> trying to optimize. The A*FU.get(this) would certainly be inlined, and
> this-ness would be lost.

Actually, scratch that, I've played with different examples, including
the A*FU case, and the example Kris shows above, and we elide the
null-check in all interesting cases. Therefore, I'd like the current
patch to go in its current form. For the record:
  http://cr.openjdk.java.net/~shade/8141044/webrev.01/

I started the RBT run to catch any surprise failures.

Thanks,
-Aleksey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20151104/8837539d/signature.asc>


More information about the hotspot-compiler-dev mailing list