diff options
| author | Drahflow <drahflow@gmx.de> | 2019-08-07 21:26:23 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2019-08-07 21:26:23 +0200 |
| commit | d78f3ade1e47e09fc7bc8c9b8473a15d9a916482 (patch) | |
| tree | 5bbc0b760c07c587ee538ed2dd7ae9283c5cf56d /compiler | |
| parent | cfefa2999e22f721619f0f8f84deef7db7beabe5 (diff) | |
Mark top of stack
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/elymasAsm.ey | 3 | ||||
| -rw-r--r-- | compiler/elymasAsmLib.ey | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/elymasAsm.ey b/compiler/elymasAsm.ey index e792b21..110080e 100644 --- a/compiler/elymasAsm.ey +++ b/compiler/elymasAsm.ey @@ -5,6 +5,7 @@ 16 ==STACKSTART 6148914691236517205 ==STACKBOTTOMMARKER + 6148914691236517206 ==STACKTOPMARKER 4 ==ERRORMARKER 3 ==HASHPOSITIONS # number of positions to probe on collisions @@ -68,6 +69,7 @@ # stack layout # %0 : stack size # %8 : current stack pointer + # %10 : stack top marker # ... : real stack # <end> : stack bottom marker [ /bootStack /bootCallStack ] { @@ -78,6 +80,7 @@ [ PAGESIZE imm64 stack .base PAGESIZE add 8 sub imm64 + STACKTOPMARKER imm64 ] { i sys .asm .poke i 1 add =i } each stack .base PAGESIZE add 8 sub =i diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey index 72d0a71..696609d 100644 --- a/compiler/elymasAsmLib.ey +++ b/compiler/elymasAsmLib.ey @@ -764,6 +764,7 @@ /markObject :callqLbl32 # start from stack and mark all reachable blocks + # TODO: validate current stack has a STACKTOPMARKER :STACKBOTTOMMARKER /rcx :movqImmReg /rsi :popqReg # load original stack pointer /rsi :pushqReg @@ -1949,6 +1950,8 @@ :STACKBOTTOMMARKER /rdx :movqImmReg /rdx /rdi :movqRegMem /rdi 8 /rax :movqRegMemDisp8 + :STACKTOPMARKER /rdx :movqImmReg + /rdx 16 /rax :movqRegMemDisp8 :retn ] /internalAllocateStack defv |
