diff options
| author | Alan Wu <alanwu@ruby-lang.org> | 2026-01-19 15:17:11 -0500 |
|---|---|---|
| committer | Alan Wu <alanwu@ruby-lang.org> | 2026-01-19 15:17:11 -0500 |
| commit | 6f890976e0272d6d09b96232da06660ba674593e (patch) | |
| tree | f7d67d6e14a90a7652e7a55a1d9f3aab04aec7eb | |
| parent | 859920dfd272bc22670d779129a04cdf07632192 (diff) | |
JITs: Fix comment about ARM64 stack growth direction [ci skip]
| -rw-r--r-- | yjit/src/backend/arm64/mod.rs | 7 | ||||
| -rw-r--r-- | zjit/src/backend/arm64/mod.rs | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/yjit/src/backend/arm64/mod.rs b/yjit/src/backend/arm64/mod.rs index 4486b46e36..0521e09d0b 100644 --- a/yjit/src/backend/arm64/mod.rs +++ b/yjit/src/backend/arm64/mod.rs @@ -878,14 +878,13 @@ impl Assembler } } - /// Emit a push instruction for the given operand by adding to the stack - /// pointer and then storing the given value. + /// Push a value to the stack by subtracting from the stack pointer then storing, + /// leaving an 8-byte gap for alignment. fn emit_push(cb: &mut CodeBlock, opnd: A64Opnd) { str_pre(cb, opnd, A64Opnd::new_mem(64, C_SP_REG, -C_SP_STEP)); } - /// Emit a pop instruction into the given operand by loading the value - /// and then subtracting from the stack pointer. + /// Pop a value from the stack by loading `[sp]` then adding to the stack pointer. fn emit_pop(cb: &mut CodeBlock, opnd: A64Opnd) { ldr_post(cb, opnd, A64Opnd::new_mem(64, C_SP_REG, C_SP_STEP)); } diff --git a/zjit/src/backend/arm64/mod.rs b/zjit/src/backend/arm64/mod.rs index 55a65e3ea6..0ef22be631 100644 --- a/zjit/src/backend/arm64/mod.rs +++ b/zjit/src/backend/arm64/mod.rs @@ -1086,14 +1086,13 @@ impl Assembler { gc_offsets.push(ptr_offset); } - /// Emit a push instruction for the given operand by adding to the stack - /// pointer and then storing the given value. + /// Push a value to the stack by subtracting from the stack pointer then storing, + /// leaving an 8-byte gap for alignment. fn emit_push(cb: &mut CodeBlock, opnd: A64Opnd) { str_pre(cb, opnd, A64Opnd::new_mem(64, C_SP_REG, -C_SP_STEP)); } - /// Emit a pop instruction into the given operand by loading the value - /// and then subtracting from the stack pointer. + /// Pop a value from the stack by loading `[sp]` then adding to the stack pointer. fn emit_pop(cb: &mut CodeBlock, opnd: A64Opnd) { ldr_post(cb, opnd, A64Opnd::new_mem(64, C_SP_REG, C_SP_STEP)); } |
