From 8f337cbd7c1088e95c5d6f5458feca1e7b7adaa6 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 17 Sep 2012 15:48:02 +0400 Subject: [PATCH] Removed 'sure' intrinsic method. --- .../codegen/intrinsics/IntrinsicMethods.java | 1 - .../jet/codegen/intrinsics/Sure.java | 67 ------------------- 2 files changed, 68 deletions(-) delete mode 100644 compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Sure.java diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java index ed4749b5556..5dc152adcac 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java @@ -127,7 +127,6 @@ public class IntrinsicMethods { intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("identityEquals"), 1, IDENTITY_EQUALS); intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("plus"), 1, STRING_PLUS); intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("arrayOfNulls"), 1, new NewArray()); - intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("sure"), 0, new Sure()); intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("synchronized"), 2, new StupidSync()); intrinsicsMap.registerIntrinsic(JetStandardClasses.STANDARD_CLASSES_FQNAME, Name.identifier("iterator"), 0, new IteratorIterator()); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Sure.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Sure.java deleted file mode 100644 index 537af1349a4..00000000000 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Sure.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.codegen.intrinsics; - -import com.intellij.psi.PsiElement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.asm4.Label; -import org.jetbrains.asm4.Type; -import org.jetbrains.asm4.commons.InstructionAdapter; -import org.jetbrains.jet.codegen.ExpressionCodegen; -import org.jetbrains.jet.codegen.StackValue; -import org.jetbrains.jet.codegen.state.GenerationState; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; -import org.jetbrains.jet.lang.psi.JetCallExpression; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; - -import java.util.List; - -/** - * @author alex.tkachman - */ -public class Sure implements IntrinsicMethod { - @Override - public StackValue generate( - ExpressionCodegen codegen, - InstructionAdapter v, - @NotNull Type expectedType, - PsiElement element, - List arguments, - StackValue receiver, - @NotNull GenerationState state - ) { - JetCallExpression call = (JetCallExpression) element; - ResolvedCall resolvedCall = - codegen.getBindingContext().get(BindingContext.RESOLVED_CALL, call.getCalleeExpression()); - assert resolvedCall != null; - if (resolvedCall.getReceiverArgument().getType().isNullable()) { - receiver.put(receiver.type, v); - v.dup(); - Label ok = new Label(); - v.ifnonnull(ok); - v.invokestatic("jet/runtime/Intrinsics", "throwNpe", "()V"); - v.mark(ok); - StackValue.onStack(receiver.type).put(expectedType, v); - } - else { - codegen.generateFromResolvedCall(resolvedCall.getReceiverArgument(), expectedType); - } - return StackValue.onStack(expectedType); - } -}