@Override public IntSet getRelevantParameters(CGNode caller, CallSiteReference site) { if (site.getDeclaredTarget().equals(GET_CLASS)) { return thisParameter; } else { return EmptyIntSet.instance; } }
@Override public boolean equals(Object o) { if (o instanceof SSAValue) { final SSAValue other = (SSAValue) o; return ((this.number == other.number) && (this.mRef.equals(other.mRef)) && this.type.equals(other.type)); } throw new IllegalArgumentException("Can't compare SSAValue to " + o.getClass()); }
@Override public IntSet getRelevantParameters(CGNode caller, CallSiteReference site) { if (site.getDeclaredTarget().equals(ReflectiveInvocationInterpreter.METHOD_INVOKE) || site.getDeclaredTarget().equals(ReflectiveInvocationInterpreter.CTOR_NEW_INSTANCE)) { return thisParameter; } else { return EmptyIntSet.instance; } } }
@Override public boolean equals(Object o) { if (o instanceof SSAValue) { final SSAValue other = (SSAValue) o; return ((this.number == other.number) && (this.mRef.equals(other.mRef)) && this.type.equals(other.type)); } throw new IllegalArgumentException("Can't compare SSAValue to " + o.getClass()); }
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (receiver == null) { return null; } if (callee.getReference().equals(CloneInterpreter.CLONE)) { return selector.getCalleeTarget(caller,site,callee,receiver); } else { return null; } }
@Override public void visitJavaScriptInvoke(JavaScriptInvoke instruction) { if (instruction.getDeclaredTarget().equals(JavaScriptMethods.dispatchReference)) { handleJavascriptDispatch(instruction); } else { if (! instruction.getDeclaredTarget().equals(JavaScriptMethods.ctorReference)) { System.err.println(instruction); } visitInvokeInternal(instruction, new DefaultInvariantComputer()); } }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final. // if (this.getClass().equals(obj.getClass())) { if (obj instanceof ShrikeBTMethod) { ShrikeBTMethod that = (ShrikeBTMethod) obj; return (getDeclaringClass().equals(that.getDeclaringClass()) && getReference().equals(that.getReference())); } else { return false; } }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } return (node.getMethod().getReference().equals(CLONE) && ContextUtil.getConcreteClassFromContext(node.getContext()) != null); }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final. // if (this.getClass().equals(obj.getClass())) { if (obj instanceof DexIMethod) { DexIMethod that = (DexIMethod) obj; return (getDeclaringClass().equals(that.getDeclaringClass()) && getReference().equals(that.getReference())); } else { return false; } }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (!(node.getContext().isA(JavaTypeContext.class))) { return false; } return node.getMethod().getReference().equals(CLASS_NEW_INSTANCE_REF); }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final. // if (this.getClass().equals(obj.getClass())) { if (obj instanceof DexIMethod) { DexIMethod that = (DexIMethod) obj; return (getDeclaringClass().equals(that.getDeclaringClass()) && getReference().equals(that.getReference())); } else { return false; } }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final. // if (this.getClass().equals(obj.getClass())) { if (obj instanceof ShrikeBTMethod) { ShrikeBTMethod that = (ShrikeBTMethod) obj; return (getDeclaringClass().equals(that.getDeclaringClass()) && getReference().equals(that.getReference())); } else { return false; } }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (!(node.getContext().isA(JavaTypeContext.class))) { return false; } return node.getMethod().getReference().equals(GetClassContextSelector.GET_CLASS); }
@Override public IntSet getRelevantParameters(CGNode caller, CallSiteReference site) { IMethod declaredTarget = cha.resolveMethod(site.getDeclaredTarget()); if (declaredTarget != null && declaredTarget.getReference().equals(CloneInterpreter.CLONE)) { return selector.getRelevantParameters(caller, site); } else { return EmptyIntSet.instance; } }
@Override public IntSet getRelevantParameters(CGNode caller, CallSiteReference site) { IMethod declaredTarget = cha.resolveMethod(site.getDeclaredTarget()); if (declaredTarget != null && declaredTarget.getReference().equals(CloneInterpreter.CLONE)) { return selector.getRelevantParameters(caller, site); } else { return EmptyIntSet.instance; } }
@Override public boolean hasEdge(MethodReference src, MethodReference dst) { for (MethodReference succ : Iterator2Iterable.make(getSuccNodes(src))) { if (dst.equals(succ)) { return true; } } return false; } };
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (callee.getReference().equals(GET_CLASS)) { return new JavaTypeContext(new PointType(receiver[0].getConcreteType())); } return null; }
@Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { if (site.getDeclaredTarget().equals(JavaScriptMethods.ctorReference)) { IR callerIR = caller.getIR(); SSAAbstractInvokeInstruction callStmts[] = callerIR.getCalls(site); assert callStmts.length == 1; int nargs = callStmts[0].getNumberOfPositionalParameters(); return constructors.findOrCreateConstructorMethod(callerIR, callStmts[0], receiver, nargs - 1); } else { return base.getCalleeTarget(caller, site, receiver); } }