|
|
|
|
|
|
|
|
// generate code for evaluating arguments. |
|
|
// generate code for evaluating arguments. |
|
|
atMethodArgs(args, types, dims, cnames); |
|
|
atMethodArgs(args, types, dims, cnames); |
|
|
|
|
|
|
|
|
// used by invokeinterface |
|
|
|
|
|
int count = bytecode.getStackDepth() - stack + 1; |
|
|
|
|
|
|
|
|
|
|
|
if (found == null) |
|
|
if (found == null) |
|
|
found = resolver.lookupMethod(targetClass, thisClass, thisMethod, |
|
|
found = resolver.lookupMethod(targetClass, thisClass, thisMethod, |
|
|
mname, types, dims, cnames); |
|
|
mname, types, dims, cnames); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
atMethodCallCore2(targetClass, mname, isStatic, isSpecial, |
|
|
atMethodCallCore2(targetClass, mname, isStatic, isSpecial, |
|
|
aload0pos, count, found); |
|
|
|
|
|
|
|
|
aload0pos, found); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void atMethodCallCore2(CtClass targetClass, String mname, |
|
|
private void atMethodCallCore2(CtClass targetClass, String mname, |
|
|
boolean isStatic, boolean isSpecial, |
|
|
boolean isStatic, boolean isSpecial, |
|
|
int aload0pos, int count, |
|
|
|
|
|
|
|
|
int aload0pos, |
|
|
MemberResolver.Method found) |
|
|
MemberResolver.Method found) |
|
|
throws CompileError |
|
|
throws CompileError |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|| declClass.isInterface() != targetClass.isInterface()) |
|
|
|| declClass.isInterface() != targetClass.isInterface()) |
|
|
declClass = targetClass; |
|
|
declClass = targetClass; |
|
|
|
|
|
|
|
|
if (declClass.isInterface()) |
|
|
|
|
|
bytecode.addInvokeinterface(declClass, mname, desc, count); |
|
|
|
|
|
|
|
|
if (declClass.isInterface()) { |
|
|
|
|
|
int nargs = Descriptor.paramSize(desc) + 1; |
|
|
|
|
|
bytecode.addInvokeinterface(declClass, mname, desc, nargs); |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
if (isStatic) |
|
|
if (isStatic) |
|
|
throw new CompileError(mname + " is not static"); |
|
|
throw new CompileError(mname + " is not static"); |