C2: CHA support for interface calls when inlining through method handle linker

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 26
    • Affects Version/s: 19
    • Component/s: hotspot
    • b25

      CHA can devirtualize interface calls by strength reducing them to virtual calls when there's only a single direct implementor class present at runtime.

      It relies on symbolic information present in bytecode and doesn't work when invocation goes through method handle linker (MethodHandle.linkToInterface()):

      src/hotspot/share/opto/doCall.cpp:

          if (call_does_dispatch && bytecode == Bytecodes::_invokeinterface) {
            ciInstanceKlass* declared_interface =
                caller->get_declared_method_holder_at_bci(bci)->as_instance_klass();
            ciInstanceKlass* singleton = declared_interface->unique_implementor();

      (Both C1 and C2 are affected.)

            Assignee:
            Vladimir Ivanov
            Reporter:
            Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: