more cleanup
This commit is contained in:
@ -291,15 +291,16 @@ def_Slice Byte
|
|||||||
; Usage: cf_end (call-frame end)
|
; Usage: cf_end (call-frame end)
|
||||||
; Tears down the stack frame, deallocating all memory and restoring the caller's frame.
|
; Tears down the stack frame, deallocating all memory and restoring the caller's frame.
|
||||||
%macro cf_end 0
|
%macro cf_end 0
|
||||||
; Deallocate the entire frame at once by resetting RSP to the saved RBP
|
mov rstack_ptr, rstack_base_ptr ; Deallocate the entire frame at once by resetting RSP to the saved RBP
|
||||||
mov rstack_ptr, rstack_base_ptr
|
pop rstack_base_ptr ; Restore the caller's frame pointer
|
||||||
; Restore the caller's frame pointer
|
|
||||||
pop rstack_base_ptr
|
|
||||||
%endmacro
|
%endmacro
|
||||||
|
; Usage: cf_ctbl <ctbl struc>
|
||||||
|
; Meant to only be used with call-table structs: <Symbol>_ctbl naming convention
|
||||||
%macro cf_ctbl 1
|
%macro cf_ctbl 1
|
||||||
cf
|
push rstack_base_ptr
|
||||||
cf_alloc %1 %+ _ctbl_size
|
mov rstack_base_ptr, rstack_ptr
|
||||||
cf_commit
|
sub rstack_ptr, %1 %+ _ctbl_size
|
||||||
|
and rstack_ptr, ~15
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
; Usage stac_alloc %1: <stack_offset>
|
; Usage stac_alloc %1: <stack_offset>
|
||||||
|
Reference in New Issue
Block a user