On Tue, 24 Jan 2023 00:16:10 GMT, Alex Menkov <[email protected]> wrote:
> classFileParser drops stack map frames for JDK classes (when verification is
> not required).
> As a result JvmtiClassFileReconstituter cannot restore the attribute for
> class redefinition.
> Note that if the class is in CDS archive, the frames are restored from CDS,
> so this issue affects only JDK classes which are not in CDS.
> This code is old (from "initial load") and I don't understand the reason it
> was implemented this way.
>
> Testing: tier1-tier6
Copyright needs updating.
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/MissedStackMapFrames/MissedStackMapFrames.java
line 91:
> 89: int frameCount = getStackMapFrameCount(classfileBuffer);
> 90: log(" Has stack map frames: " + frameCount);
> 91: if (frameCount == 0) {
Shouldn't the check also be that the number of frames is the same in the "load"
and "retransform" cases?
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/MissedStackMapFrames/MissedStackMapFrames.java
line 107:
> 105: byte[] retransformBytes = retransformBytes(i);
> 106: checkStackMapFrames(cls + "(load)", loadBytes);
> 107: checkStackMapFrames(cls + "(retranform)", retransformBytes);
"retransform"
-------------
Changes requested by cjplummer (Reviewer).
PR: https://git.openjdk.org/jdk/pull/12155