mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8338623: StackCounter adding extraneous slots for receiver invoke instructions
Reviewed-by: asotona
This commit is contained in:
parent
bc2700b7dc
commit
b442003048
2 changed files with 33 additions and 5 deletions
|
@ -313,13 +313,14 @@ public final class StackCounter {
|
|||
var cpe = cp.entryByIndex(bcs.getIndexU2());
|
||||
var nameAndType = opcode == INVOKEDYNAMIC ? ((DynamicConstantPoolEntry)cpe).nameAndType() : ((MemberRefEntry)cpe).nameAndType();
|
||||
var mtd = Util.methodTypeSymbol(nameAndType);
|
||||
addStackSlot(Util.slotSize(mtd.returnType()) - Util.parameterSlots(mtd));
|
||||
var delta = Util.slotSize(mtd.returnType()) - Util.parameterSlots(mtd);
|
||||
if (opcode != INVOKESTATIC && opcode != INVOKEDYNAMIC) {
|
||||
addStackSlot(-1);
|
||||
delta--;
|
||||
}
|
||||
addStackSlot(delta);
|
||||
}
|
||||
case MULTIANEWARRAY ->
|
||||
addStackSlot (1 - bcs.getU1(bcs.bci + 3));
|
||||
addStackSlot(1 - bcs.getU1(bcs.bci + 3));
|
||||
case JSR -> {
|
||||
addStackSlot(+1);
|
||||
jump(bcs.dest()); //here we lost track of the exact stack size after return from subroutine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue