} else if (instr instanceof SSAAbstractInvokeInstruction) { SSAAbstractInvokeInstruction callInst = (SSAAbstractInvokeInstruction) instr; String sign = callInst.getDeclaredTarget().getSignature(); if (((SSAAbstractInvokeInstruction) instr).isStatic()) {
String def = call.hasDef() ? Integer.valueOf(call.getDef()) + "=" : ""; final StringBuilder result = new StringBuilder(def).append("call ") .append(call.getDeclaredTarget().getDeclaringClass().getName().getClassName()).append('.') .append(call.getDeclaredTarget().getName()); result.append(" exc:").append(call.getException()); for (int i = 0; i < s.getNumberOfUses(); i++) {
@SuppressWarnings("unused") private static OrdinalSet<FuncVertex> getConstructorTargets(FlowGraph flowGraph, CallVertex callVertex, IProgressMonitor monitor) throws CancelException { SSAAbstractInvokeInstruction invoke = callVertex.getInstruction(); assert invoke.getDeclaredTarget().getName().equals(JavaScriptMethods.ctorAtom); VarVertex objectParam = flowGraph.getVertexFactory().makeVarVertex(callVertex.getCaller(), invoke.getUse(0)); return flowGraph.getReachingSet(objectParam, monitor); }
@SuppressWarnings("unused") private static OrdinalSet<FuncVertex> getConstructorTargets(FlowGraph flowGraph, CallVertex callVertex, IProgressMonitor monitor) throws CancelException { SSAAbstractInvokeInstruction invoke = callVertex.getInstruction(); assert invoke.getDeclaredTarget().getName().equals(JavaScriptMethods.ctorAtom); VarVertex objectParam = flowGraph.getVertexFactory().makeVarVertex(callVertex.getCaller(), invoke.getUse(0)); return flowGraph.getReachingSet(objectParam, monitor); }
/** * TODO: enhance this logic using type inference * * @return true if we need to filter the receiver type to account for virtual dispatch */ @SuppressWarnings("unused") private boolean needsFilterForReceiver(SSAAbstractInvokeInstruction instruction, CGNode target) { FilteredPointerKey.TypeFilter f = (FilteredPointerKey.TypeFilter) target.getContext().get(ContextKey.PARAMETERS[0]); if (f != null) { // the context selects a particular concrete type for the receiver. // we need to filter, unless the declared receiver type implies the // concrete type (TODO: need to implement this optimization) return true; } // don't need to filter for invokestatic if (instruction.getCallSite().isStatic() || instruction.getCallSite().isSpecial()) { return false; } MethodReference declaredTarget = instruction.getDeclaredTarget(); IMethod resolvedTarget = getClassHierarchy().resolveMethod(declaredTarget); if (resolvedTarget == null) { // there's some problem that will be flagged as a warning return true; } return true; }
/** * TODO: enhance this logic using type inference * * @return true if we need to filter the receiver type to account for virtual dispatch */ @SuppressWarnings("unused") private boolean needsFilterForReceiver(SSAAbstractInvokeInstruction instruction, CGNode target) { FilteredPointerKey.TypeFilter f = (FilteredPointerKey.TypeFilter) target.getContext().get(ContextKey.PARAMETERS[0]); if (f != null) { // the context selects a particular concrete type for the receiver. // we need to filter, unless the declared receiver type implies the // concrete type (TODO: need to implement this optimization) return true; } // don't need to filter for invokestatic if (instruction.getCallSite().isStatic() || instruction.getCallSite().isSpecial()) { return false; } MethodReference declaredTarget = instruction.getDeclaredTarget(); IMethod resolvedTarget = getClassHierarchy().resolveMethod(declaredTarget); if (resolvedTarget == null) { // there's some problem that will be flagged as a warning return true; } return true; }
IMethod m = cha.resolveMethod(call.getDeclaredTarget()); if (m != null) { TypeReference[] x = null;
IMethod m = cha.resolveMethod(call.getDeclaredTarget()); if (m != null) { TypeReference[] x = null;