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

speedup JNI primitive field accesses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • hotspot
    • beta2
    • generic
    • generic

      Use the following logic to speedup JNI primitive field accesses:
      A _safepoint_counter is increment at the beginning and end of each
      safepoint, with an initial value of 0.
      // load _safepoint_counter into old_counter
      // IF old_counter is odd THEN
      // a safepoint is going on, return jni_GetXXXField
      // ELSE
      // load the primitive field value into result (speculatively)
      // load _safepoint_counter into new_counter
      // IF (old_counter == new_counter) THEN
      // no safepoint happens during the field access, return result
      // ELSE
      // a safepoint might have happened in-between, return jni_GetXXXField()
      // ENDIF
      // ENDIF

      GetObjectField requires local handle creation so the idea can't be applied
      directly.

            myangsunw Mingyao Yang (Inactive)
            myangsunw Mingyao Yang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: