private static Atom getLanguage(NewSiteReference target) { return target .getDeclaredType() .getClassLoader() .getLanguage(); }
private static Atom getLanguage(MethodReference target) { return target .getDeclaringClass() .getClassLoader() .getLanguage(); }
private static Atom getLanguage(MethodReference target) { return target .getDeclaringClass() .getClassLoader() .getLanguage(); }
/** * Utility function. Useful when parsing input. */ public MethodReference findMethod(Atom loader, String klass, Atom name, ImmutableByteArray desc) { if (desc == null) { throw new IllegalArgumentException("null desc"); } ClassLoaderReference clr = getLoader(loader); Descriptor ddesc = Descriptor.findOrCreate(languages.get(clr.getLanguage()), desc); TypeReference type = TypeReference.findOrCreate(clr, TypeName.string2TypeName(klass)); return MethodReference.findOrCreate(type, name, ddesc); }
@Override public int addCheckcast(TypeReference[] type, int rv, boolean isPEI) { Atom language = type[0].getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addCheckcast(type, rv, isPEI); }
public int addPhi(TypeReference type, int[] values) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addPhi(values); }
@Override public AstLexicalRead addGlobalRead(TypeReference type, String name) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((AstFakeRoot) root).addGlobalRead(type, name); }
@Override public SSANewInstruction addAllocation(TypeReference type) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addAllocation(type); }
/** * Utility function. Useful when parsing input. */ public MethodReference findMethod(Atom loader, String klass, Atom name, ImmutableByteArray desc) { if (desc == null) { throw new IllegalArgumentException("null desc"); } ClassLoaderReference clr = getLoader(loader); Descriptor ddesc = Descriptor.findOrCreate(languages.get(clr.getLanguage()), desc); TypeReference type = TypeReference.findOrCreate(clr, TypeName.string2TypeName(klass)); return MethodReference.findOrCreate(type, name, ddesc); }
private static Atom getLanguage(CallSiteReference site) { return site .getDeclaredTarget() .getDeclaringClass() .getClassLoader() .getLanguage(); }
public int addPhi(TypeReference type, int[] values) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addPhi(values); }
@Override public int addCheckcast(TypeReference[] type, int rv, boolean isPEI) { Atom language = type[0].getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addCheckcast(type, rv, isPEI); }
@Override public AstLexicalRead addGlobalRead(TypeReference type, String name) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((AstFakeRoot) root).addGlobalRead(type, name); }
@Override public int addGetStatic(FieldReference ref) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetStatic(ref); }
@Override public int addGetInstance(FieldReference ref, int object) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetInstance(ref, object); }
@Override public int addGetStatic(FieldReference ref) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetStatic(ref); }
@Override public int addGetInstance(FieldReference ref, int object) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetInstance(ref, object); }
@Override public SSAAbstractInvokeInstruction addDirectCall(int functionVn, int[] argVns, CallSiteReference callSite) { TypeReference type = callSite.getDeclaredTarget().getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((ScriptFakeRoot) root).addDirectCall(functionVn, argVns, callSite); } }
@Override public SSAAbstractInvokeInstruction addInvocation(int[] params, CallSiteReference site) { TypeReference type = site.getDeclaredTarget().getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addInvocation(params, site); }
public AppModelMethod(IClassHierarchy cha, AnalysisScope scope, AndroidSpecs specs) { this.cha = cha; this.scope = scope; Language lang = scope.getLanguage(ClassLoaderReference.Application.getLanguage()); insts = lang.instructionFactory(); startMethod(); buildTypeMap(specs); processTypeMap(); processCallBackParams(); createLoopAndSwitch(); }