runtime (gc): scan callee-saved registers while marking stack

This commit is contained in:
Jaden Weiss
2020-04-02 08:22:17 -04:00
committed by Ron Evans
parent cbaa58a2d9
commit 9f8715c143
8 changed files with 152 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
.section .text.tinygo_scanCurrentStack
.global tinygo_scanCurrentStack
.type tinygo_scanCurrentStack, %function
tinygo_scanCurrentStack:
// Push callee-saved registers onto the stack.
addi sp, sp, -64
sw ra, 60(sp)
sw s11, 56(sp)
sw s10, 52(sp)
sw s9, 48(sp)
sw s8, 44(sp)
sw s7, 40(sp)
sw s6, 36(sp)
sw s5, 32(sp)
sw s4, 28(sp)
sw s3, 24(sp)
sw s2, 20(sp)
sw s1, 16(sp)
sw s0, 12(sp)
// Scan the stack.
mv a0, sp
call tinygo_scanstack
// Restore stack state.
addi sp, sp, 64
// Return to the caller.
ret