controller.getCallSiteWriter().makeInvocation(receiver, message, arguments);
compileStack.popLHS();
}
protected void evaluateBinaryExpressionWithAssignment(String method, BinaryExpression expression) {
Expression leftExpression = expression.getLeftExpression();
MethodVisitor mv = controller.getMethodVisitor();
AsmClassGenerator acg = controller.getAcg();
OperandStack operandStack = controller.getOperandStack();
CompileStack compileStack = controller.getCompileStack();
if (leftExpression instanceof BinaryExpression) {
BinaryExpression leftBinExpr = (BinaryExpression) leftExpression;
if (leftBinExpr.getOperation().getType() == Types.LEFT_SQUARE_BRACKET) {
// e.g. x[a] += b
// -> subscript=a, x[subscript], =, x[subscript] + b
// -> subscript=a, methodCall_3(x, "putAt", [subscript, methodCall_2(methodCall_1(x, "getAt", [subscript]), "plus", b)])
Expression subscriptExpression = leftBinExpr.getRightExpression();
subscriptExpression.visit(acg); // value(subscript)
operandStack.box();
int subscriptValueId = compileStack.defineTemporaryVariable("$subscript", ClassHelper.OBJECT_TYPE, true);
// method calls from outer to inner (most inner will be called first):
controller.getCallSiteWriter().prepareCallSite("putAt");