master
Sanjar Ahmadov 4 years ago
parent 82829cb601
commit 4d97a84bce

@ -363,6 +363,9 @@ public class CodeGenImpl extends CodeGenBase
int slotNum = argNum + 1; // We have extra slot for static link int slotNum = argNum + 1; // We have extra slot for static link
Expr expr = args.get(i); Expr expr = args.get(i);
expr.dispatch(this); expr.dispatch(this);
// FIXME: Box primitives here
// All expressions should save their end result in A0 // All expressions should save their end result in A0
// So, once expr is evaluated add value inside A0 onto stack as an argument // So, once expr is evaluated add value inside A0 onto stack as an argument
backend.emitSW(A0, SP, -wordSize*slotNum, "Push argument " + argNum + " from left"); backend.emitSW(A0, SP, -wordSize*slotNum, "Push argument " + argNum + " from left");
@ -690,12 +693,6 @@ public class CodeGenImpl extends CodeGenBase
backend.emitLW(T6, FP, 0, "Inside IntegerLiteral: " + node.value); backend.emitLW(T6, FP, 0, "Inside IntegerLiteral: " + node.value);
backend.emitLI(A0, node.value, "Load integer literal " + node.value); backend.emitLI(A0, node.value, "Load integer literal " + node.value);
backend.emitJAL(makeIntLabel, "Box integer"); backend.emitJAL(makeIntLabel, "Box integer");
// System.out.println("+++ Inside IntegerLiteral");
// backend.emitLA(A0, new Label("$int$prototype"), "Load prototype");
// backend.emitJAL(new Label("ra, alloc"), "");
// backend.emitLI(T0, node.value, "Load integer " + node.value);
// backend.emitSW(T0, A0, "@.__int__", null);
return A0; return A0;
} }

Loading…
Cancel
Save