public ConsList<Binding> matches(TypeHierarchy types, Method method, TACInstruction instr) {
if (!(instr instanceof MethodCallInstruction))
return null;
MethodCallInstruction invoke = (MethodCallInstruction) instr;
//first, check to see if the instr is right for this op
if (!name.equals(invoke.getMethodName()))
return null;
if (isStatic != invoke.isStaticMethodCall())
return null;
IMethodBinding binding = invoke.resolveBinding();
if (!types.existsCommonSubtype(thisType, invoke.getReceiverOperand().resolveType().getQualifiedName()))
return null;
if (binding.getParameterTypes().length != paramTypes.length)
return null;
for (int ndx = 0; ndx < paramTypes.length; ndx++)
if (!types.existsCommonSubtype(paramTypes[ndx], invoke.getArgOperands().get(ndx).resolveType().getQualifiedName()))
return null;
ConsList<Binding> vars = ConsList.empty();
if (!isStatic)
vars = ConsList.cons(new Binding(thisVar, invoke.getReceiverOperand()), vars);
vars = ConsList.cons(new Binding(retVar, invoke.getTarget()), vars);
for (int ndx = 0; ndx < params.length; ndx++)
vars = ConsList.cons(new Binding(params[ndx], invoke.getArgOperands().get(ndx)), vars);
return vars;
}