Code rearrangment
This commit is contained in:
@@ -3091,7 +3091,8 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
throw new UnsupportedOperationException("Unsupported postfix operation: " + op);
|
throw new UnsupportedOperationException("Unsupported postfix operation: " + op);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPrimitiveNumberClassDescriptor(cls)) {
|
boolean isPrimitiveNumberClassDescriptor = isPrimitiveNumberClassDescriptor(cls);
|
||||||
|
if (isPrimitiveNumberClassDescriptor) {
|
||||||
JetExpression operand = expression.getBaseExpression();
|
JetExpression operand = expression.getBaseExpression();
|
||||||
if (operand instanceof JetReferenceExpression && asmType == Type.INT_TYPE) {
|
if (operand instanceof JetReferenceExpression && asmType == Type.INT_TYPE) {
|
||||||
int index = indexOfLocal((JetReferenceExpression) operand);
|
int index = indexOfLocal((JetReferenceExpression) operand);
|
||||||
@@ -3099,39 +3100,32 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
return StackValue.postIncrement(index, increment);
|
return StackValue.postIncrement(index, increment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StackValue value = gen(expression.getBaseExpression());
|
}
|
||||||
value.dupReceiver(v);
|
|
||||||
|
|
||||||
Type type = expressionType(expression.getBaseExpression());
|
StackValue value = gen(expression.getBaseExpression());
|
||||||
value.put(type, v);
|
value.dupReceiver(v);
|
||||||
|
|
||||||
pushReceiverAndValueViaDup(value, type);
|
Type type = expressionType(expression.getBaseExpression());
|
||||||
|
value.put(type, v); // old value
|
||||||
|
|
||||||
|
pushReceiverAndValueViaDup(value, type); // receiver and new value
|
||||||
|
|
||||||
|
Type storeType;
|
||||||
|
if (isPrimitiveNumberClassDescriptor) {
|
||||||
genIncrement(asmType, increment, v);
|
genIncrement(asmType, increment, v);
|
||||||
value.store(asmType, v);
|
storeType = type;
|
||||||
return StackValue.onStack(asmType); // old value
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ResolvedCall<? extends CallableDescriptor> resolvedCall =
|
ResolvedCall<? extends CallableDescriptor> resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference());
|
||||||
bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference());
|
|
||||||
assert resolvedCall != null;
|
assert resolvedCall != null;
|
||||||
|
|
||||||
Callable callable = resolveToCallable((FunctionDescriptor) op, false);
|
Callable callable = resolveToCallable((FunctionDescriptor) op, false);
|
||||||
|
|
||||||
StackValue value = gen(expression.getBaseExpression());
|
|
||||||
value.dupReceiver(v);
|
|
||||||
|
|
||||||
Type type = expressionType(expression.getBaseExpression());
|
|
||||||
value.put(type, v);
|
|
||||||
|
|
||||||
pushReceiverAndValueViaDup(value, type);
|
|
||||||
|
|
||||||
CallableMethod callableMethod = (CallableMethod) callable;
|
CallableMethod callableMethod = (CallableMethod) callable;
|
||||||
callableMethod.invokeWithNotNullAssertion(v, state, resolvedCall);
|
callableMethod.invokeWithNotNullAssertion(v, state, resolvedCall);
|
||||||
|
storeType = callableMethod.getReturnType();
|
||||||
value.store(callableMethod.getReturnType(), v);
|
|
||||||
return StackValue.onStack(type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value.store(storeType, v);
|
||||||
|
return StackValue.onStack(asmType); // old value
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pushReceiverAndValueViaDup(StackValue value, Type type) {
|
private void pushReceiverAndValueViaDup(StackValue value, Type type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user