optimize codes: store upvalue on stack & debugger now can output information of registers

This commit is contained in:
ValKmjolnir
2022-05-20 21:19:43 +08:00
parent 120ceb429a
commit 07eeaadf96
6 changed files with 108 additions and 53 deletions
+8
View File
@@ -1386,6 +1386,8 @@ When `op_callb` is called, the stack frame is like this:
+----------------------------+
| old localr(vm_addr) | <- top[-1]
+----------------------------+
| old upvalr(vm_upval) | <- top[-2]
+----------------------------+
| local scope(nasal_ref) |
| ... |
+----------------------------+ <- local pointer stored in localr
@@ -1403,6 +1405,8 @@ In `op_callb`'s progress, next step the stack frame is:
+----------------------------+
| old localr(vm_addr) |
+----------------------------+
| old upvalr(vm_upval) |
+----------------------------+
| local scope(nasal_ref) |
| ... |
+----------------------------+ <- local pointer stored in localr
@@ -1435,6 +1439,8 @@ but where is the returned `local[1]` sent?
+----------------------------+
| old localr(vm_addr) |
+----------------------------+
| old upvalr(vm_upval) |
+----------------------------+
| local scope(nasal_ref) |
| ... |
+----------------------------+ <- local pointer stored in localr
@@ -1453,6 +1459,8 @@ and the returned `local[1]` in fact is set to the top of the main stack by `op_c
+----------------------------+
| old localr(vm_addr) |
+----------------------------+
| old upvalr(vm_upval) |
+----------------------------+
| local scope(nasal_ref) |
| ... |
+----------------------------+ <- local pointer stored in localr