one more small step of CallableMethod refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.objectweb.asm.commons.Method;
|
||||
|
||||
/**
|
||||
@@ -27,4 +28,8 @@ public class CallableMethod {
|
||||
public int getInvokeOpcode() {
|
||||
return invokeOpcode;
|
||||
}
|
||||
|
||||
void invoke(InstructionAdapter v) {
|
||||
v.visitMethodInsn(getInvokeOpcode(), getOwner(), getDescriptor().getName(), getDescriptor().getDescriptor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +797,7 @@ public class ExpressionCodegen extends JetVisitor {
|
||||
|
||||
pushMethodArguments(expression, callableMethod.getDescriptor());
|
||||
pushTypeArguments(expression);
|
||||
invokeCallableMethod(callableMethod);
|
||||
callableMethod.invoke(v);
|
||||
methodDescriptor = callableMethod.getDescriptor();
|
||||
}
|
||||
else {
|
||||
@@ -830,11 +830,6 @@ public class ExpressionCodegen extends JetVisitor {
|
||||
}
|
||||
}
|
||||
|
||||
private void invokeCallableMethod(CallableMethod callableMethod) {
|
||||
v.visitMethodInsn(callableMethod.getInvokeOpcode(), callableMethod.getOwner(),
|
||||
callableMethod.getDescriptor().getName(), callableMethod.getDescriptor().getDescriptor());
|
||||
}
|
||||
|
||||
private Method generateJavaMethodCall(JetCallExpression expression, PsiMethod psiMethod) {
|
||||
final PsiClass containingClass = psiMethod.getContainingClass();
|
||||
String owner = JetTypeMapper.jvmName(containingClass);
|
||||
|
||||
Reference in New Issue
Block a user