Fixed misspelling in defaulCallGenerator
This commit is contained in:
@@ -159,7 +159,7 @@ public class ClosureCodegen extends ParentCodegenAwareImpl {
|
|||||||
v.anew(asmType);
|
v.anew(asmType);
|
||||||
v.dup();
|
v.dup();
|
||||||
|
|
||||||
codegen.pushClosureOnStack(closure, false, codegen.defaulCallGenerator);
|
codegen.pushClosureOnStack(closure, false, codegen.defaultCallGenerator);
|
||||||
v.invokespecial(asmType.getInternalName(), "<init>", constructor.getDescriptor());
|
v.invokespecial(asmType.getInternalName(), "<init>", constructor.getDescriptor());
|
||||||
}
|
}
|
||||||
return StackValue.onStack(asmType);
|
return StackValue.onStack(asmType);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
@NotNull
|
@NotNull
|
||||||
private final TailRecursionCodegen tailRecursionCodegen;
|
private final TailRecursionCodegen tailRecursionCodegen;
|
||||||
|
|
||||||
public final CallGenerator defaulCallGenerator;
|
public final CallGenerator defaultCallGenerator;
|
||||||
|
|
||||||
public CalculatedClosure generateObjectLiteral(GenerationState state, JetObjectLiteralExpression literal) {
|
public CalculatedClosure generateObjectLiteral(GenerationState state, JetObjectLiteralExpression literal) {
|
||||||
JetObjectDeclaration objectDeclaration = literal.getObjectDeclaration();
|
JetObjectDeclaration objectDeclaration = literal.getObjectDeclaration();
|
||||||
@@ -180,7 +180,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
this.statementVisitor = new CodegenStatementVisitor(this);
|
this.statementVisitor = new CodegenStatementVisitor(this);
|
||||||
this.tailRecursionCodegen = new TailRecursionCodegen(context, this, this.v, state);
|
this.tailRecursionCodegen = new TailRecursionCodegen(context, this, this.v, state);
|
||||||
this.defaulCallGenerator = new CallGenerator.DefaultCallGenerator(this);
|
this.defaultCallGenerator = new CallGenerator.DefaultCallGenerator(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GenerationState getState() {
|
public GenerationState getState() {
|
||||||
@@ -1342,7 +1342,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
v.anew(type);
|
v.anew(type);
|
||||||
v.dup();
|
v.dup();
|
||||||
|
|
||||||
pushClosureOnStack(closure, false, defaulCallGenerator);
|
pushClosureOnStack(closure, false, defaultCallGenerator);
|
||||||
|
|
||||||
JetDelegatorToSuperCall superCall = closure.getSuperCall();
|
JetDelegatorToSuperCall superCall = closure.getSuperCall();
|
||||||
if (superCall != null) {
|
if (superCall != null) {
|
||||||
@@ -1356,7 +1356,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
Type[] argumentTypes = superCallable.getAsmMethod().getArgumentTypes();
|
Type[] argumentTypes = superCallable.getAsmMethod().getArgumentTypes();
|
||||||
ResolvedCall<?> resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, superCall.getCalleeExpression());
|
ResolvedCall<?> resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, superCall.getCalleeExpression());
|
||||||
assert resolvedCall != null;
|
assert resolvedCall != null;
|
||||||
pushMethodArguments(resolvedCall, Arrays.asList(argumentTypes), defaulCallGenerator);
|
pushMethodArguments(resolvedCall, Arrays.asList(argumentTypes), defaultCallGenerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
v.invokespecial(type.getInternalName(), "<init>", constructor.getAsmMethod().getDescriptor());
|
v.invokespecial(type.getInternalName(), "<init>", constructor.getAsmMethod().getDescriptor());
|
||||||
@@ -2105,7 +2105,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
descriptor instanceof SimpleFunctionDescriptor &&
|
descriptor instanceof SimpleFunctionDescriptor &&
|
||||||
((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline();
|
((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline();
|
||||||
|
|
||||||
CallGenerator callGenerator = !isInline ? defaulCallGenerator :
|
CallGenerator callGenerator = !isInline ? defaultCallGenerator :
|
||||||
new InlineCodegen(this, state, (SimpleFunctionDescriptor) DescriptorUtils.unwrapFakeOverride(
|
new InlineCodegen(this, state, (SimpleFunctionDescriptor) DescriptorUtils.unwrapFakeOverride(
|
||||||
(CallableMemberDescriptor) descriptor.getOriginal()), call);
|
(CallableMemberDescriptor) descriptor.getOriginal()), call);
|
||||||
|
|
||||||
@@ -2118,7 +2118,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
receiver.put(receiver.type, v);
|
receiver.put(receiver.type, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert callGenerator == defaulCallGenerator || !hasDefaultArguments(resolvedCall) && !tailRecursionCodegen.isTailRecursion(resolvedCall) :
|
assert callGenerator == defaultCallGenerator || !hasDefaultArguments(resolvedCall) && !tailRecursionCodegen.isTailRecursion(resolvedCall) :
|
||||||
"Method with defaults or tail recursive couldn't be inlined " + descriptor;
|
"Method with defaults or tail recursive couldn't be inlined " + descriptor;
|
||||||
|
|
||||||
pushArgumentsAndInvoke(resolvedCall, callableMethod, callGenerator);
|
pushArgumentsAndInvoke(resolvedCall, callableMethod, callGenerator);
|
||||||
@@ -3278,7 +3278,8 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
//Resolved call to local class constructor doesn't have resolvedCall.getThisObject() and resolvedCall.getReceiverArgument()
|
//Resolved call to local class constructor doesn't have resolvedCall.getThisObject() and resolvedCall.getReceiverArgument()
|
||||||
//so we need generate closure on stack
|
//so we need generate closure on stack
|
||||||
//See StackValue.receiver for more info
|
//See StackValue.receiver for more info
|
||||||
pushClosureOnStack(closure, resolvedCall.getThisObject().exists() || resolvedCall.getReceiverArgument().exists(), defaulCallGenerator);
|
pushClosureOnStack(closure, resolvedCall.getThisObject().exists() || resolvedCall.getReceiverArgument().exists(),
|
||||||
|
defaultCallGenerator);
|
||||||
|
|
||||||
ConstructorDescriptor originalOfSamAdapter = (ConstructorDescriptor) SamCodegenUtil.getOriginalIfSamAdapter(constructorDescriptor);
|
ConstructorDescriptor originalOfSamAdapter = (ConstructorDescriptor) SamCodegenUtil.getOriginalIfSamAdapter(constructorDescriptor);
|
||||||
CallableMethod method = typeMapper.mapToCallableMethod(originalOfSamAdapter == null ? constructorDescriptor : originalOfSamAdapter);
|
CallableMethod method = typeMapper.mapToCallableMethod(originalOfSamAdapter == null ? constructorDescriptor : originalOfSamAdapter);
|
||||||
@@ -3395,7 +3396,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
if (callable instanceof CallableMethod) {
|
if (callable instanceof CallableMethod) {
|
||||||
genThisAndReceiverFromResolvedCall(receiver, resolvedCall, (CallableMethod) callable);
|
genThisAndReceiverFromResolvedCall(receiver, resolvedCall, (CallableMethod) callable);
|
||||||
boolean skipLast = !isGetter;
|
boolean skipLast = !isGetter;
|
||||||
pushMethodArguments(resolvedCall, ((CallableMethod) callable).getValueParameterTypes(), skipLast, defaulCallGenerator);
|
pushMethodArguments(resolvedCall, ((CallableMethod) callable).getValueParameterTypes(), skipLast, defaultCallGenerator);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gen(array, arrayType); // intrinsic method
|
gen(array, arrayType); // intrinsic method
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class StupidSync extends IntrinsicMethod {
|
|||||||
|
|
||||||
assert resolvedCall != null : "Resolved call for " + element.getText() + " should be not null";
|
assert resolvedCall != null : "Resolved call for " + element.getText() + " should be not null";
|
||||||
|
|
||||||
codegen.pushMethodArguments(resolvedCall, Arrays.asList(OBJECT_TYPE, FUNCTION0_TYPE), codegen.defaulCallGenerator);
|
codegen.pushMethodArguments(resolvedCall, Arrays.asList(OBJECT_TYPE, FUNCTION0_TYPE), codegen.defaultCallGenerator);
|
||||||
v.invokestatic("kotlin/jvm/internal/Intrinsics", "stupidSync", Type.getMethodDescriptor(OBJECT_TYPE, OBJECT_TYPE, FUNCTION0_TYPE));
|
v.invokestatic("kotlin/jvm/internal/Intrinsics", "stupidSync", Type.getMethodDescriptor(OBJECT_TYPE, OBJECT_TYPE, FUNCTION0_TYPE));
|
||||||
return OBJECT_TYPE;
|
return OBJECT_TYPE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user