Request for review (M): 7171890: C1: add Class.isInstance intrinsic
rednaxelafx at gmail.com
Wed May 30 19:55:14 PDT 2012
Hi Remi and Chris,
Yes, it's doable. I'll just take the same approach for
I'm fine with doing it in this change. But it might take some time as I
have some other things that I have to do right now.
Meanwhile I'd like to wait for Chris and see how much this patch improves
the new JSR 292 implementation performance. If it's not good enough, I'll
try again with more complicated solutions.
On Thu, May 31, 2012 at 3:43 AM, Christian Thalinger <
christian.thalinger at oracle.com> wrote:
> On May 30, 2012, at 11:49 AM, Rémi Forax wrote:
> > Hi Krystal,
> > is it also possible to try to trap Class.isAssignableFrom(Class),
> > if one of Class is constant ?
> If Kris has time, why not. The Class.isInstance is important now because
> we will heavily use it in the new JSR 292 implementation. For JRuby's
> red-black tree it used 67% of the run time (yeah, JNI is expensive).
> -- Chris
> > Rémi
> > On 05/30/2012 05:31 PM, Krystal Mok wrote:
> >> Hi all,
> >> Could I have a couple of review for this change, please?
> >> https://gist.github.com/2830194#file_c1_is_instance.patch
> >> This patch implements Class.isInstance() intrinsic in C1.
> >> As a first cut, the current implementation is pretty straightforward:
> >> 1. During HIR construction, Class.isInstance() is inlined as an
> Intrinsic node
> >> in GraphBuilder::try_inline_intrinsics();
> >> 2. Try to canonicalize the Intrinsic node into an InstanceOf node when
> >> appending the node to the HIR graph;
> >> 3. Generate a leaf call to a runtime helper (Runtime1::is_instance_of)
> >> LIR generation for the remaining Intrinsic nodes for
> >> This keeps the change platform-independent.
> >> There are several opportunities for more optimizations. e.g.
> >> 1. Turn more Intrinsic nodes into InstanceOf nodes during HIR
> optimizations and
> >> during LIR generation;
> >> 2. Check the clazz.isInstance(null) case in a couple of places *after*
> clazz is
> >> null-checked or guaranteed to be non-null; turn that into a constant
> >> 3. Follow the lir_store_check example for better platform-dependent
> >> These shall be addressed in some future change, if necessary.
> >> Regards,
> >> Kris
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev