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

Simplify CLD weak liveness check in c2i entry barrier

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Withdrawn
    • Icon: P4 P4
    • tbd
    • 24.0.2, 25
    • hotspot
    • None
    • generic
    • generic

      c2i entry barriers their target method's class loader data to see whether it is strongly or weakly alive. The latter test uses macro assembler method `resolve_weak_oop` to plant code which loads a `WeakReference` from field `ClassLoaderData::holder`. If the reference is not null the associated reference is resolved to an oop. However, the result is only tested for zero/non-zero.

      When compressed oops are enabled resolution of the oop can involve planting code to add in the compressed oops base and/or perform a shift, neither of which is really necessary in order to detect a zero result. The result will be zero if and only if the narrow field value is zero.

      The code could be simplified if it employed a variant of `resolve_weak_oop` that avoided the uncompression step, simply returning the uncompressed value. This would also have the benefit for project Leyden that AOT generated code would not embed the compressed oops base and therefore not require a relocation at reload.

            Unassigned Unassigned
            adinn Andrew Dinn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: