Home | History | Annotate | Download | only in reflect

Lines Matching refs:Method

31 static bool returnTypesAreCompatible(Method* baseMethod, Method* subMethod);
32 static bool gatherMethods(ArrayObject* interfaces, Method*** pMethods,\
34 static int copyWithoutDuplicates(Method** allMethods, int allCount,
35 Method** outMethods, ArrayObject* throws);
36 static bool createExceptionClassList(const Method* method,
38 static void updateExceptionClassList(const Method* method, PointerSet* throws);
39 static void createConstructor(ClassObject* clazz, Method* meth);
40 static void createHandlerMethod(ClassObject* clazz, Method* dstMeth,
41 const Method* srcMeth);
43 const Method* method, Thread* self);
45 const Method* method, Thread* self);
46 static bool mustWrapException(const Method* method, const Object* throwable);
87 * - has one method for each method in the interfaces (for duplicates,
88 * the method in the earliest interface wins)
99 * method tables).
125 * Add direct method definitions. We have one (the constructor).
128 newClass->directMethods = (Method*) dvmLinearAlloc(newClass->classLoader,
129 1 * sizeof(Method));
134 * Add virtual method definitions.
141 Method **methods;
146 size_t virtualMethodsSize = methodCount * sizeof(Method);
148 (Method*)dvmLinearAlloc(newClass->classLoader, virtualMethodsSize);
173 * exceptions declared for each method.
231 * Generate a list of methods. The Method pointers returned point to the
232 * abstract method definition from the appropriate interface, or to the
233 * virtual method definition in java.lang.Object.
236 * method,so we can do some special handling of checked exceptions. The
239 static bool gatherMethods(ArrayObject* interfaces, Method*** pMethods,
244 Method** methods = NULL;
245 Method** allMethods = NULL;
275 methods = (Method**) malloc(maxCount * sizeof(*methods));
276 allMethods = (Method**) malloc(maxCount * sizeof(*methods));
316 * one entry per unique method, but it's convenient to allocate it
357 * first method whose return type is assignable from all other duplicate
362 * Then we want to return the method that returns subsub, since callers
363 * to any form of the method will get a usable object back.
368 * one entry per method in "outMethods". Methods that don't declare any
374 static int copyWithoutDuplicates(Method** allMethods, int allCount,
375 Method** outMethods, ArrayObject* throwLists)
384 * method is assignable from all others, we copy it to the new list,
388 * If there are no duplicates, we copy the method and NULL the entry.
418 * Duplicate method, check return type. If it's a primitive
436 * be thrown by all occurrences of the method.
466 * Update set to hold the intersection of method[i]'s
467 * and method[j]'s throws.
597 * "method". If no throws are declared, "*pSet" will be NULL.
601 static bool createExceptionClassList(const Method* method, PointerSet** pThrows)
606 exceptionArray = dvmGetMethodThrows(method);
635 * anything from "throws" that isn't in the method's list of throws.
642 static void updateExceptionClassList(const Method* method, PointerSet* throws)
648 ArrayObject* exceptionArray = dvmGetMethodThrows(method);
713 static bool returnTypesAreCompatible(Method* subMethod, Method* baseMethod)
735 static void createConstructor(ClassObject* clazz, Method* meth)
739 * be cloned from a method in a "real" DEX file. We declared the
740 * otherwise unused method Proxy.constructorPrototype() just for
760 * Create a method in our Proxy class with the name and signature of
761 * the interface method it implements.
763 static void createHandlerMethod(ClassObject* clazz, Method* dstMeth,
764 const Method* srcMeth)
782 * the number and types of values in "args" based on the method signature.
785 * Returns NULL if the method takes no arguments.
791 static ArrayObject* boxMethodArgs(const Method* method, const u4* args)
793 const char* desc = &method->shorty[1]; // [0] is the return type.
796 size_t argCount = dexProtoGetParameterCount(&method->prototype);
853 const Method* method, Thread* self)
864 * The method we're calling looks like:
865 * public Object invoke(Object proxy, Method method, Object[] args)
867 * This means we have to create a Method object, box our arguments into
872 const Method* method, Thread* self)
878 Method* invoke;
889 * Find the invoke() method, looking in "this"s class. (Because we
894 "(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
901 method->clazz->descriptor, method->name,
905 * Create a java.lang.reflect.Method object for this method.
907 * We don't want to use "method", because that's the concrete
908 * implementation in the proxy class. We want the abstract Method
914 methodObj = dvmCreateReflectMethodObject((Method*) method->insns);
925 returnType = dvmGetBoxedReturnType(method);
927 char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
936 * Convert "args" array into Object[] array, using the method
937 * signature to determine types. If the method takes no arguments,
940 argArray = boxMethodArgs(method, args+1);
945 * Call h.invoke(proxy, method, args).
958 if (mustWrapException(method, excep)) {
993 * Determine if it's okay for this method to throw this exception. If
995 * checked, we have to ensure that this method and all of its duplicates
998 static bool mustWrapException(const Method* method, const Object* throwable)
1003 const StaticField* sfield = &method->clazz->sfields[kThrowsField];
1006 int methodIndex = method - method->clazz->virtualMethods;
1007 assert(methodIndex >= 0 && methodIndex < method->clazz->virtualMethodCount);