mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 08:38:03 +00:00
accurately depicted stack size
This commit is contained in:
parent
02039a5334
commit
acf7b4eff8
@ -98,7 +98,7 @@ public class TypedAssignment implements TypedStatement {
|
||||
}
|
||||
ctx.getMv().visitFieldInsn(Opcodes.PUTFIELD, receiver, location.getName(), value.getType().getDescriptor());
|
||||
System.out.println("PUTFIELD: " + receiver + " " + location.getName() + " " + value.getType().getDescriptor());
|
||||
|
||||
ctx.popStack();
|
||||
} else {
|
||||
if(value.getType().getKind() == Type.Kind.REFERENCE) {
|
||||
System.out.println("ASTORE " + ctx.getLocalVar(location.getName()).get().index());
|
||||
@ -115,5 +115,8 @@ public class TypedAssignment implements TypedStatement {
|
||||
location.getRecursiveOwnerChain().codeGen(ctx);
|
||||
ctx.pushAnonToStack();
|
||||
}
|
||||
if (location.getRecursiveOwnerChain() == null && location.getField()) {
|
||||
ctx.pushStack("this");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,13 +47,15 @@ public class TypedReturn implements TypedStatement {
|
||||
public void codeGen(MethodContext ctx) {
|
||||
if (ret == null) {
|
||||
ctx.getMv().visitInsn(Opcodes.RETURN);
|
||||
System.out.println("RETURN");
|
||||
} else {
|
||||
System.out.println("return: " + ret);
|
||||
ret.codeGen(ctx);
|
||||
if (ret.getType().getKind() != Type.Kind.REFERENCE) {
|
||||
ctx.getMv().visitInsn(Opcodes.IRETURN);
|
||||
System.out.println("IRETURN");
|
||||
} else {
|
||||
ctx.getMv().visitInsn(Opcodes.ARETURN);
|
||||
System.out.println("ARETURN");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
public class ClassCanBeBytecoded {
|
||||
public ClassCanBeBytecoded c;
|
||||
public ClassCanBeBytecoded() {
|
||||
}
|
||||
|
||||
@ -15,6 +16,7 @@ public class ClassCanBeBytecoded {
|
||||
ClassCanBeBytecoded c;
|
||||
c = new ClassCanBeBytecoded(result);
|
||||
result = var1 + var1;
|
||||
this.c = c;
|
||||
return c;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user