public FakeWorldClinitMethod(final IClass fakeRootClass, AnalysisOptions options, IAnalysisCacheView cache) { super(MethodReference.findOrCreate(fakeRootClass.getReference(), name, descr), fakeRootClass.getClassHierarchy(), options, cache); } }
public static MethodReference findOrCreate(Language l, ClassLoaderReference loader, String methodClass, String methodName, String methodSignature) throws IllegalArgumentException { TypeReference t = ShrikeUtil.makeTypeReference(loader, methodClass); Atom name = Atom.findOrCreateUnicodeAtom(methodName); Descriptor d = Descriptor.findOrCreateUTF8(l, methodSignature); return findOrCreate(t, name, d); }
private static MethodReference genSyntheticMethodRef(IClass receiver) { Atom atom = Atom.findOrCreateUnicodeAtom(SYNTHETIC_APPLY_METHOD_PREFIX); Descriptor desc = Descriptor.findOrCreateUTF8(JavaScriptLoader.JS, "()LRoot;"); MethodReference ref = MethodReference.findOrCreate(receiver.getReference(), atom, desc); return ref; }
private static MethodReference genSyntheticMethodRef(IClass receiver, String key) { Atom atom = Atom.findOrCreateUnicodeAtom(SYNTHETIC_CALL_METHOD_PREFIX + key); Descriptor desc = Descriptor.findOrCreateUTF8(JavaScriptLoader.JS, "()LRoot;"); MethodReference ref = MethodReference.findOrCreate(receiver.getReference(), atom, desc); return ref; }
@Override public MethodReference getInvokeMethodReference(ClassLoaderReference loader, IInvokeInstruction instruction) { return MethodReference.findOrCreate(this, loader, instruction.getClassType(), instruction.getMethodName(), instruction.getMethodSignature()); }
public static MethodReference findOrCreate(Language l, ClassLoaderReference loader, String methodClass, String methodName, String methodSignature) throws IllegalArgumentException { TypeReference t = ShrikeUtil.makeTypeReference(loader, methodClass); Atom name = Atom.findOrCreateUnicodeAtom(methodName); Descriptor d = Descriptor.findOrCreateUTF8(l, methodSignature); return findOrCreate(t, name, d); }
private static MethodReference genSyntheticMethodRef(IClass receiver) { Atom atom = Atom.findOrCreateUnicodeAtom(SYNTHETIC_APPLY_METHOD_PREFIX); Descriptor desc = Descriptor.findOrCreateUTF8(JavaScriptLoader.JS, "()LRoot;"); MethodReference ref = MethodReference.findOrCreate(receiver.getReference(), atom, desc); return ref; }
/** * 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 MethodReference getInvokeMethodReference(ClassLoaderReference loader, IInvokeInstruction instruction) { return MethodReference.findOrCreate(this, loader, instruction.getClassType(), instruction.getMethodName(), instruction.getMethodSignature()); }
public MethodReference getMethodRef(IMethodBinding met) { if (!fMethodMap.containsKey(met.getKey())) { // create one TypeName ownerType = TypeName.string2TypeName(typeToTypeID(met.getDeclaringClass())); TypeReference ownerTypeRef = TypeReference.findOrCreate(fClassLoaderRef, ownerType); MethodReference ref = MethodReference.findOrCreate(ownerTypeRef, selectorForMethod(met)); fMethodMap.put(met.getKey(), ref); return ref; } return fMethodMap.get(met.getKey()); }
/** * test that calls to <init> methods are treated specially */ @Test public void testObjInit() { MethodReference m = MethodReference.findOrCreate(TypeReference.JavaLangObject, MethodReference.initSelector); Collection<IMethod> c = cha.getPossibleTargets(m); for (IMethod method : c) { System.err.println(method); } Assert.assertEquals(1, c.size()); }
private MethodReference trampoline() { try { return MethodReference.findOrCreate(LambdaSummaryClass.this.getReference(), invoke.getDeclaredTarget().getName(), Descriptor.findOrCreateUTF8(getLambdaDeclaredSignature())); } catch (IllegalArgumentException | InvalidClassFileException e) { assert false : e; return null; } }
private MethodReference trampoline() { try { return MethodReference.findOrCreate(LambdaSummaryClass.this.getReference(), invoke.getDeclaredTarget().getName(), Descriptor.findOrCreateUTF8(getLambdaDeclaredSignature())); } catch (IllegalArgumentException | InvalidClassFileException e) { assert false : e; return null; } }
public JavaEntityMethod(CAstEntity methodEntity, IClass owner) { super(owner, methodEntity.getQualifiers(), MethodReference.findOrCreate(owner.getReference(), Util .methodEntityToSelector(methodEntity)), JavaSourceLoaderImpl.this.getAnnotations(methodEntity)); this.parameterTypes = computeParameterTypes(methodEntity); this.exceptionTypes = computeExceptionTypes(methodEntity); }
public JavaEntityMethod(CAstEntity methodEntity, IClass owner) { super(owner, methodEntity.getQualifiers(), MethodReference.findOrCreate(owner.getReference(), Util .methodEntityToSelector(methodEntity)), JavaSourceLoaderImpl.this.getAnnotations(methodEntity)); this.parameterTypes = computeParameterTypes(methodEntity); this.exceptionTypes = computeExceptionTypes(methodEntity); }
/** * Test for bug 1714480, reported OOM on {@link ClassHierarchy} getPossibleTargets() */ @Test public void testCell() { TypeReference t = TypeReference.findOrCreate(ClassLoaderReference.Application, "Lcell/Cell"); MethodReference m = MethodReference.findOrCreate(t, "<init>", "(Ljava/lang/Object;)V"); Collection<IMethod> c = cha.getPossibleTargets(m); for (IMethod method : c) { System.err.println(method); } Assert.assertEquals(1, c.size()); }
public JavaEntityMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { super(owner, methodEntity.getQualifiers(), cfg, symtab, MethodReference.findOrCreate(owner.getReference(), Util .methodEntityToSelector(methodEntity)), hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo, JavaSourceLoaderImpl.this.getAnnotations(methodEntity)); this.parameterTypes = computeParameterTypes(methodEntity); this.exceptionTypes = computeExceptionTypes(methodEntity); }
@Override public void visitInvoke(IInvokeInstruction instruction) { IClassLoader loader = getDeclaringClass().getClassLoader(); MethodReference m = MethodReference.findOrCreate(loader.getLanguage(), loader.getReference(), instruction.getClassType(), instruction.getMethodName(), instruction.getMethodSignature()); int programCounter = 0; programCounter = getProgramCounter(); CallSiteReference site = null; site = CallSiteReference.make(programCounter, m, instruction.getInvocationCode()); callSites.add(site); }
private MethodReference computeMethodReference() { try { Atom name = Atom.findOrCreateUnicodeAtom(getMethodName()); ImmutableByteArray desc = ImmutableByteArray.make(getMethodSignature()); Descriptor D = Descriptor.findOrCreate(declaringClass.getClassLoader().getLanguage(), desc); return MethodReference.findOrCreate(declaringClass.getReference(), name, D); } catch (InvalidClassFileException e) { Assertions.UNREACHABLE(); return null; } }
private MethodReference computeMethodReference() { try { Atom name = Atom.findOrCreateUnicodeAtom(getMethodName()); ImmutableByteArray desc = ImmutableByteArray.make(getMethodSignature()); Descriptor D = Descriptor.findOrCreate(declaringClass.getClassLoader().getLanguage(), desc); return MethodReference.findOrCreate(declaringClass.getReference(), name, D); } catch (InvalidClassFileException e) { Assertions.UNREACHABLE(); return null; } }