diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayGet.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayGet.java index ac568c4dba7..5d5fec2620b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayGet.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayGet.java @@ -35,7 +35,7 @@ public class ArrayGet implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.java index 286af7926cb..d7dd4134511 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.java @@ -33,7 +33,7 @@ public class ArrayIndices implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.java index e52577724bb..4ec5cd1e39d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.java @@ -45,7 +45,7 @@ public class ArrayIterator implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySet.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySet.java index 33ee99cf7da..e771c6357e1 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySet.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySet.java @@ -35,7 +35,7 @@ public class ArraySet implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySize.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySize.java index f1461d17b16..b9582258d1e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySize.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ArraySize.java @@ -33,7 +33,7 @@ public class ArraySize implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java index a8eb33e5100..702e153f54e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java @@ -43,17 +43,17 @@ public class BinaryOp implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { - boolean nullable = expectedType.getSort() == Type.OBJECT; - assert !nullable : "Return type of BinaryOp intrinsic should be of primitive type : " + expectedType; + boolean nullable = returnType.getSort() == Type.OBJECT; + assert !nullable : "Return type of BinaryOp intrinsic should be of primitive type : " + returnType; - Type operandType = numberFunctionOperandType(expectedType); + Type operandType = numberFunctionOperandType(returnType); if (arguments.size() == 1) { // Intrinsic is called as an ordinary function @@ -66,9 +66,9 @@ public class BinaryOp implements IntrinsicMethod { codegen.gen(arguments.get(0), operandType); codegen.gen(arguments.get(1), shift() ? Type.INT_TYPE : operandType); } - v.visitInsn(expectedType.getOpcode(opcode)); + v.visitInsn(returnType.getOpcode(opcode)); - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } private boolean shift() { diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CompareTo.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CompareTo.java index 72742603ede..4d7188a848c 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CompareTo.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CompareTo.java @@ -35,7 +35,7 @@ public class CompareTo implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Concat.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Concat.java index 3f3d8e9ce59..a00fec81ae5 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Concat.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Concat.java @@ -36,7 +36,7 @@ public class Concat implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @@ -51,12 +51,12 @@ public class Concat implements IntrinsicMethod { receiver.put(AsmTypeConstants.OBJECT_TYPE, v); genStringBuilderConstructor(v); v.swap(); // StringBuilder LHS - genInvokeAppendMethod(v, expectedType); // StringBuilder(LHS) + genInvokeAppendMethod(v, returnType); // StringBuilder(LHS) codegen.invokeAppend(arguments.get(0)); } v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;"); - StackValue.onStack(AsmTypeConstants.JAVA_STRING_TYPE).put(expectedType, v); - return StackValue.onStack(expectedType); + StackValue.onStack(AsmTypeConstants.JAVA_STRING_TYPE).put(returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CopyToArray.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CopyToArray.java index dceb3edeb10..aac98b6a383 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CopyToArray.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/CopyToArray.java @@ -17,7 +17,7 @@ public class CopyToArray implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, @Nullable StackValue receiver, @@ -28,11 +28,11 @@ public class CopyToArray implements IntrinsicMethod { v.dup(); v.invokeinterface("java/util/Collection", "size", "()I"); - v.newarray(expectedType.getElementType()); + v.newarray(returnType.getElementType()); v.invokeinterface("java/util/Collection", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;"); - StackValue.coerce(Type.getType("[Ljava/lang/Object;"), expectedType, v); + StackValue.coerce(Type.getType("[Ljava/lang/Object;"), returnType, v); - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumName.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumName.java index 407c3244b8e..02a7dcd0fae 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumName.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumName.java @@ -34,7 +34,7 @@ public class EnumName implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @@ -42,7 +42,7 @@ public class EnumName implements IntrinsicMethod { ) { receiver.put(AsmTypeConstants.OBJECT_TYPE, v); v.invokevirtual("java/lang/Enum", "name", "()Ljava/lang/String;"); - StackValue.onStack(AsmTypeConstants.JAVA_STRING_TYPE).put(expectedType, v); - return StackValue.onStack(expectedType); + StackValue.onStack(AsmTypeConstants.JAVA_STRING_TYPE).put(returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumOrdinal.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumOrdinal.java index 5ff1491b0a1..dd67454e3ef 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumOrdinal.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/EnumOrdinal.java @@ -34,7 +34,7 @@ public class EnumOrdinal implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @@ -42,7 +42,7 @@ public class EnumOrdinal implements IntrinsicMethod { ) { receiver.put(AsmTypeConstants.OBJECT_TYPE, v); v.invokevirtual("java/lang/Enum", "ordinal", "()I"); - StackValue.onStack(Type.INT_TYPE).put(expectedType, v); - return StackValue.onStack(expectedType); + StackValue.onStack(Type.INT_TYPE).put(returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Equals.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Equals.java index acbd58616c2..90748cb6d30 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Equals.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Equals.java @@ -37,7 +37,7 @@ public class Equals implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/HashCode.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/HashCode.java index cc3763f28eb..48488af9785 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/HashCode.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/HashCode.java @@ -35,7 +35,7 @@ public class HashCode implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IdentityEquals.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IdentityEquals.java index e7703c3af9c..be342c3036a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IdentityEquals.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IdentityEquals.java @@ -37,7 +37,7 @@ public class IdentityEquals implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Increment.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Increment.java index 76fc8cd71c0..d4e984aaec6 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Increment.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Increment.java @@ -43,21 +43,21 @@ public class Increment implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { - boolean nullable = expectedType.getSort() == Type.OBJECT; - assert !nullable : "Return type of Increment intrinsic should be of primitive type : " + expectedType; + boolean nullable = returnType.getSort() == Type.OBJECT; + assert !nullable : "Return type of Increment intrinsic should be of primitive type : " + returnType; if (arguments.size() > 0) { JetExpression operand = arguments.get(0); while (operand instanceof JetParenthesizedExpression) { operand = ((JetParenthesizedExpression) operand).getExpression(); } - if (operand instanceof JetReferenceExpression && expectedType == Type.INT_TYPE) { + if (operand instanceof JetReferenceExpression && returnType == Type.INT_TYPE) { int index = codegen.indexOfLocal((JetReferenceExpression) operand); if (index >= 0) { return StackValue.preIncrement(index, myDelta); @@ -67,15 +67,15 @@ public class Increment implements IntrinsicMethod { value.dupReceiver(v); value.dupReceiver(v); - value.put(expectedType, v); - genIncrement(expectedType, myDelta, v); - value.store(expectedType, v); - value.put(expectedType, v); + value.put(returnType, v); + genIncrement(returnType, myDelta, v); + value.store(returnType, v); + value.put(returnType, v); } else { - receiver.put(expectedType, v); - genIncrement(expectedType, myDelta, v); + receiver.put(returnType, v); + genIncrement(returnType, myDelta, v); } - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.java index d294d523c57..b3e0b878d3d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.java @@ -31,7 +31,7 @@ import java.util.List; public interface IntrinsicMethod extends Callable { StackValue generate( - ExpressionCodegen codegen, InstructionAdapter v, @NotNull Type expectedType, @Nullable PsiElement element, + ExpressionCodegen codegen, InstructionAdapter v, @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, @Nullable StackValue receiver, @NotNull GenerationState state ); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Inv.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Inv.java index 2b3fa41dafa..12793c76259 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Inv.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Inv.java @@ -35,23 +35,23 @@ public class Inv implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { - boolean nullable = expectedType.getSort() == Type.OBJECT; - assert !nullable : "Return type of Inv intrinsic should be of primitive type : " + expectedType; + boolean nullable = returnType.getSort() == Type.OBJECT; + assert !nullable : "Return type of Inv intrinsic should be of primitive type : " + returnType; - receiver.put(numberFunctionOperandType(expectedType), v); - if (expectedType == Type.LONG_TYPE) { + receiver.put(numberFunctionOperandType(returnType), v); + if (returnType == Type.LONG_TYPE) { v.lconst(-1L); } else { v.iconst(-1); } - v.xor(expectedType); - return StackValue.onStack(expectedType); + v.xor(returnType); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.java index 1482fba1dc3..57019b46205 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.java @@ -33,7 +33,7 @@ public class IteratorIterator implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorNext.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorNext.java index 87a4b7a7048..e9110b11be7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorNext.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IteratorNext.java @@ -33,42 +33,42 @@ public class IteratorNext implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { String name; - if (expectedType == Type.CHAR_TYPE) { + if (returnType == Type.CHAR_TYPE) { name = "Char"; } - else if (expectedType == Type.BOOLEAN_TYPE) { + else if (returnType == Type.BOOLEAN_TYPE) { name = "Boolean"; } - else if (expectedType == Type.BYTE_TYPE) { + else if (returnType == Type.BYTE_TYPE) { name = "Byte"; } - else if (expectedType == Type.SHORT_TYPE) { + else if (returnType == Type.SHORT_TYPE) { name = "Short"; } - else if (expectedType == Type.INT_TYPE) { + else if (returnType == Type.INT_TYPE) { name = "Int"; } - else if (expectedType == Type.LONG_TYPE) { + else if (returnType == Type.LONG_TYPE) { name = "Long"; } - else if (expectedType == Type.FLOAT_TYPE) { + else if (returnType == Type.FLOAT_TYPE) { name = "Float"; } - else if (expectedType == Type.DOUBLE_TYPE) { + else if (returnType == Type.DOUBLE_TYPE) { name = "Double"; } else { throw new UnsupportedOperationException(); } receiver.put(AsmTypeConstants.OBJECT_TYPE, v); - v.invokevirtual("jet/" + name + "Iterator", "next" + name, "()" + expectedType.getDescriptor()); - return StackValue.onStack(expectedType); + v.invokevirtual("jet/" + name + "Iterator", "next" + name, "()" + returnType.getDescriptor()); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java index 9257f551700..d12bf477242 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java @@ -41,7 +41,7 @@ public class JavaClassArray implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @@ -52,6 +52,6 @@ public class JavaClassArray implements IntrinsicMethod { assert call != null; Map.Entry next = call.getValueArguments().entrySet().iterator().next(); codegen.genVarargs(next.getKey(), (VarargValueArgument) next.getValue()); - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassProperty.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassProperty.java index bca2dc38d7e..a62772bb979 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassProperty.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassProperty.java @@ -37,7 +37,7 @@ public class JavaClassProperty implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NewArray.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NewArray.java index 61a1e442f62..5b46d33ce78 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NewArray.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NewArray.java @@ -33,13 +33,13 @@ public class NewArray implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { codegen.generateNewArray((JetCallExpression) element); - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Not.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Not.java index 012ee122f75..2bc44aee264 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Not.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Not.java @@ -32,7 +32,7 @@ public class Not implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NumberCast.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NumberCast.java index 9741ee13cb5..bc255578516 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NumberCast.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/NumberCast.java @@ -32,13 +32,13 @@ public class NumberCast implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { - receiver.put(expectedType, v); - return StackValue.onStack(expectedType); + receiver.put(returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/PropertyOfProgressionOrRange.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/PropertyOfProgressionOrRange.java index a0efd2c4383..aaa3dadb05b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/PropertyOfProgressionOrRange.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/PropertyOfProgressionOrRange.java @@ -46,19 +46,19 @@ public class PropertyOfProgressionOrRange implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { String ownerInternalName = JvmClassName.byFqNameWithoutInnerClasses(this.ownerClass).getInternalName(); - Type boxedType = boxType(expectedType); + Type boxedType = boxType(returnType); String getterName = PropertyCodegen.getterName(propertyName); receiver.put(receiver.type, v); v.invokevirtual(ownerInternalName, getterName, "()" + boxedType.getDescriptor()); - StackValue.coerce(boxedType, expectedType, v); - return StackValue.onStack(expectedType); + StackValue.coerce(boxedType, returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/RangeTo.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/RangeTo.java index 63ac5769416..1e72407aed4 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/RangeTo.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/RangeTo.java @@ -37,7 +37,7 @@ public class RangeTo implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @@ -49,8 +49,8 @@ public class RangeTo implements IntrinsicMethod { receiver.put(leftType, v); codegen.gen(arguments.get(0), rightType); v.invokestatic("jet/runtime/Ranges", "rangeTo", - "(" + receiver.type.getDescriptor() + leftType.getDescriptor() + ")" + expectedType.getDescriptor()); - return StackValue.onStack(expectedType); + "(" + receiver.type.getDescriptor() + leftType.getDescriptor() + ")" + returnType.getDescriptor()); + return StackValue.onStack(returnType); } else { JetBinaryExpression expression = (JetBinaryExpression) element; @@ -60,8 +60,8 @@ public class RangeTo implements IntrinsicMethod { codegen.gen(expression.getLeft(), leftType); codegen.gen(expression.getRight(), rightType); v.invokestatic("jet/runtime/Ranges", "rangeTo", - "(" + leftType.getDescriptor() + rightType.getDescriptor() + ")" + expectedType.getDescriptor()); - return StackValue.onStack(expectedType); + "(" + leftType.getDescriptor() + rightType.getDescriptor() + ")" + returnType.getDescriptor()); + return StackValue.onStack(returnType); // } // else { // throw new UnsupportedOperationException("ranges are only supported for int objects"); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StaticField.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StaticField.java index 034e0ba3f85..3fa0b9e3581 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StaticField.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StaticField.java @@ -45,13 +45,13 @@ public class StaticField implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @NotNull GenerationState state ) { - v.getstatic(JvmClassName.byFqNameWithoutInnerClasses(ownerClass).getInternalName(), propertyName.asString(), expectedType.getDescriptor()); - return StackValue.onStack(expectedType); + v.getstatic(JvmClassName.byFqNameWithoutInnerClasses(ownerClass).getInternalName(), propertyName.asString(), returnType.getDescriptor()); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringGetChar.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringGetChar.java index 11bdefea5a9..d1b674d3156 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringGetChar.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringGetChar.java @@ -33,7 +33,7 @@ public class StringGetChar implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringLength.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringLength.java index a7cd15accfc..a552636e661 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringLength.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringLength.java @@ -33,7 +33,7 @@ public class StringLength implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringPlus.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringPlus.java index f326b20e643..bd6d35fbd04 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringPlus.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StringPlus.java @@ -33,7 +33,7 @@ public class StringPlus implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java index cc27442005f..4332db0efe3 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java @@ -36,7 +36,7 @@ public class StupidSync implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @@ -44,7 +44,7 @@ public class StupidSync implements IntrinsicMethod { ) { codegen.pushMethodArguments((JetCallExpression) element, Arrays.asList(AsmTypeConstants.OBJECT_TYPE, AsmTypeConstants.JET_FUNCTION0_TYPE)); v.invokestatic("jet/runtime/Intrinsics", "stupidSync", "(Ljava/lang/Object;Ljet/Function0;)Ljava/lang/Object;"); - StackValue.onStack(AsmTypeConstants.OBJECT_TYPE).put(expectedType, v); - return StackValue.onStack(expectedType); + StackValue.onStack(AsmTypeConstants.OBJECT_TYPE).put(returnType, v); + return StackValue.onStack(returnType); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ToString.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ToString.java index be44473606d..0d4da041a5b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ToString.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/ToString.java @@ -34,7 +34,7 @@ public class ToString implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.java index 52029eee0b1..726fc4c695e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.java @@ -36,16 +36,16 @@ public class UnaryMinus implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, PsiElement element, List arguments, StackValue receiver, @NotNull GenerationState state ) { - boolean nullable = expectedType.getSort() == Type.OBJECT; - assert !nullable : "Return type of UnaryMinus intrinsic should be of primitive type : " + expectedType; + boolean nullable = returnType.getSort() == Type.OBJECT; + assert !nullable : "Return type of UnaryMinus intrinsic should be of primitive type : " + returnType; - Type operandType = numberFunctionOperandType(expectedType); + Type operandType = numberFunctionOperandType(returnType); if (arguments.size() == 1) { codegen.gen(arguments.get(0), operandType); @@ -53,6 +53,6 @@ public class UnaryMinus implements IntrinsicMethod { else { receiver.put(operandType, v); } - return StackValue.onStack(genNegate(expectedType, v)); + return StackValue.onStack(genNegate(returnType, v)); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.java index a134169d3a7..7677a28e6bd 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.java @@ -35,22 +35,22 @@ public class UnaryPlus implements IntrinsicMethod { public StackValue generate( ExpressionCodegen codegen, InstructionAdapter v, - @NotNull Type expectedType, + @NotNull Type returnType, @Nullable PsiElement element, @Nullable List arguments, StackValue receiver, @NotNull GenerationState state ) { - boolean nullable = expectedType.getSort() == Type.OBJECT; - assert !nullable : "Return type of UnaryPlus intrinsic should be of primitive type : " + expectedType; + boolean nullable = returnType.getSort() == Type.OBJECT; + assert !nullable : "Return type of UnaryPlus intrinsic should be of primitive type : " + returnType; if (receiver != null && receiver != StackValue.none()) { - receiver.put(expectedType, v); + receiver.put(returnType, v); } else { assert arguments != null; - codegen.gen(arguments.get(0), expectedType); + codegen.gen(arguments.get(0), returnType); } - return StackValue.onStack(expectedType); + return StackValue.onStack(returnType); } }