Code clean
This commit is contained in:
@@ -49,7 +49,7 @@ public interface CallGenerator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void genCallWithoutNullAssertion(
|
||||
public void genCallWithoutAssertions(
|
||||
@NotNull CallableMethod method, @NotNull ExpressionCodegen codegen
|
||||
) {
|
||||
method.invokeWithoutAssertions(codegen.v);
|
||||
@@ -92,7 +92,7 @@ public interface CallGenerator {
|
||||
|
||||
void genCall(@NotNull CallableMethod callableMethod, @Nullable ResolvedCall<?> resolvedCall, boolean callDefault, @NotNull ExpressionCodegen codegen);
|
||||
|
||||
void genCallWithoutNullAssertion(@NotNull CallableMethod callableMethod, @NotNull ExpressionCodegen codegen);
|
||||
void genCallWithoutAssertions(@NotNull CallableMethod callableMethod, @NotNull ExpressionCodegen codegen);
|
||||
|
||||
void afterParameterPut(@NotNull Type type, StackValue stackValue, @NotNull ValueParameterDescriptor valueParameterDescriptor);
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ import org.jetbrains.jet.lang.resolve.calls.CallResolverUtil;
|
||||
import org.jetbrains.jet.lang.resolve.constants.ArrayValue;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.constants.JavaClassValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.org.objectweb.asm.AnnotationVisitor;
|
||||
@@ -580,13 +579,13 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
@NotNull MethodContext methodContext,
|
||||
@NotNull JvmMethodSignature signature,
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
boolean aStatic,
|
||||
boolean isStatic,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull DefaultParameterValueLoader loadStrategy,
|
||||
@Nullable JetNamedFunction function
|
||||
) {
|
||||
mv.visitCode();
|
||||
generateDefaultImplBody(methodContext, signature, functionDescriptor, aStatic, mv, loadStrategy, function, getParentCodegen(), state);
|
||||
generateDefaultImplBody(methodContext, signature, functionDescriptor, isStatic, mv, loadStrategy, function, getParentCodegen(), state);
|
||||
endVisit(mv, "default method", callableDescriptorToDeclaration(state.getBindingContext(), functionDescriptor));
|
||||
}
|
||||
|
||||
@@ -594,7 +593,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
@NotNull MethodContext methodContext,
|
||||
@NotNull JvmMethodSignature signature,
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
boolean aStatic,
|
||||
boolean isStatic,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull DefaultParameterValueLoader loadStrategy,
|
||||
@Nullable JetNamedFunction function,
|
||||
@@ -603,7 +602,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
) {
|
||||
FrameMap frameMap = new FrameMap();
|
||||
|
||||
if (!aStatic) {
|
||||
if (!isStatic) {
|
||||
frameMap.enterTemp(OBJECT_TYPE);
|
||||
}
|
||||
|
||||
@@ -630,7 +629,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
CallGenerator generator = codegen.getOrCreateCallGenerator(functionDescriptor, function);
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
loadExplicitArgumentsOnStack(iv, OBJECT_TYPE, aStatic, signature);
|
||||
loadExplicitArgumentsOnStack(iv, OBJECT_TYPE, isStatic, signature);
|
||||
generator.putHiddenParams();
|
||||
|
||||
for (int index = 0; index < paramDescrs.size(); index++) {
|
||||
@@ -663,7 +662,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
method = state.getTypeMapper().mapToCallableMethod(functionDescriptor, false, methodContext);
|
||||
}
|
||||
|
||||
generator.genCallWithoutNullAssertion(method, codegen);
|
||||
generator.genCallWithoutAssertions(method, codegen);
|
||||
|
||||
iv.areturn(signature.getReturnType());
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class InlineCodegen implements CallGenerator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void genCallWithoutNullAssertion(
|
||||
public void genCallWithoutAssertions(
|
||||
@NotNull CallableMethod callableMethod, @NotNull ExpressionCodegen codegen
|
||||
) {
|
||||
genCall(callableMethod, null, false, codegen);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class InliningContext {
|
||||
}
|
||||
|
||||
public boolean isRoot() {
|
||||
return false;
|
||||
return parent == null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -19,9 +19,7 @@ package org.jetbrains.jet.codegen.inline;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.codegen.context.CodegenContext;
|
||||
import org.jetbrains.jet.codegen.state.GenerationState;
|
||||
import org.jetbrains.jet.lang.psi.Call;
|
||||
import org.jetbrains.jet.lang.psi.JetElement;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -48,11 +46,6 @@ public class RootInliningContext extends InliningContext {
|
||||
this.classNameToInline = classNameToInline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRoot() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getClassNameToInline() {
|
||||
|
||||
Reference in New Issue
Block a user