diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index cb3ff5bf545..f946587b449 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -2418,7 +2418,7 @@ public class ExpressionCodegen extends JetVisitor implem JetType kFunctionType = bindingContext.get(EXPRESSION_TYPE, expression); assert kFunctionType != null : "Callable reference is not type checked: " + expression.getText(); - ClassDescriptor kFunctionImpl = state.getFunctionTypesUtil().kFunctionTypeToImpl(kFunctionType); + ClassDescriptor kFunctionImpl = state.getJvmFunctionImplTypes().kFunctionTypeToImpl(kFunctionType); assert kFunctionImpl != null : "Impl type is not found for the function type: " + kFunctionType; Type closureSuperClass = typeMapper.mapType(kFunctionImpl); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionTypesUtil.java b/compiler/backend/src/org/jetbrains/jet/codegen/JvmFunctionImplTypes.java similarity index 98% rename from compiler/backend/src/org/jetbrains/jet/codegen/FunctionTypesUtil.java rename to compiler/backend/src/org/jetbrains/jet/codegen/JvmFunctionImplTypes.java index 1ec97232563..daa50761e86 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionTypesUtil.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JvmFunctionImplTypes.java @@ -37,7 +37,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class FunctionTypesUtil { +public class JvmFunctionImplTypes { private final List functions; private final List extensionFunctions; private final List kFunctions; @@ -46,7 +46,7 @@ public class FunctionTypesUtil { private final ImmutableMap kFunctionToImpl; - public FunctionTypesUtil(@NotNull ReflectionTypes reflectionTypes) { + public JvmFunctionImplTypes(@NotNull ReflectionTypes reflectionTypes) { int n = KotlinBuiltIns.FUNCTION_TRAIT_COUNT; functions = new ArrayList(n); extensionFunctions = new ArrayList(n); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java index 39ef24b366d..67ae06229ad 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java @@ -22,7 +22,7 @@ import com.intellij.psi.tree.TokenSet; import com.intellij.util.containers.Stack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.codegen.FunctionTypesUtil; +import org.jetbrains.jet.codegen.JvmFunctionImplTypes; import org.jetbrains.jet.codegen.SamCodegenUtil; import org.jetbrains.jet.codegen.state.GenerationState; import org.jetbrains.jet.lang.descriptors.*; @@ -88,13 +88,13 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { private final BindingTrace bindingTrace; private final BindingContext bindingContext; private final GenerationState.GenerateClassFilter filter; - private final FunctionTypesUtil functionTypesUtil; + private final JvmFunctionImplTypes functionImplTypes; public CodegenAnnotatingVisitor(@NotNull GenerationState state) { this.bindingTrace = state.getBindingTrace(); this.bindingContext = state.getBindingContext(); this.filter = state.getGenerateDeclaredClassFilter(); - this.functionTypesUtil = state.getFunctionTypesUtil(); + this.functionImplTypes = state.getJvmFunctionImplTypes(); } @NotNull @@ -270,7 +270,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { if (functionDescriptor == null) return; String name = inventAnonymousClassName(expression); - JetType superType = functionTypesUtil.getSuperTypeForClosure(functionDescriptor, false); + JetType superType = functionImplTypes.getSuperTypeForClosure(functionDescriptor, false); ClassDescriptor classDescriptor = recordClassForFunction(functionDescriptor, superType); recordClosure(functionLiteral, classDescriptor, name); @@ -319,7 +319,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { ResolvedCall referencedFunction = bindingContext.get(RESOLVED_CALL, expression.getCallableReference()); if (referencedFunction == null) return; JetType superType = - functionTypesUtil.getSuperTypeForClosure((FunctionDescriptor) referencedFunction.getResultingDescriptor(), true); + functionImplTypes.getSuperTypeForClosure((FunctionDescriptor) referencedFunction.getResultingDescriptor(), true); String name = inventAnonymousClassName(expression); ClassDescriptor classDescriptor = recordClassForFunction(functionDescriptor, superType); @@ -373,7 +373,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { } else { String name = inventAnonymousClassName(function); - JetType superType = functionTypesUtil.getSuperTypeForClosure(functionDescriptor, false); + JetType superType = functionImplTypes.getSuperTypeForClosure(functionDescriptor, false); ClassDescriptor classDescriptor = recordClassForFunction(functionDescriptor, superType); recordClosure(function, classDescriptor, name); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/state/GenerationState.java b/compiler/backend/src/org/jetbrains/jet/codegen/state/GenerationState.java index 6261798b28c..c291034c92f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/state/GenerationState.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/state/GenerationState.java @@ -98,7 +98,7 @@ public class GenerationState { @Nullable private List earlierScriptsForReplInterpreter; - private final FunctionTypesUtil functionTypesUtil; + private final JvmFunctionImplTypes functionImplTypes; public GenerationState( @NotNull Project project, @@ -141,7 +141,7 @@ public class GenerationState { this.generateClassFilter = generateClassFilter; ReflectionTypes reflectionTypes = new ReflectionTypes(getAnyModule()); - this.functionTypesUtil = new FunctionTypesUtil(reflectionTypes); + this.functionImplTypes = new JvmFunctionImplTypes(reflectionTypes); } @NotNull @@ -217,13 +217,14 @@ public class GenerationState { return generateNotNullParamAssertions; } + @NotNull public GenerateClassFilter getGenerateDeclaredClassFilter() { return generateClassFilter; } @NotNull - public FunctionTypesUtil getFunctionTypesUtil() { - return functionTypesUtil; + public JvmFunctionImplTypes getJvmFunctionImplTypes() { + return functionImplTypes; } public boolean isInlineEnabled() {