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

Bootstrap and target methods handles are not invalidated when class is redefined via JVMTI

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, linux

      Description

      Bootstrap and target methods currently can't be redefined inside those methods.

      Consider the following scenarios:

      A:

      1. An invokedynamic instruction is executed against some class
      2. When it calls bootstrap method, the class is redefined via JVMTI RedefineClasses() function and PopFrame() is called to replace the current (obsolete) bootstrap method with a redefined version

      B:

      1. An invokedynamic instruction is executed against some class
      2. It calls bootstrap method, which creates a CallSite with some target method inside the class
      3. When target method is called, the class is redefined via JVMTI RedefineClasses() function and PopFrame() is called to replace the current (obsolete) method with a redefined version

      In the both cases, the redefined version of the bootstrap or the target method is never called after PopFrame() for a given call site. But if these old methods calls the other methods of the class, the redefined versions are invoked.

      This behavior is not consistent with the JVMTI spec:

      "Redefinition can cause new versions of methods to be installed. Old method versions may become obsolete The new method version will be used on new invokes. If a method has active stack frames, those active frames continue to run the bytecodes of the original method version. If resetting of stack frames is desired, use PopFrame to pop frames with obsolete method versions."

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jrose John Rose
                Reporter:
                kshiroko Kirill Shirokov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: