Minor, rename local variable

This commit is contained in:
Alexander Udalov
2014-08-13 16:07:03 +04:00
parent 844845c6e3
commit 6e46bea821
@@ -140,15 +140,15 @@ public class ScriptCodegen extends MemberCodegen<JetScript> {
mv.visitCode(); mv.visitCode();
final InstructionAdapter instructionAdapter = new InstructionAdapter(mv); final InstructionAdapter iv = new InstructionAdapter(mv);
Type classType = bindingContext.get(ASM_TYPE, classDescriptorForScript); Type classType = bindingContext.get(ASM_TYPE, classDescriptorForScript);
assert classType != null; assert classType != null;
instructionAdapter.load(0, classType); iv.load(0, classType);
instructionAdapter.invokespecial("java/lang/Object", "<init>", "()V", false); iv.invokespecial("java/lang/Object", "<init>", "()V", false);
instructionAdapter.load(0, classType); iv.load(0, classType);
final FrameMap frameMap = new FrameMap(); final FrameMap frameMap = new FrameMap();
frameMap.enterTemp(OBJECT_TYPE); frameMap.enterTemp(OBJECT_TYPE);
@@ -168,7 +168,7 @@ public class ScriptCodegen extends MemberCodegen<JetScript> {
generateInitializers(new Function0<ExpressionCodegen>() { generateInitializers(new Function0<ExpressionCodegen>() {
@Override @Override
public ExpressionCodegen invoke() { public ExpressionCodegen invoke() {
return new ExpressionCodegen(instructionAdapter, frameMap, Type.VOID_TYPE, methodContext, state, ScriptCodegen.this); return new ExpressionCodegen(iv, frameMap, Type.VOID_TYPE, methodContext, state, ScriptCodegen.this);
} }
}); });
@@ -176,29 +176,28 @@ public class ScriptCodegen extends MemberCodegen<JetScript> {
for (ScriptDescriptor earlierScript : context.getEarlierScripts()) { for (ScriptDescriptor earlierScript : context.getEarlierScripts()) {
Type earlierClassType = asmTypeForScriptDescriptor(bindingContext, earlierScript); Type earlierClassType = asmTypeForScriptDescriptor(bindingContext, earlierScript);
instructionAdapter.load(0, classType); iv.load(0, classType);
instructionAdapter.load(offset, earlierClassType); iv.load(offset, earlierClassType);
offset += earlierClassType.getSize(); offset += earlierClassType.getSize();
instructionAdapter.putfield(classType.getInternalName(), context.getScriptFieldName(earlierScript), earlierClassType.getDescriptor()); iv.putfield(classType.getInternalName(), context.getScriptFieldName(earlierScript), earlierClassType.getDescriptor());
} }
for (ValueParameterDescriptor parameter : scriptDescriptor.getScriptCodeDescriptor().getValueParameters()) { for (ValueParameterDescriptor parameter : scriptDescriptor.getScriptCodeDescriptor().getValueParameters()) {
Type parameterType = typeMapper.mapType(parameter.getType()); Type parameterType = typeMapper.mapType(parameter.getType());
instructionAdapter.load(0, classType); iv.load(0, classType);
instructionAdapter.load(offset, parameterType); iv.load(offset, parameterType);
offset += parameterType.getSize(); offset += parameterType.getSize();
instructionAdapter.putfield(classType.getInternalName(), parameter.getName().getIdentifier(), parameterType.getDescriptor()); iv.putfield(classType.getInternalName(), parameter.getName().getIdentifier(), parameterType.getDescriptor());
} }
StackValue stackValue = StackValue stackValue =
new ExpressionCodegen(mv, frameMap, Type.VOID_TYPE, methodContext, state, this).gen(scriptDeclaration.getBlockExpression()); new ExpressionCodegen(mv, frameMap, Type.VOID_TYPE, methodContext, state, this).gen(scriptDeclaration.getBlockExpression());
if (stackValue.type != Type.VOID_TYPE) { if (stackValue.type != Type.VOID_TYPE) {
stackValue.put(stackValue.type, instructionAdapter); stackValue.put(stackValue.type, iv);
instructionAdapter.putfield(classType.getInternalName(), ScriptDescriptor.LAST_EXPRESSION_VALUE_FIELD_NAME, iv.putfield(classType.getInternalName(), ScriptDescriptor.LAST_EXPRESSION_VALUE_FIELD_NAME, blockType.getDescriptor());
blockType.getDescriptor());
} }
instructionAdapter.areturn(Type.VOID_TYPE); iv.areturn(Type.VOID_TYPE);
mv.visitMaxs(-1, -1); mv.visitMaxs(-1, -1);
mv.visitEnd(); mv.visitEnd();
} }