/** * get type for F appropriate for use in a field name. */ protected IClass getFieldNameType(InstanceKey F) { return F.getConcreteType(); }
@Override public Iterator<Pair<CGNode, NewSiteReference>> getCreationSites(CallGraph CG) { return new FilterIterator<>( base.getCreationSites(CG), o -> o.fst.equals(creator)); } }
/** * get type for F appropriate for use in a field name. */ protected IClass getFieldNameType(InstanceKey F) { return F.getConcreteType(); }
@Override public Iterator<Pair<CGNode, NewSiteReference>> getCreationSites(CallGraph CG) { return new FilterIterator<>( base.getCreationSites(CG), o -> o.fst.equals(creator)); } }
@Override public IClass getConcreteType() { return base.getConcreteType(); }
private static <T extends InstanceKey> Set<Pair<CGNode, NewSiteReference>> getPrototypeSites(PointerAnalysis<T> fbPA, CallGraph CG, Function<T,Iterator<T>> proto, CGNode node, int vn) { Set<Pair<CGNode, NewSiteReference>> fbProtos = HashSetFactory.make(); PointerKey fbKey = fbPA.getHeapModel().getPointerKeyForLocal(node, vn); OrdinalSet<T> fbPointsTo = fbPA.getPointsToSet(fbKey); for(T o : fbPointsTo) { for(T p : Iterator2Iterable.make(proto.apply(o))) { for(Pair<CGNode, NewSiteReference> cs : Iterator2Iterable.make(p.getCreationSites(CG))) { fbProtos.add(cs); } } } return fbProtos; }
@Override public IClass getConcreteType() { return base.getConcreteType(); }
private static Set<Pair<CGNode, NewSiteReference>> ptrs(Set<CGNode> functions, int local, CallGraph CG, PointerAnalysis<? extends InstanceKey> pa) { Set<Pair<CGNode, NewSiteReference>> result = HashSetFactory.make(); for(CGNode n : functions) { PointerKey l = pa.getHeapModel().getPointerKeyForLocal(n, local); if (l != null) { OrdinalSet<? extends InstanceKey> pointers = pa.getPointsToSet(l); if (pointers != null) { for(InstanceKey k : pointers) { for(Pair<CGNode, NewSiteReference> cs : Iterator2Iterable.make(k.getCreationSites(CG))) { result.add(cs); } } } } } return result; }
protected int compareInstanceKeys(InstanceKey k1, InstanceKey k2) { return compareConcreteTypes( k1.getConcreteType(), k2.getConcreteType() ); }
protected int compareInstanceKeys(InstanceKey k1, InstanceKey k2) { return compareConcreteTypes( k1.getConcreteType(), k2.getConcreteType() ); }
private boolean isBogusKey(InstanceKey K) { TypeReference t = K.getConcreteType().getReference(); return t == JavaScriptTypes.Null || t == JavaScriptTypes.Undefined; }
private boolean isBogusKey(InstanceKey K) { TypeReference t = K.getConcreteType().getReference(); return t == JavaScriptTypes.Null || t == JavaScriptTypes.Undefined; }
private static boolean isOfType(final InstanceKey ik, final String typeName) { return typeName.equals(ik.getConcreteType().getName().toString()); }
protected LexicalParent[] getParents(InstanceKey base) { DynamicMethodObject function = (DynamicMethodObject) base.getConcreteType().getMethod(AstMethodReference.fnSelector); return function==null? new LexicalParent[0]: function.getParents(); }
@Override protected boolean needsScopeMappingKey(InstanceKey base) { return cha.isSubclassOf(base.getConcreteType(), codeBody) && getParents(base).length > 0; }
@Override public TypeFilter getTypeFilter() { return new SingleClassFilter(((ArrayClass) instance.getConcreteType()).getElementClass()); } }
final IMethod M = R[0].getConcreteType().getMethod(selector);
@Override public TypeFilter getTypeFilter() { return new SingleClassFilter(((ArrayClass) instance.getConcreteType()).getElementClass()); } }
/** * Handle assign of a particular exception instance into an exception variable * * @param exceptionVar points-to set for a variable representing a caught exception * @param catchClasses set of TypeReferences that the exceptionVar may catch * @param e a particular exception instance */ protected void assignInstanceToCatch(PointerKey exceptionVar, Set<IClass> catchClasses, InstanceKey e) { if (catches(catchClasses, e.getConcreteType(), cha)) { system.newConstraint(exceptionVar, e); } }
/** * Handle assign of a particular exception instance into an exception variable * * @param exceptionVar points-to set for a variable representing a caught exception * @param catchClasses set of TypeReferences that the exceptionVar may catch * @param e a particular exception instance */ protected void assignInstanceToCatch(PointerKey exceptionVar, Set<IClass> catchClasses, InstanceKey e) { if (catches(catchClasses, e.getConcreteType(), cha)) { system.newConstraint(exceptionVar, e); } }