blob: c26585d3c6d75339b95dc82a27fd9c7e2bea7918 [file] [log] [blame]
HANDLE_OPCODE(OP_MONITOR_EXIT /*vAA*/)
{
Object* obj;
EXPORT_PC();
vsrc1 = INST_AA(inst);
ILOGV("|monitor-exit v%d %s(0x%08x)",
vsrc1, kSpacing+5, GET_REGISTER(vsrc1));
obj = (Object*)GET_REGISTER(vsrc1);
if (!checkForNull(obj)) {
/*
* The exception needs to be processed at the *following*
* instruction, not the current instruction (see the Dalvik
* spec). Because we're jumping to an exception handler,
* we're not actually at risk of skipping an instruction
* by doing so.
*/
ADJUST_PC(1); /* monitor-exit width is 1 */
GOTO_exceptionThrown();
}
ILOGV("+ unlocking %p %s", obj, obj->clazz->descriptor);
if (!dvmUnlockObject(self, obj)) {
assert(dvmCheckException(self));
ADJUST_PC(1);
GOTO_exceptionThrown();
}
}
FINISH(1);
OP_END