• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2021-2022 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#define xlr x30
17
18.global ExecuteImplStub
19.type ExecuteImplStub, %function
20/* parameter:
21 * x0 thread
22 * x1 PC
23 * x2 I-frame
24 * x3 impl
25 */
26ExecuteImplStub:
27    .cfi_startproc
28    stp x20, xlr, [sp, #-16]!
29    .cfi_adjust_cfa_offset 16
30    .cfi_rel_offset x20, 0
31    .cfi_rel_offset xlr, 8
32    /*
33     * Using CFI opcode to get the interpreter PC from
34     * saved register with offset.
35     *
36     * 0x16 DW_CFA_val_expression
37     * 0    tempReg
38     * 0x09 size of expression
39     * 0x0C DW_OP_const4u
40     * 0x41, 0x45, 0x58, 0x31 magic = "AEX1"
41     * 0x13 DW_OP_drop
42     * 0x92 DW_OP_bregx
43     * 20   the register which store interpreter PC
44     * 0    offset
45     */
46    .cfi_escape 0x16, 0, 0x09, 0x0C, 0x41, 0x45, 0x58, 0x31, 0x13, 0x92, 20, 0
47
48    mov x20, x1
49    blr x3
50
51    ldp x20, xlr, [sp], #16
52    .cfi_restore x20
53    .cfi_restore xlr
54    .cfi_adjust_cfa_offset -16
55    ret
56    .cfi_endproc
57
58#undefine xlr
59