mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8340708: Optimize StackMapGenerator::processMethod
Reviewed-by: liach
This commit is contained in:
parent
a37bb2e037
commit
9bcc7b66de
1 changed files with 6 additions and 4 deletions
|
@ -400,6 +400,8 @@ public final class StackMapGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processMethod() {
|
private void processMethod() {
|
||||||
|
var frames = this.frames;
|
||||||
|
var currentFrame = this.currentFrame;
|
||||||
currentFrame.setLocalsFromArg(methodName, methodDesc, isStatic, thisType);
|
currentFrame.setLocalsFromArg(methodName, methodDesc, isStatic, thisType);
|
||||||
currentFrame.stackSize = 0;
|
currentFrame.stackSize = 0;
|
||||||
currentFrame.flags = 0;
|
currentFrame.flags = 0;
|
||||||
|
@ -415,10 +417,10 @@ public final class StackMapGenerator {
|
||||||
throw generatorError("Expecting a stack map frame");
|
throw generatorError("Expecting a stack map frame");
|
||||||
}
|
}
|
||||||
if (thisOffset == bcs.bci()) {
|
if (thisOffset == bcs.bci()) {
|
||||||
if (!ncf) {
|
|
||||||
currentFrame.checkAssignableTo(frames.get(stackmapIndex));
|
|
||||||
}
|
|
||||||
Frame nextFrame = frames.get(stackmapIndex++);
|
Frame nextFrame = frames.get(stackmapIndex++);
|
||||||
|
if (!ncf) {
|
||||||
|
currentFrame.checkAssignableTo(nextFrame);
|
||||||
|
}
|
||||||
while (!nextFrame.dirty) { //skip unmatched frames
|
while (!nextFrame.dirty) { //skip unmatched frames
|
||||||
if (stackmapIndex == frames.size()) return; //skip the rest of this round
|
if (stackmapIndex == frames.size()) return; //skip the rest of this round
|
||||||
nextFrame = frames.get(stackmapIndex++);
|
nextFrame = frames.get(stackmapIndex++);
|
||||||
|
@ -429,7 +431,7 @@ public final class StackMapGenerator {
|
||||||
currentFrame.copyFrom(nextFrame);
|
currentFrame.copyFrom(nextFrame);
|
||||||
nextFrame.dirty = false;
|
nextFrame.dirty = false;
|
||||||
} else if (thisOffset < bcs.bci()) {
|
} else if (thisOffset < bcs.bci()) {
|
||||||
throw new ClassFormatError(String.format("Bad stack map offset %d", thisOffset));
|
throw generatorError("Bad stack map offset");
|
||||||
}
|
}
|
||||||
} else if (ncf) {
|
} else if (ncf) {
|
||||||
throw generatorError("Expecting a stack map frame");
|
throw generatorError("Expecting a stack map frame");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue