1/** 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16.global ExecuteImplStub 17.type ExecuteImplStub, %function 18.balign 16 19/* parameter: 20 * r0 thread 21 * r1 PC 22 * r2 I-frame 23 * r3 jump_to_eh 24 * [sp] impl 25 */ 26ExecuteImplStub: 27 .cfi_startproc 28 .fnstart 29 30 push {r4, r5, lr} 31 .cfi_adjust_cfa_offset 12 32 .cfi_rel_offset r4, 0 33 .cfi_rel_offset r5, 4 34 .cfi_rel_offset lr, 8 35 // align to 8 36 sub sp, sp, #4 37 .cfi_adjust_cfa_offset 4 38 39 mov r4, r1 40 /* 41 * Using CFI opcode to get the interpreter PC from 42 * saved register with offset. 43 * 44 * 0x16 DW_CFA_val_expression 45 * 0 tempReg 46 * 0x09 size of expression 47 * 0x0C DW_OP_const4u 48 * 0x41, 0x45, 0x58, 0x31 magic = "AEX1" 49 * 0x13 DW_OP_drop 50 * 0x92 DW_OP_bregx 51 * 4 the register which store interpreter PC 52 * 0 offset 53 */ 54 .cfi_escape 0x16, 0x0, 0x09, 0x0C, 0x41, 0x45, 0x58, 0x31, 0x13, 0x92, 4, 0x0 55 56 ldr r5, [sp, #16] // 5th argument 57 blx r5 58 add sp, sp, #4 59 .cfi_adjust_cfa_offset -4 60 pop {r4, r5, pc} 61 .cfi_adjust_cfa_offset -12 62 .cfi_restore r4 63 .cfi_restore r5 64 .cfi_restore pc 65 66 .fnend 67 .cfi_endproc 68 69