8341510: Optimize StackMapGenerator::processFieldInstructions
Reviewed-by: liach
This commit is contained in:
parent
b42fbf43df
commit
f8db3a831b
@ -50,7 +50,7 @@ public sealed interface ConstantDynamicEntry
|
||||
* {@return a symbolic descriptor for the dynamic constant's type}
|
||||
*/
|
||||
default ClassDesc typeSymbol() {
|
||||
return Util.fieldTypeSymbol(nameAndType());
|
||||
return Util.fieldTypeSymbol(type());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,6 +44,6 @@ public sealed interface FieldRefEntry extends MemberRefEntry
|
||||
* {@return a symbolic descriptor for the field's type}
|
||||
*/
|
||||
default ClassDesc typeSymbol() {
|
||||
return Util.fieldTypeSymbol(nameAndType());
|
||||
return Util.fieldTypeSymbol(type());
|
||||
}
|
||||
}
|
||||
|
@ -756,22 +756,20 @@ public final class StackMapGenerator {
|
||||
}
|
||||
|
||||
private void processFieldInstructions(RawBytecodeHelper bcs) {
|
||||
var desc = Util.fieldTypeSymbol(cp.entryByIndex(bcs.getIndexU2(), MemberRefEntry.class).nameAndType());
|
||||
var desc = Util.fieldTypeSymbol(cp.entryByIndex(bcs.getIndexU2(), MemberRefEntry.class).type());
|
||||
var currentFrame = this.currentFrame;
|
||||
switch (bcs.opcode()) {
|
||||
case GETSTATIC ->
|
||||
currentFrame.pushStack(desc);
|
||||
case PUTSTATIC -> {
|
||||
currentFrame.popStack();
|
||||
if (Util.isDoubleSlot(desc)) currentFrame.popStack();
|
||||
currentFrame.decStack(Util.isDoubleSlot(desc) ? 2 : 1);
|
||||
}
|
||||
case GETFIELD -> {
|
||||
currentFrame.popStack();
|
||||
currentFrame.decStack(1);
|
||||
currentFrame.pushStack(desc);
|
||||
}
|
||||
case PUTFIELD -> {
|
||||
currentFrame.popStack();
|
||||
currentFrame.popStack();
|
||||
if (Util.isDoubleSlot(desc)) currentFrame.popStack();
|
||||
currentFrame.decStack(Util.isDoubleSlot(desc) ? 3 : 2);
|
||||
}
|
||||
default -> throw new AssertionError("Should not reach here");
|
||||
}
|
||||
|
@ -231,10 +231,6 @@ public class Util {
|
||||
return ((AbstractPoolEntry.Utf8EntryImpl) utf8).methodTypeSymbol();
|
||||
}
|
||||
|
||||
public static ClassDesc fieldTypeSymbol(NameAndTypeEntry nat) {
|
||||
return fieldTypeSymbol(nat.type());
|
||||
}
|
||||
|
||||
public static MethodTypeDesc methodTypeSymbol(NameAndTypeEntry nat) {
|
||||
return methodTypeSymbol(nat.type());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user