Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8080588 VarHandles development
  3. JDK-8130920

C1 trouble in VarHandle.get tests

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      For some reason, VarHandles are significantly slower than either the plain calls or unsafe calls when compiled with C1.
      This is not specific to int tests, but reproduces on all primitive tests like this:
      http://cr.openjdk.java.net/~shade/8130920/IntTest.java

      o.o.v.get.acc.IntTest.plain avgt 15 16.380 ± 0.008 ns/op
      o.o.v.get.acc.IntTest.unsafe avgt 15 18.903 ± 0.007 ns/op
      o.o.v.get.acc.IntTest.varHandle avgt 15 44.113 ± 0.026 ns/op

      Disassembly points fingers at non-inlined MH::linkToStatic:
       http://cr.openjdk.java.net/~shade/8130920/c1.perfasm
       http://cr.openjdk.java.net/~shade/8130920/c2.perfasm

         2029 239 java.lang.invoke.VarHandleGuards::guard_L_I (38 bytes)
                                  @ 13 java.lang.invoke.VarHandleGuards::checkExactType (12 bytes) force inline by annotation
                                    @ 7 java.lang.invoke.Invokers::newWrongMethodTypeException (36 bytes) callee is too large
                                  @ 31 java.lang.invoke.VarHandleGuards::checkMemberName (12 bytes) force inline by annotation
                                    @ 6 java.lang.invoke.VarHandle::unsupported (8 bytes)
                                      @ 4 java/lang/UnsupportedOperationException::<init> (not loaded) not inlineable
                                  @ 34 java.lang.invoke.MethodHandle::linkToStatic(LLL)I (0 bytes) MemberName not constant

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: