1 # extern int _rb_wasm_setjmp_internal(rb_wasm_jmp_buf *env);
2 .functype _rb_wasm_setjmp_internal (i32) -> (i32)
3 # extern int __stack_pointer;
4 .globaltype __stack_pointer, i32
6 # A wrapper of _rb_wasm_setjmp_internal to save and restore stack pointer
7 # This cannot be implemented in C because there is no way to manipulate stack pointer
10 # extern int _rb_wasm_setjmp(rb_wasm_jmp_buf *env);
11 .section .text._rb_wasm_setjmp,"",@
12 .globl _rb_wasm_setjmp
13 .type _rb_wasm_setjmp,@function
15 .functype _rb_wasm_setjmp (i32) -> (i32)
17 # save sp (this local is stored in asyncify stack and restored when rewinding)
18 global.get __stack_pointer
22 call _rb_wasm_setjmp_internal
26 global.set __stack_pointer