aboutsummaryrefslogtreecommitdiff
path: root/compiler/elymasGlobalSysAsm.ey
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-06-16 12:34:17 +0200
committerDrahflow <drahflow@gmx.de>2015-06-16 12:34:17 +0200
commit48033d4d5d654af91a4ba965aa30d64f047a9848 (patch)
treeabeb09e8206d39668f2e8151c0dc7762f1fe84cc /compiler/elymasGlobalSysAsm.ey
parentbb1350d1d6c02b5b58fee760420ad7d132524ab9 (diff)
FIXME resolved
Diffstat (limited to 'compiler/elymasGlobalSysAsm.ey')
-rw-r--r--compiler/elymasGlobalSysAsm.ey16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/elymasGlobalSysAsm.ey b/compiler/elymasGlobalSysAsm.ey
index e131e3e..e31ab74 100644
--- a/compiler/elymasGlobalSysAsm.ey
+++ b/compiler/elymasGlobalSysAsm.ey
@@ -580,7 +580,9 @@
# correct number of things from the stack to make the sys .freeze execution transparent
# TODO: actually do this (e.g. by recoding the freeze startup in assembly)
# TODO: ... for now just flush the call stack on freeze
- # returns the number of allocations according to frozen alloc list fill state
+ # returns
+ # 0 <- the number of allocations according to frozen alloc list fill state
+ # 1 <- the current heap size (to detect re-allocs during freeze)
[[
/rbx :popqReg
@@ -612,6 +614,18 @@
/rdx 101 /rax :movqRegMemDisp8
/r13 114 /rax :movqRegMemDisp8
+ ::heapSize /rdx :movqImmReg
+ /rdx /rdx :movqMemReg
+ /rdx :pushqReg # store heap size for later return value
+
+ ::internalAllocateInteger /rax :movqImmReg
+ /rax :callqReg
+ 8 /rax :popqMemDisp8 # save heap size to return integer
+
+ /rdx :popqReg
+ /rax :pushqReg
+ /rdx :pushqReg # shuffle stack to access alloc count
+
::internalAllocateInteger /rax :movqImmReg
/rax :callqReg
# type zero does not need to be changed