• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // Push all callee-saved registers to get them on the stack for conservative
6 // stack scanning.
7 
8 // See asm/x64/push_registers_clang.cc for why the function is not generated
9 // using clang.
10 
11 // Do not depend on V8_TARGET_OS_* defines as some embedders may override the
12 // GN toolchain (e.g. ChromeOS) and not provide them.
13 
14 // S390 ABI source:
15 // http://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_zSeries.html
16 asm(".globl PushAllRegistersAndIterateStack             \n"
17     ".type PushAllRegistersAndIterateStack, %function   \n"
18     ".hidden PushAllRegistersAndIterateStack            \n"
19     "PushAllRegistersAndIterateStack:                   \n"
20     // Push all callee-saved registers.
21     // r6-r13, r14 and sp(r15)
22     "  stmg %r6, %sp, 48(%sp)                           \n"
23     // Allocate frame.
24     "  lay %sp, -160(%sp)                               \n"
25     // Pass 1st parameter (r2) unchanged (Stack*).
26     // Pass 2nd parameter (r3) unchanged (StackVisitor*).
27     // Save 3rd parameter (r4; IterateStackCallback).
28     "  lgr %r5, %r4                                     \n"
29     // Pass sp as 3rd parameter. 160+48 to point
30     // to callee saved region stored above.
31     "  lay %r4, 208(%sp)                                \n"
32     // Call the callback.
33     "  basr %r14, %r5                                   \n"
34     "  lmg %r14,%sp, 272(%sp)                           \n"
35     "  br %r14                                          \n");
36