This commit is contained in:
Kartik Agaram 2020-06-03 00:27:01 -07:00
parent e38a95ecd9
commit 69a29fc62c
2 changed files with 7 additions and 5 deletions

BIN
apps/mu

Binary file not shown.

View File

@ -8063,6 +8063,9 @@ emit-subx-function: # out: (addr buffered-file), f: (addr function)
50/push-eax
51/push-ecx
52/push-edx
# initialize some global state
c7 0/subop/copy *Curr-block-depth 1/imm32
c7 0/subop/copy *Curr-local-stack-offset 0/imm32
# ecx = f
8b/-> *(ebp+0xc) 1/r32/ecx
# var vars/edx: (stack (addr var) 256)
@ -8070,16 +8073,15 @@ emit-subx-function: # out: (addr buffered-file), f: (addr function)
68/push 0x800/imm32/size
68/push 0/imm32/top
89/<- %edx 4/r32/esp
#
# var name/eax: (addr array byte) = lookup(f->name)
(lookup *ecx *(ecx+4)) # Function-name Function-name => eax
#
(write-buffered *(ebp+8) %eax)
(write-buffered *(ebp+8) ":\n")
# initialize some global state
c7 0/subop/copy *Curr-block-depth 1/imm32
c7 0/subop/copy *Curr-local-stack-offset 0/imm32
#
(emit-subx-prologue *(ebp+8))
# var body/eax: (addr block) = lookup(f->body)
(lookup *(ecx+0x18) *(ecx+0x1c)) # Function-body Function-body => eax
#
(emit-subx-block *(ebp+8) %eax %edx)
(emit-subx-epilogue *(ebp+8))
# TODO: validate that *Curr-block-depth and *Curr-local-stack-offset have