Example #1
0
 public static StackValue genToString(
     InstructionAdapter v, StackValue receiver, Type receiverType) {
   Type type = stringValueOfOrStringBuilderAppendType(receiverType);
   receiver.put(type, v);
   v.invokestatic(
       "java/lang/String", "valueOf", "(" + type.getDescriptor() + ")Ljava/lang/String;");
   return StackValue.onStack(JAVA_STRING_TYPE);
 }
Example #2
0
  public static StackValue genEqualsForExpressionsOnStack(
      InstructionAdapter v, IElementType opToken, Type leftType, Type rightType) {
    if ((isNumberPrimitive(leftType) || leftType.getSort() == Type.BOOLEAN)
        && leftType == rightType) {
      return StackValue.cmp(opToken, leftType);
    } else {
      if (opToken == JetTokens.EQEQEQ || opToken == JetTokens.EXCLEQEQEQ) {
        return StackValue.cmp(opToken, leftType);
      } else {
        v.invokestatic(
            "jet/runtime/Intrinsics", "areEqual", "(Ljava/lang/Object;Ljava/lang/Object;)Z");

        if (opToken == JetTokens.EXCLEQ || opToken == JetTokens.EXCLEQEQEQ) {
          genInvertBoolean(v);
        }

        return StackValue.onStack(Type.BOOLEAN_TYPE);
      }
    }
  }