private static MethodTargetSelector setupMethodTargetSelector(JavaScriptConstructorFunctions constructors2, AnalysisOptions options) { MethodTargetSelector result = new JavaScriptConstructTargetSelector(constructors2, options.getMethodTargetSelector()); if (options instanceof JSAnalysisOptions && ((JSAnalysisOptions)options).handleCallApply()) { result = new JavaScriptFunctionApplyTargetSelector(new JavaScriptFunctionDotCallTargetSelector(result)); } return result; }
private static MethodTargetSelector setupMethodTargetSelector(JavaScriptConstructorFunctions constructors2, AnalysisOptions options) { MethodTargetSelector result = new JavaScriptConstructTargetSelector(constructors2, options.getMethodTargetSelector()); if (options instanceof JSAnalysisOptions && ((JSAnalysisOptions)options).handleCallApply()) { result = new JavaScriptFunctionApplyTargetSelector(new JavaScriptFunctionDotCallTargetSelector(result)); } return result; }
public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, XMLMethodSummaryReader summary, IClassHierarchy cha) throws IllegalArgumentException { if (scope == null) { throw new IllegalArgumentException("scope is null"); } if (options == null) { throw new IllegalArgumentException("options is null"); } if (cl == null) { throw new IllegalArgumentException("cl is null"); } if (cha == null) { throw new IllegalArgumentException("cha cannot be null"); } MethodTargetSelector ms = new BypassMethodTargetSelector(options.getMethodTargetSelector(), summary.getSummaries(), summary.getIgnoredPackages(), cha); options.setSelector(ms); ClassTargetSelector cs = new BypassClassTargetSelector(options.getClassTargetSelector(), summary.getAllocatableClasses(), cha, cha.getLoader(scope.getLoader(Atom.findOrCreateUnicodeAtom("Synthetic")))); options.setSelector(cs); }
public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, XMLMethodSummaryReader summary, IClassHierarchy cha) throws IllegalArgumentException { if (scope == null) { throw new IllegalArgumentException("scope is null"); } if (options == null) { throw new IllegalArgumentException("options is null"); } if (cl == null) { throw new IllegalArgumentException("cl is null"); } if (cha == null) { throw new IllegalArgumentException("cha cannot be null"); } MethodTargetSelector ms = new BypassMethodTargetSelector(options.getMethodTargetSelector(), summary.getSummaries(), summary.getIgnoredPackages(), cha); options.setSelector(ms); ClassTargetSelector cs = new BypassClassTargetSelector(options.getClassTargetSelector(), summary.getAllocatableClasses(), cha, cha.getLoader(scope.getLoader(Atom.findOrCreateUnicodeAtom("Synthetic")))); options.setSelector(cs); }
public static void addDefaultDispatchLogic(AnalysisOptions options, IClassHierarchy cha) { com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha); Map<Atom,MethodTargetSelector> methodTargetSelectors = HashMapFactory.make(); methodTargetSelectors.put(JavaScriptLoader.JS.getName(), new JavaScriptConstructTargetSelector(cha, new StandardFunctionTargetSelector(cha, options.getMethodTargetSelector()))); methodTargetSelectors.put(Language.JAVA.getName(), options.getMethodTargetSelector()); options.setSelector(new CrossLanguageMethodTargetSelector(methodTargetSelectors)); }
options.getMethodTargetSelector(), summaries, nativeSummaries.getIgnoredPackages(), cha); options.setSelector(ms);
/** * @param caller the caller node * @param iKey an abstraction of the receiver of the call (or null if not applicable) * @return the CGNode to which this particular call should dispatch. */ protected CGNode getTargetForCall(CGNode caller, CallSiteReference site, IClass recv, InstanceKey iKey[]) { IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(caller, site, recv); // this most likely indicates an exclusion at work; the target selector // should have issued a warning if (targetMethod == null || targetMethod.isAbstract()) { return null; } Context targetContext = contextSelector.getCalleeTarget(caller, site, targetMethod, iKey); if (targetContext.isA(IllegalArgumentExceptionContext.class)) { return null; } try { return getCallGraph().findOrCreateNode(targetMethod, targetContext); } catch (CancelException e) { return null; } }
/** * @param caller the caller node * @param iKey an abstraction of the receiver of the call (or null if not applicable) * @return the CGNode to which this particular call should dispatch. */ protected CGNode getTargetForCall(CGNode caller, CallSiteReference site, IClass recv, InstanceKey iKey[]) { IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(caller, site, recv); // this most likely indicates an exclusion at work; the target selector // should have issued a warning if (targetMethod == null || targetMethod.isAbstract()) { return null; } Context targetContext = contextSelector.getCalleeTarget(caller, site, targetMethod, iKey); if (targetContext.isA(IllegalArgumentExceptionContext.class)) { return null; } try { return getCallGraph().findOrCreateNode(targetMethod, targetContext); } catch (CancelException e) { return null; } }
options.getMethodTargetSelector());
MethodReference m = klass.getClassInitializer().getReference(); CallSiteReference site = CallSiteReference.make(1, m, IInvokeInstruction.Dispatch.STATIC); IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(callGraph.getFakeRootNode(), site, null); if (targetMethod != null) { CGNode target = callGraph.getNode(targetMethod, Everywhere.EVERYWHERE);
MethodReference m = klass.getClassInitializer().getReference(); CallSiteReference site = CallSiteReference.make(1, m, IInvokeInstruction.Dispatch.STATIC); IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(callGraph.getFakeRootNode(), site, null); if (targetMethod != null) { CGNode target = callGraph.getNode(targetMethod, Everywhere.EVERYWHERE);
public static void analyzeMethodHandles(AnalysisOptions options, SSAPropagationCallGraphBuilder builder) { options.setSelector(new InvokeExactTargetSelector(options.getMethodTargetSelector())); builder.setContextSelector(new ContextSelectorImpl(builder.getContextSelector())); builder.setContextInterpreter(new DelegatingSSAContextInterpreter(new InvokeContextInterpreterImpl(), builder.getCFAContextInterpreter())); builder.setContextInterpreter(new DelegatingSSAContextInterpreter(new FindContextInterpreterImpl(), builder.getCFAContextInterpreter())); } }
public static void analyzeMethodHandles(AnalysisOptions options, SSAPropagationCallGraphBuilder builder) { options.setSelector(new InvokeExactTargetSelector(options.getMethodTargetSelector())); builder.setContextSelector(new ContextSelectorImpl(builder.getContextSelector())); builder.setContextInterpreter(new DelegatingSSAContextInterpreter(new InvokeContextInterpreterImpl(), builder.getCFAContextInterpreter())); builder.setContextInterpreter(new DelegatingSSAContextInterpreter(new FindContextInterpreterImpl(), builder.getCFAContextInterpreter())); } }
IMethod targetMethod = getOptions().getMethodTargetSelector().getCalleeTarget(callGraph.getFakeRootNode(), site, null); if (targetMethod != null) { CGNode target = getTargetForCall(callGraph.getFakeRootNode(), site, null, null);
IMethod targetMethod = getOptions().getMethodTargetSelector().getCalleeTarget(callGraph.getFakeRootNode(), site, null); if (targetMethod != null) { CGNode target = getTargetForCall(callGraph.getFakeRootNode(), site, null, null);
for (InstanceKeyAndState ikAndState : p2set) { InstanceKey ik = ikAndState.getInstanceKey(); IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(caller, call, ik.getConcreteType()); if (targetMethod == null) {
for (InstanceKeyAndState ikAndState : p2set) { InstanceKey ik = ikAndState.getInstanceKey(); IMethod targetMethod = options.getMethodTargetSelector().getCalleeTarget(caller, call, ik.getConcreteType()); if (targetMethod == null) {