Wrap alternative stack functions properly.

This commit is contained in:
losfair
2019-06-26 20:44:51 +08:00
parent 73ca597d73
commit a792ac6a48
6 changed files with 107 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
.globl run_on_wasm_stack
run_on_wasm_stack:
.globl run_on_alternative_stack
run_on_alternative_stack:
# (stack_end, stack_begin)
# We need to ensure 16-byte alignment here.
pushq %r15
@@ -10,7 +10,7 @@ pushq %rbx
pushq %rbp
movq %rsp, -16(%rdi)
leaq run_on_wasm_stack.returning(%rip), %rax
leaq run_on_alternative_stack.returning(%rip), %rax
movq %rax, -24(%rdi)
movq %rsi, %rsp
@@ -22,7 +22,7 @@ popq %r14
popq %r15
retq
run_on_wasm_stack.returning:
run_on_alternative_stack.returning:
movq (%rsp), %rsp
popq %rbp
popq %rbx