Request for review (S): C2 should recognize "obj.getClass() == A.class" code pattern
Krystal Mok
rednaxelafx at gmail.com
Wed Apr 25 07:22:36 PDT 2012
Hi all,
I've made a few improvements over the last patch, per John's suggestion,
posted here: https://gist.github.com/2481025#file_class_eq_ver_2.patch
Could I get some reviews for the new version, please?
The new patch normalizes "x.getClass() == y.getClass()" in addition to the
old version.
It also sharpens the type of obj to Foo:NotNull:exact in the IfTrue branch
of "if (x._klass == Foo.klass)".
Tested with the experiment that still had redundant checks with the old
patch (https://gist.github.com/2485414), and now the redundant check is
gone. Thanks a lot, John!
I'm re-running SPECjvm2008 to see if it runs all right.
There are still two doubts, though:
1. In Parse::adjust_map_after_if(), should I delay the transform of
CheckCastPP node, or should I follow the example in
GraphKit::type_check_receiver()?
2. The receiver of getClass() is casted to not_null with a CastPP when
parsing the invokevirtual instruction. Should I sharpen the uncast obj, or
is it okay to just sharpen the CastPP as I'm doing now?
Regards,
Kris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120425/838148d1/attachment.html
More information about the hotspot-compiler-dev
mailing list