Home | History | Annotate | Download | only in interp

Lines Matching refs:method

18  * Stacks and their uses (e.g. native --> interpreted method calls).
44 * We're calling an interpreted method from an internal VM function or
47 * Push a frame for an interpreted method onto the stack. This is only
59 static bool dvmPushInterpFrame(Thread* self, const Method* method)
66 assert(!dvmIsNativeMethod(method));
67 assert(!dvmIsAbstractMethod(method));
69 stackReq = method->registersSize * 4 // params + locals
71 + method->outsSize * 4; // args to other methods
83 self->interpStackSize, method->clazz->descriptor, method->name);
84 dvmHandleStackOverflow(self, method);
95 stackPtr -= method->registersSize * 4 + sizeof(StackSaveArea);
100 memset(stackPtr - (method->outsSize*4), 0xaf, stackReq);
111 breakSaveBlock->method = NULL;
115 saveBlock->method = method;
127 * We're calling a JNI native method from an internal VM fuction or
128 * via reflection. This is also used to create the "fake" native-method
135 bool dvmPushJNIFrame(Thread* self, const Method* method)
142 assert(dvmIsNativeMethod(method));
144 stackReq = method->registersSize * 4 // params only
157 self->interpStackSize, method->name);
158 dvmHandleStackOverflow(self, method);
166 * We leave space for the method args, which are copied in later.
170 stackPtr -= method->registersSize * 4 + sizeof(StackSaveArea);
190 breakSaveBlock->method = NULL;
194 saveBlock->method = method;
211 bool dvmPushLocalFrame(Thread* self, const Method* method)
217 assert(dvmIsNativeMethod(method));
229 self->interpStackSize, method->name);
230 dvmHandleStackOverflow(self, method);
254 saveBlock->method = method;
269 * an interpreted frame. Either way, the method pointer won't match.
276 if (saveBlock->method != SAVEAREA_FROM_FP(saveBlock->prevFrame)->method) {
278 * The previous frame doesn't have the same method pointer -- we've
283 SAVEAREA_FROM_FP(saveBlock->prevFrame)->method));
288 saveBlock->method->name,
289 SAVEAREA_FROM_FP(saveBlock->prevFrame)->method->name);
297 * Pop a frame we added. There should be one method frame and one break
301 * popping multiple method frames before we find the break.
319 while (saveBlock->prevFrame != NULL && saveBlock->method != NULL) {
322 if (dvmIsNativeMethod(saveBlock->method)) {
324 saveBlock->method->clazz->descriptor,
325 saveBlock->method->name,
326 (SAVEAREA_FROM_FP(saveBlock->prevFrame)->method == NULL) ?
333 if (saveBlock->method != NULL) {
351 static ClassObject* callPrep(Thread* self, const Method* method, Object* obj,
360 method->clazz->descriptor, method->name);
365 assert(method != NULL);
370 clazz = method->clazz;
373 char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
375 clazz->descriptor, method->name, desc);
380 /* needed for java.lang.reflect.Method.invoke */
382 method))
385 dvmThrowIllegalAccessException("access to method denied");
396 if (dvmIsNativeMethod(method)) {
398 if (!dvmPushJNIFrame(self, method)) {
404 if (!dvmPushInterpFrame(self, method)) {
414 * Issue a method call.
420 void dvmCallMethod(Thread* self, const Method* method, Object* obj,
425 dvmCallMethodV(self, method, obj, false, pResult, args);
430 * Issue a method call with a variable number of arguments. We process
431 * the contents of "args" by scanning the method signature.
438 void dvmCallMethodV(Thread* self, const Method* method, Object* obj,
441 const char* desc = &(method->shorty[1]); // [0] is the return type.
446 clazz = callPrep(self, method, obj, false);
452 (method->registersSize - method->insSize);
457 if (!dvmIsStaticMethod(method)) {
502 if (verifyCount != method->insSize) {
504 method->insSize, clazz->descriptor, method->name);
512 if (dvmIsNativeMethod(method)) {
513 TRACE_METHOD_ENTER(self, method);
516 * directly at the method arguments.
518 (*method->nativeFunc)((u4*)self->interpSave.curFrame, pResult,
519 method, self);
520 TRACE_METHOD_EXIT(self, method);
522 dvmInterpret(self, method, pResult);
532 * Issue a method call with arguments provided in an array. We process
533 * the contents of "args" by scanning the method signature.
542 * "args" may be NULL if the method has no arguments.
544 void dvmCallMethodA(Thread* self, const Method* method, Object* obj,
547 const char* desc = &(method->shorty[1]); // [0] is the return type.
552 clazz = callPrep(self, method, obj, false);
558 (method->registersSize - method->insSize);
561 if (!dvmIsStaticMethod(method)) {
599 *(desc-1), clazz->descriptor, method->name);
609 if (verifyCount != method->insSize) {
611 method->insSize, clazz->descriptor, method->name);
617 if (dvmIsNativeMethod(method)) {
618 TRACE_METHOD_ENTER(self, method);
621 * directly at the method arguments.
623 (*method->nativeFunc)((u4*)self->interpSave.curFrame, pResult,
624 method, self);
625 TRACE_METHOD_EXIT(self, method);
627 dvmInterpret(self, method, pResult);
642 * Invoke a method, using the specified arguments and return type, through
643 * one of the reflection interfaces. Could be a virtual or direct method
648 * "invokeObj" will be null for a static method.
652 Object* dvmInvokeMethod(Object* obj, const Method* method,
676 clazz = callPrep(self, method, obj, !noAccessCheck);
683 (method->registersSize - method->insSize);
689 if (!dvmIsStaticMethod(method)) {
715 if (verifyCount != method->insSize) {
717 method->insSize, clazz->descriptor, method->name);
723 if (dvmIsNativeMethod(method)) {
724 TRACE_METHOD_ENTER(self, method);
727 * directly at the method arguments.
729 (*method->nativeFunc)((u4*)self->interpSave.curFrame, &retval,
730 method, self);
731 TRACE_METHOD_EXIT(self, method);
733 dvmInterpret(self, method, &retval);
745 * because the invoked method could have thrown a checked exception
755 * If this isn't a void method or constructor, convert the return type
800 * "pc" is an offset, in 16-bit units, from the start of the method's code.
806 int dvmLineNumFromPC(const Method* method, u4 relPc)
808 const DexCode* pDexCode = dvmGetMethodCode(method);
811 if (dvmIsNativeMethod(method) && !dvmIsAbstractMethod(method))
813 return -1; /* can happen for abstract method stub */
819 // A method with no line number info should return -1
822 dexDecodeDebugInfo(method->clazz->pDvmDex->pDexFile, pDexCode,
823 method->clazz->descriptor,
824 method->prototype.protoIdx,
825 method->accessFlags,
884 * If we got here by java.lang.reflect.Method.invoke(), we don't
885 * want to return Method's class loader. Shift up one and try
889 if (dvmIsReflectionMethod(saveArea->method)) {
912 return SAVEAREA_FROM_FP(caller)->method->clazz;
919 * class loader of the method that called it.
936 return SAVEAREA_FROM_FP(callerCaller)->method->clazz;
943 * class loader of the method that called it.
962 return SAVEAREA_FROM_FP(caller)->method->clazz;
972 void dvmFillStackTraceArray(const void* fp, const Method** array, size_t length)
980 array[i++] = SAVEAREA_FROM_FP(fp)->method;
997 void dvmHandleStackOverflow(Thread* self, const Method* method)
1015 method->clazz->descriptor, method->name, method->shorty);
1017 LOGI(" method requires %d+%d+%d=%d bytes, fp is %p (%d left)",
1018 method->registersSize * 4, sizeof(StackSaveArea), method->outsSize * 4,
1019 (method->registersSize + method->outsSize) * 4 + sizeof(StackSaveArea),
1094 const Method* method = saveArea->method;
1097 /* check Method* */
1098 if (!dvmLinearAllocContains(method, sizeof(Method))) {
1099 LOGD("ExtrMon: method %p not valid", method);
1104 u4 insnsSize = dvmGetMethodInsnsSize(method);
1105 if (currentPc < method->insns ||
1106 currentPc >= method->insns + insnsSize)
1109 currentPc, method->insns, method->insns + insnsSize);
1122 if (reg >= method->registersSize) {
1124 reg, method->registersSize);
1174 * Each frame holds a pointer to the currently executing method, and the
1176 * we don't have the PC for the current method on the stack, which is
1187 const Method* method;
1212 method = saveArea->method;
1220 relPc = currentPc - saveArea->method->insns;
1224 std::string methodName(dvmHumanReadableMethod(method, false));
1225 if (dvmIsNativeMethod(method)) {
1226 dvmPrintDebugMessage(target, " at %s(Native Method)\n",
1230 methodName.c_str(), dvmGetMethodSourceFile(method),
1232 relPc < 0 ? -1 : dvmLineNumFromPC(method, relPc));