From 2d9674089cf0bec504a085731b4f9161c9805fe4 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Fri, 21 Feb 2014 12:49:55 +0400 Subject: [PATCH] Support operatorAssign expressions in inline --- .../jetbrains/jet/codegen/ExpressionCodegen.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 6c79eb72c6c..9bf4427e93f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -3007,9 +3007,13 @@ public class ExpressionCodegen extends JetVisitor implem } private void callAugAssignMethod(JetBinaryExpression expression, CallableMethod callable, Type lhsType, boolean keepReturnValue) { + JetSimpleNameExpression reference = expression.getOperationReference(); ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); - assert resolvedCall != null; + bindingContext.get(BindingContext.RESOLVED_CALL, reference); + Call call = bindingContext.get(BindingContext.CALL, reference); + + assert resolvedCall != null : "Resolved call should be not null for operation reference in " + expression.getText(); + assert call != null : "Call should be not null for operation reference in " + expression.getText(); StackValue value = gen(expression.getLeft()); if (keepReturnValue) { @@ -3018,12 +3022,7 @@ public class ExpressionCodegen extends JetVisitor implem value.put(lhsType, v); StackValue receiver = StackValue.onStack(lhsType); - if (!(resolvedCall.getResultingDescriptor() instanceof ConstructorDescriptor)) { // otherwise already - receiver = StackValue.receiver(resolvedCall, receiver, this, callable); - receiver.put(receiver.type, v); - } - - pushArgumentsAndInvoke(resolvedCall, callable, CallGenerator.NOT_INLINE); + invokeMethodWithArguments(call, callable, resolvedCall, receiver); if (keepReturnValue) { value.store(callable.getReturnType(), v);