Lines Matching refs:Method
25 * such as Method and Annotation. Another source of pain comes from the
217 * An annotation in "clazz" refers to a method by index. This just gives
218 * us the name of the class and the name and signature of the method. We
219 * need to find the method's class, and then find the method within that
220 * class. If the method has been resolved before, we can just use the
223 * Normally we do this as part of method invocation in the interpreter, which
225 * to initialize the class because it's a static method, etc. We don't have
228 * Returns NULL if the method was not found (exception may be pending).
230 static Method* resolveAmbiguousMethod(const ClassObject* referrer, u4 methodIdx)
234 Method* resMethod;
238 /* if we've already resolved this method, return it */
252 /* method is part of an interface -- not expecting that */
253 LOGD("resolveAmbiguousMethod: method in interface?");
257 // TODO - consider a method access flag that indicates direct vs. virtual
303 * "pValue", and indexed values like String and Method are returned as
442 Method* meth = resolveAmbiguousMethod(clazz, idx);
675 /* find the method in the annotation class, given only the name */
677 Method* annoMeth = dvmFindVirtualMethodByName(annoClass, name);
728 * method we call is:
1299 * Get the EnclosingMethod attribute from an annotation. Returns a Method
1320 * The EnclosingMethod annotation has one member, "Method value".
1402 * We could create a java.lang.reflect.Method object and extract the
1431 /* pull out the method index and resolve the method */
1432 Method* meth = resolveAmbiguousMethod(clazz, avalue.value.i);
1555 * Method (and Constructor)
1560 * Compare the attributes (class name, method name, method signature) of
1561 * the specified method to "method".
1564 const Method* method)
1568 int result = strcmp(str, method->clazz->descriptor);
1572 result = strcmp(str, method->name);
1576 result = dexProtoCompare(&proto, &method->prototype);
1584 * Given a method, determine the method's index.
1586 * We could simply store this in the Method*, but that would cost 4 bytes
1587 * per method. Instead we plow through the DEX data.
1589 * We have two choices: look through the class method data, or look through
1590 * the global method_ids table. The former is awkward because the method
1595 static u4 getMethodIdx(const Method* method)
1597 DexFile* pDexFile = method->clazz->pDvmDex->pDexFile;
1606 cmp = compareMethodStr(pDexFile, cur, method);
1617 /* this should be impossible -- the method came out of this DEX */
1618 char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
1619 LOGE("Unable to find method %s.%s %s in DEX file!",
1620 method->clazz->descriptor, method->name, desc);
1629 * Find the DexAnnotationSetItem for this method.
1634 const Method* method)
1636 ClassObject* clazz = method->clazz;
1651 * Run through the list and find a matching method. We compare the
1652 * method ref indices in the annotation list with the method's DEX
1658 * find the method definition in the DEX file and perform string
1659 * comparisons on class name, method name, and signature.
1661 u4 methodIdx = getMethodIdx(method);
1680 * Return an array of Annotation objects for the method. Returns an empty
1687 ArrayObject* dvmGetMethodAnnotations(const Method* method)
1689 ClassObject* clazz = method->clazz;
1693 pAnnoSet = findAnnotationSetForMethod(method);
1707 Object* dvmGetMethodAnnotation(const ClassObject* clazz, const Method* method,
1710 const DexAnnotationSetItem* pAnnoSet = findAnnotationSetForMethod(method);
1722 const Method* method, const ClassObject* annotationClazz)
1724 const DexAnnotationSetItem* pAnnoSet = findAnnotationSetForMethod(method);
1739 ArrayObject* dvmGetMethodSignatureAnnotation(const Method* method)
1741 ClassObject* clazz = method->clazz;
1745 pAnnoSet = findAnnotationSetForMethod(method);
1754 * for this method.
1758 * Returns NULL if we don't find any exceptions for this method.
1760 ArrayObject* dvmGetMethodThrows(const Method* method)
1762 ClassObject* clazz = method->clazz;
1766 /* find the set for this method */
1767 pAnnoSet = findAnnotationSetForMethod(method);
1769 return NULL; /* nothing for this method */
1790 * Given an Annotation's method, find the default value, if any.
1797 Object* dvmGetAnnotationDefaultValue(const Method* method)
1799 const ClassObject* clazz = method->clazz;
1805 * The method's declaring class (the annotation) will have an
1825 // method->clazz->descriptor, method->name);
1848 * entry whose name matches our method name.
1851 ptr = searchEncodedAnnotation(clazz, ptr, method->name);
1853 return NULL; /* no default annotation for this method */
1859 method->name);
1864 ClassObject* methodReturn = dvmGetBoxedReturnType(method);
2113 const Method* method)
2115 ClassObject* clazz = method->clazz;
2133 * Run through the list and find a matching method. We compare the
2134 * method ref indices in the annotation list with the method's DEX
2140 * find the method definition in the DEX file and perform string
2141 * comparisons on class name, method name, and signature.
2143 u4 methodIdx = getMethodIdx(method);
2159 * Count up the number of arguments the method takes. The "this" pointer
2162 static int countMethodArguments(const Method* method)
2164 /* method->shorty[0] is the return type */
2165 return strlen(method->shorty + 1);
2170 * one entry per method parameter, the inner array has the list of annotations
2173 * If the method has no parameters, we return an array of length zero. If
2174 * the method has one or more parameters, we return an array whose length
2180 ArrayObject* dvmGetParameterAnnotations(const Method* method)
2182 ClassObject* clazz = method->clazz;
2186 pItem = findAnnotationsItemForMethod(method);
2197 annoArrayArray = emptyAnnoArrayArray(countMethodArguments(method));