/** * Is this a 'special' call? (invokespecial in Java) */ public boolean isSpecial() { return getCallSite().isSpecial(); }
/** * Is this a 'special' call? (invokespecial in Java) */ public boolean isSpecial() { return getCallSite().isSpecial(); }
public boolean isFixed() { return isStatic() || isSpecial(); }
public boolean isFixed() { return isStatic() || isSpecial(); }
/** * 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; }
if (site.isSpecial()) { if (site.getDeclaredTarget().getDeclaringClass().equals(TypeReference.JavaLangObject)) { Set<CGNode> targets = cg.getPossibleTargets(node, site);