Request for review (S): C2 should recognize "obj.getClass() == A.class" code pattern
Krystal Mok
rednaxelafx at gmail.com
Wed Apr 25 18:32:18 PDT 2012
Oops. I'm getting native NPE in CmpPNode::Ideal() with SPECjvm2008.
Will investigate and post an updated patch later.
- Kris
On Wed, Apr 25, 2012 at 10:22 PM, Krystal Mok <rednaxelafx at gmail.com> wrote:
> 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/20120426/fb25f845/attachment.html
More information about the hotspot-compiler-dev
mailing list