public static boolean hasObjectArrayLoad(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return hasObjectArrayLoad(sm.getStatements()); } else { return hasShrikeBTObjectArrayLoad((ShrikeCTMethod) m); } }
public static boolean hasObjectArrayLoad(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return hasObjectArrayLoad(sm.getStatements()); } else { return hasShrikeBTObjectArrayLoad((ShrikeCTMethod) m); } }
public static Set getCaughtExceptions(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getCaughtExceptions(sm.getStatements()); } else { return getShrikeBTCaughtExceptions((ShrikeCTMethod) m); } }
public static boolean hasObjectArrayStore(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return hasObjectArrayStore(sm.getStatements()); } else { return hasShrikeBTObjectArrayStore((ShrikeCTMethod) m); } }
public static boolean hasObjectArrayStore(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return hasObjectArrayStore(sm.getStatements()); } else { return hasShrikeBTObjectArrayStore((ShrikeCTMethod) m); } }
public static Set getCaughtExceptions(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getCaughtExceptions(sm.getStatements()); } else { return getShrikeBTCaughtExceptions((ShrikeCTMethod) m); } }
/** * @throws IllegalArgumentException if m is null */ public static Collection<FieldReference> getFieldsRead(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getFieldsRead(sm.getStatements()); } else { return getFieldsReadFromShrikeBT((ShrikeCTMethod) m); } }
/** * get the element types of the arrays that m may update */ public static Collection<TypeReference> getArraysWritten(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getArraysWritten(sm.getStatements()); } else { return getArraysWrittenFromShrikeBT((ShrikeCTMethod) m); } }
/** * @throws IllegalArgumentException if m is null */ public static Collection<NewSiteReference> getNewSites(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getNewSites(sm.getStatements()); } else { return getNewSitesFromShrikeBT((ShrikeCTMethod) m); } }
/** * get the element types of the arrays that m may update */ public static Collection<TypeReference> getArraysWritten(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getArraysWritten(sm.getStatements()); } else { return getArraysWrittenFromShrikeBT((ShrikeCTMethod) m); } }
/** * @throws IllegalArgumentException if m is null */ public static Collection<NewSiteReference> getNewSites(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getNewSites(sm.getStatements()); } else { return getNewSitesFromShrikeBT((ShrikeCTMethod) m); } }
public ControlFlowGraph makeCFG(IMethod method, @SuppressWarnings("unused") Context c) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException("method cannot be null"); } if (method.isWalaSynthetic()) { return syntheticFactory.makeCFG((SyntheticMethod) method); } else if (method instanceof IBytecodeMethod) { @SuppressWarnings("unchecked") final IBytecodeMethod<IInstruction> castMethod = (IBytecodeMethod) method; return shrikeFactory.makeCFG(castMethod); } else { Assertions.UNREACHABLE(); return null; } }
public ControlFlowGraph makeCFG(IMethod method, @SuppressWarnings("unused") Context c) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException("method cannot be null"); } if (method.isWalaSynthetic()) { return syntheticFactory.makeCFG((SyntheticMethod) method); } else if (method instanceof IBytecodeMethod) { @SuppressWarnings("unchecked") final IBytecodeMethod<IInstruction> castMethod = (IBytecodeMethod) method; return shrikeFactory.makeCFG(castMethod); } else { Assertions.UNREACHABLE(); return null; } }
/** * @throws IllegalArgumentException if m is null */ public static Collection<CallSiteReference> getCallSites(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getCallSites(sm.getStatements()); } else { return getCallSitesFromShrikeBT((IBytecodeMethod) m); } }
/** * @throws IllegalArgumentException if m is null */ public static Collection<FieldReference> getFieldsWritten(IMethod m) throws InvalidClassFileException { if (m == null) { throw new IllegalArgumentException("m is null"); } if (m.isWalaSynthetic()) { SyntheticMethod sm = (SyntheticMethod) m; return getFieldsWritten(sm.getStatements()); } else { return getFieldsWrittenFromShrikeBT((ShrikeCTMethod) m); } }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (node.getMethod().isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) node.getMethod(); if (s.isFactoryMethod()) { return getTypesForContext(node.getContext()) != null; } } return false; }
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (callee == null) { throw new IllegalArgumentException("callee is null"); } if (callee.isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) callee; if (s.isFactoryMethod()) { return new CallStringContext(new CallString(site, caller.getMethod())); } } return null; }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (node.getMethod().isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) node.getMethod(); if (s.isFactoryMethod()) { return getTypesForContext(node.getContext()) != null; } } return false; }
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (callee == null) { throw new IllegalArgumentException("callee is null"); } if (callee.isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) callee; if (s.isFactoryMethod()) { return new CallStringContext(new CallString(site, caller.getMethod())); } } return null; }
@Override public DefUse getDU() { if (getMethod().isWalaSynthetic()) { // disable local cache in this case, as context interpreters // do weird things like mutate IRs return getCallGraph().getInterpreter(this).getDU(this); } DefUse du = this.du.get(); if (du == null) { du = getCallGraph().getInterpreter(this).getDU(this); this.du = new WeakReference<>(du); } return du; }