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

Object.hashCode optimization should be restored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • hotspot
    • None
    • b28
    • 6
    • b49
    • sparc
    • solaris_9

      The switch to shared generation of native wrappers lost a C1 optimization for Object.hashCode. The identity hash code is stored in the header of objects and Object.hashCode is used to access it. Having to transition to native just to pull it out is extremely expensive. C1 had an optimization that would generate a special prologue for the native wrapper of Object.hashCode that would try to extract it if it could. Otherwise it would go the normal slow path. This was lost during the transition to shared native wrapper generation. C2 does this by emitting ideal which tests if hashCode has been overriden and tries the special case if it hasn't. That's slightly faster but would be complicated to emit in c1. We should simply restore the prologue in the native wrapper generation.

            never Tom Rodriguez
            never Tom Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: