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

Improve performance of Method.copy() and leafCopy()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      Method.copy() and leafCopy() creates a copy of a Method object with sharing MethodAccessor object. Since the methodAccessor field is a volatile variable, copying this field needs memory fence to ensure the field is visible to all threads on the weak memory platforms such as POWER and ARM.

      When the methodAccessor of the root object is null (i.e., not initialized yet), we do not need to copy the null value because this field of the copied object has been initialized to null in the constructor. We can reduce overhead of the memory fence only when the root's methodAccessor is non-null.

            ogatak Kazunori Ogata
            ogatak Kazunori Ogata
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: