Minor, don't do unnecessary mapType

This commit is contained in:
Alexander Udalov
2013-12-04 21:07:08 +04:00
parent fb370a4538
commit 7453af9f36
2 changed files with 2 additions and 28 deletions
@@ -2486,22 +2486,6 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
this.resolvedCall = resolvedCall;
}
@NotNull
@Override
public ExpressionCodegen initializeExpressionCodegen(
JvmMethodSignature signature,
MethodContext context,
MethodVisitor mv,
Type returnType,
MemberCodegen parentCodegen
) {
FunctionDescriptor referencedFunction = (FunctionDescriptor) resolvedCall.getResultingDescriptor();
JetType returnJetType = referencedFunction.getReturnType();
assert returnJetType != null : "Return type can't be null: " + referencedFunction;
return super.initializeExpressionCodegen(signature, context, mv, state.getTypeMapper().mapReturnType(returnJetType), parentCodegen);
}
@Override
public void doGenerateBody(@NotNull ExpressionCodegen codegen, @NotNull JvmMethodSignature signature) {
/*
@@ -102,24 +102,14 @@ public abstract class FunctionGenerationStrategy {
@NotNull MethodContext context,
@Nullable MemberCodegen parentCodegen
) {
ExpressionCodegen codegen = initializeExpressionCodegen(signature, context, mv, signature.getAsmMethod().getReturnType(), parentCodegen);
ExpressionCodegen codegen = new ExpressionCodegen(mv, getFrameMap(state.getTypeMapper(), context),
signature.getAsmMethod().getReturnType(), context, state, parentCodegen);
doGenerateBody(codegen, signature);
generateLocalVarNames(codegen);
}
abstract public void doGenerateBody(@NotNull ExpressionCodegen codegen, @NotNull JvmMethodSignature signature);
@NotNull
public ExpressionCodegen initializeExpressionCodegen(
JvmMethodSignature signature,
MethodContext context,
MethodVisitor mv,
Type returnType,
MemberCodegen parentCodegen
) {
return new ExpressionCodegen(mv, getFrameMap(state.getTypeMapper(), context), returnType, context, state, parentCodegen);
}
public void generateLocalVarNames(@NotNull ExpressionCodegen codegen) {
for (String name : codegen.getLocalVariableNamesForExpression()) {
addLocalVariableName(name);