JDK-8337251 : C1: Improve Class.isInstance intrinsic
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-07-26
  • Updated: 2024-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Reflective case for Class::isInstance(Object) is backed by Runtime1::is_instance_of() which uses oopDesc::is_a() to do the job.

Consider improving the implementation based on backend functionality introduced by JDK-8331341.


hotspot/src/share/vm/c1/c1_LIRGenerator.cpp:
// Example: clazz.isInstance(object)
void LIRGenerator::do_isInstance(Intrinsic* x) {
...
  // TODO could try to substitute this node with an equivalent InstanceOf
  // if clazz is known to be a constant Class. This will pick up newly found
  // constants after HIR construction. I'll leave this to a future change.

  // as a first cut, make a simple leaf call to runtime to stay platform independent.
  // could follow the aastore example in a future change.