Request for review (M): 7171890: C1: add Class.isInstance intrinsic

Rémi Forax forax at univ-mlv.fr
Wed May 30 11:49:23 PDT 2012


Hi Krystal,
is it also possible to try to trap Class.isAssignableFrom(Class),
if one of Class is constant ?

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) 
> during
>    LIR generation for the remaining Intrinsic nodes for 
> Class.isInstance().
>    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 false.
> 3. Follow the lir_store_check example for better platform-dependent 
> performance
>
> These shall be addressed in some future change, if necessary.
>
> Regards,
> Kris



More information about the hotspot-compiler-dev mailing list