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

Fix backtrace building to not rely on constant pool merging

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      The java backtrace that we create for exceptions has now mirror, method-id, version, bci and cpref. The cpref (constant pool index of the Method name) is dependent on constant pool merging during redefinition, since the cpref doesn't change with new versions of the Klass.

      Rather than saving the cpref, save the Symbol* instead. This Symbol* is stored in the constant pool for the class also. Because of constant pool merging the Symbol* will always be in the constant pool, without constant pool merging it will also be in the constant pool but not necessarily at the same offset. In the case of private or static (final) methods that can be deleted, the symbol can be added to the new unmerged constant pool.

      This change removes the requirement that the Method name's constant pool index remain at the same offset in the constant pool.

      The refcounting for Symbols* is done when the JVM_CONSTANT_Utf8 entry is added to the constant pool, and decremented when the constant pool is deallocated, either when the class is redefined or when the class is unloaded. The mirror in the backtrace keeps the class from being unloaded. The latest version of the class then has the Symbol* in it with a positive refcount.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                coleenp Coleen Phillimore
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: