[lworld] Use profiling around acmp to speculate that one operand is a value object

XMLWordPrintable

      We should leverage profiling info around acmp to speculate that one operand is a value object of known type. This would then enable the optimization added by JDK-8228361.


      Original report:

      acmp of value types from non-flattened arrays is 5x times slower than on flattened.

      Benchmark Mode Cnt Score Error Units
      o.o.b.v.a.array.Value032.branch_obj_equals025 avgt 5 4.647 ± 0.543 ns/op
      o.o.b.v.a.array.Value032.branch_val_equals025 avgt 5 0.607 ± 0.030 ns/op

      branch_val_equals025 - flattened array.
      branch_obj_equals025 - non-flattened, runtime type of the array is "Object[]".
      The reason:

        33.71% Unknown, level 0 java.lang.invoke.MethodHandle::invokeBasic, version 1, compile id 550
        32.54% C2, level 4 java.lang.runtime.ValueObjectMethods::isSubstitutable, version 4, compile id 953
         8.08% C2, level 4 org.openjdk.bench.valhalla.acmp.array.Value032::cmp_branch_obj, version 3, compile id 923
         3.67% C2, level 4 java.lang.invoke.LambdaForm$MH.0x000000007d08b400::invoke, version 2, compile id 922

            Assignee:
            Tobias Hartmann
            Reporter:
            Sergey Kuksenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: