Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8337251

C1: Improve Class.isInstance intrinsic

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 24
    • hotspot
    • b10

      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.

            aph Andrew Haley
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: