-
Bug
-
Resolution: Duplicate
-
P4
-
hs24, hs25
-
generic, x86
-
generic, linux
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."
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."
- duplicates
-
JDK-8008511 JSR 292: MemberName vmtarget refs to methods must be updated at class redefinition
- Resolved