1
+ ; Copyright 2020 the V8 project authors. All rights reserved.
2
+ ; Use of this source code is governed by a BSD-style license that can be
3
+ ; found in the LICENSE file.
4
+
5
+ ; This file is exactly the same as push_registers_asm.cc, just formatted for
6
+ ; the Microsoft Arm Assembler.
7
+
8
+ AREA |.text| , CODE , ALIGN= 4 , READONLY
9
+ EXPORT PushAllRegistersAndIterateStack
10
+ PushAllRegistersAndIterateStack
11
+ ; x19-x29 are callee-saved
12
+ STP x19 , x20 , [ sp , # - 16 ] !
13
+ STP x21 , x22 , [ sp , # - 16 ] !
14
+ STP x23 , x24 , [ sp , # - 16 ] !
15
+ STP x25 , x26 , [ sp , # - 16 ] !
16
+ STP x27 , x28 , [ sp , # - 16 ] !
17
+ STP fp , lr , [ sp , # - 16 ] !
18
+ ; Maintain frame pointer
19
+ MOV fp , sp
20
+ ; Pass 1st parameter (x0) unchanged (Stack*).
21
+ ; Pass 2nd parameter (x1) unchanged (StackVisitor*).
22
+ ; Save 3rd parameter (x2; IterateStackCallback)
23
+ MOV x7 , x2
24
+ ; Pass 3rd parameter as sp (stack pointer)
25
+ MOV x2 , sp
26
+ BLR x7
27
+ ; Load return address
28
+ LDR lr , [ sp , # 8 ]
29
+ ; Restore frame pointer and pop all callee-saved registers.
30
+ LDR fp , [ sp ], # 96
31
+ RET
32
+ END
0 commit comments