Request for reviews (M): 7170463: C2 should recognize "obj.getClass() == A.class" code pattern
John Rose
john.r.rose at oracle.com
Wed May 23 22:02:47 PDT 2012
On May 23, 2012, at 4:47 PM, Vladimir Kozlov wrote:
> I updated webrev:
>
> http://cr.openjdk.java.net/~kvn/7170463/webrev.01
>
> I found additional issue with original changes. They accidentally removed optimization which replaces LoadKlass node with ConP (klass type) in map. Next code will not be executed:
>
> cast = con; // Replace non-constant val by con.
>
> New code should do separate map update of object which klass is compared.
That's fine; I like it.
New question: Can the following call return Top?
obj_type->join(con_type)
E.g.,
Number x = 5;
if (x.getClass() == String.class)
System.out.println("fail!");
Perhaps the compare will short-circuit before that happens. If it doesn't, we'll get assertion failures or worse.
— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120523/12bd957a/attachment.html
More information about the hotspot-compiler-dev
mailing list