Request for review (M): 7171890: C1: add Class.isInstance intrinsic
Krystal Mok
rednaxelafx at gmail.com
Wed May 30 08:31:52 PDT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120530/124f8486/attachment.html
More information about the hotspot-compiler-dev
mailing list