Unextend InlineCodegen from ParentCodegenAware

This commit is contained in:
Alexander Udalov
2014-05-08 18:40:44 +04:00
parent 13728e1598
commit 22e21b4db0
@@ -57,38 +57,26 @@ import java.util.*;
import static org.jetbrains.jet.codegen.AsmUtil.getMethodAsmFlags; import static org.jetbrains.jet.codegen.AsmUtil.getMethodAsmFlags;
import static org.jetbrains.jet.codegen.AsmUtil.isPrimitive; import static org.jetbrains.jet.codegen.AsmUtil.isPrimitive;
public class InlineCodegen implements ParentCodegenAware, CallGenerator { public class InlineCodegen implements CallGenerator {
private final JetTypeMapper typeMapper;
private final ExpressionCodegen codegen;
private final boolean asFunctionInline;
private final GenerationState state; private final GenerationState state;
private final JetTypeMapper typeMapper;
private final Call call;
private final SimpleFunctionDescriptor functionDescriptor;
private final BindingContext bindingContext; private final BindingContext bindingContext;
private final MethodContext context; private final SimpleFunctionDescriptor functionDescriptor;
private final FrameMap originalFunctionFrame;
private final int initialFrameSize;
private final JvmMethodSignature jvmSignature; private final JvmMethodSignature jvmSignature;
private final Call call;
private final MethodContext context;
private final ExpressionCodegen codegen;
private final FrameMap originalFunctionFrame;
private final boolean asFunctionInline;
private final int initialFrameSize;
private final boolean isSameModule; private final boolean isSameModule;
private LambdaInfo activeLambda;
protected final List<ParameterInfo> actualParameters = new ArrayList<ParameterInfo>(); protected final List<ParameterInfo> actualParameters = new ArrayList<ParameterInfo>();
protected final Map<Integer, LambdaInfo> expressionMap = new HashMap<Integer, LambdaInfo>(); protected final Map<Integer, LambdaInfo> expressionMap = new HashMap<Integer, LambdaInfo>();
private LambdaInfo activeLambda;
public InlineCodegen( public InlineCodegen(
@NotNull ExpressionCodegen codegen, @NotNull ExpressionCodegen codegen,
@NotNull GenerationState state, @NotNull GenerationState state,
@@ -190,7 +178,7 @@ public class InlineCodegen implements ParentCodegenAware, CallGenerator {
new FunctionGenerationStrategy.FunctionDefault(state, new FunctionGenerationStrategy.FunctionDefault(state,
functionDescriptor, functionDescriptor,
(JetDeclarationWithBody) element), (JetDeclarationWithBody) element),
getParentCodegen()); codegen.getParentCodegen());
adapter.visitMaxs(-1, -1); adapter.visitMaxs(-1, -1);
adapter.visitEnd(); adapter.visitEnd();
} }
@@ -408,12 +396,6 @@ public class InlineCodegen implements ParentCodegenAware, CallGenerator {
return result; return result;
} }
@Nullable
@Override
public MemberCodegen<?> getParentCodegen() {
return codegen.getParentCodegen();
}
public static CodegenContext getContext(DeclarationDescriptor descriptor, GenerationState state) { public static CodegenContext getContext(DeclarationDescriptor descriptor, GenerationState state) {
if (descriptor instanceof PackageFragmentDescriptor) { if (descriptor instanceof PackageFragmentDescriptor) {
return new PackageContext((PackageFragmentDescriptor) descriptor, null, null); return new PackageContext((PackageFragmentDescriptor) descriptor, null, null);