OP_MONITOR_EXIT.S revision f3e177289ac078f18401cfd8eebafe584dd0d01f
1f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project%verify "executed"
2f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project%verify "exception for null object (impossible in javac)"
3f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project%verify "dvmUnlockObject fails"
4f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    /*
5f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     * Unlock an object.
6f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     *
7f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     * Exceptions that occur when unlocking a monitor need to appear as
8f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     * if they happened at the following instruction.  See the Dalvik
9f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     * instruction spec.
10f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project     */
11f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    /* monitor-exit vAA */
12f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    GET_VREG_R %eax rINST
13f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    movl    rGLUE,%ecx
14f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    EXPORT_PC
15f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    testl   %eax,%eax                   # null object?
16668628abe05cb30f86bd02c824f7219a7e20b82cBill Buzbee    je      .L${opcode}_errNullObject   # go if so
17f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    movl    offGlue_self(%ecx),%ecx     # ecx<- glue->self
18f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    movl    %eax,OUT_ARG1(%esp)
19f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    movl    %ecx,OUT_ARG0(%esp)
20f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    jmp     .L${opcode}_continue
21f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project%break
22f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project
23f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project.L${opcode}_continue:
24f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    call    dvmUnlockObject             # unlock(self,obj)
25f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    FETCH_INST_OPCODE 1 %edx
26f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project    testl   %eax,%eax                   # success?
27f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    ADVANCE_PC 1
28668628abe05cb30f86bd02c824f7219a7e20b82cBill Buzbee    je      common_exceptionThrown      # no, exception pending
29f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    GOTO_NEXT_R %edx
30668628abe05cb30f86bd02c824f7219a7e20b82cBill Buzbee.L${opcode}_errNullObject:
31f3e177289ac078f18401cfd8eebafe584dd0d01fbuzbee    ADVANCE_PC 1                        # advance before throw
32668628abe05cb30f86bd02c824f7219a7e20b82cBill Buzbee    jmp     common_errNullObject
33