diff options
Diffstat (limited to 'include/data.s')
| -rw-r--r-- | include/data.s | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/include/data.s b/include/data.s index 8261881..51f31dc 100644 --- a/include/data.s +++ b/include/data.s @@ -5,10 +5,18 @@ _data_s_file: # Simple values and boxed machine integers # | ptr | value | CON_evacuate1: - retq + retq # TODO CON_scavenge1: add $0x10, %rsi retq + +# Format of the info tables: +# - code +# ----- code pointer +# - 8B helper information for eval/apply (generally this is 0, and only gets used for FUN/PAP) +# - 8B pointer to scavenge +# - 8B pointer to evacuate + INT_info_table: cell CON_evacuate1 cell CON_scavenge1 @@ -36,7 +44,7 @@ LIST_info_table: LIST_code: continue -# FUN/PAP combo objects +# FUN objects # | ptr | thunkptr | args | arg[0] | arg[1] | ... | arg[args] | FUN_evacuate: retq #TODO @@ -47,29 +55,44 @@ FUN_scavenge: add %rax, %rsi retq -# Simple info for n-ary functions -# TODO continue to add as required -fun1_info_table: +# Info tables for FUN objects. +FUN0_info_table: + cell FUN_evacuate + cell FUN_scavenge + cell 0 +FUN0_code: + continue + +FUN1_info_table: cell FUN_evacuate cell FUN_scavenge cell 1 -fun1_code: +FUN1_code: continue -fun2_info_table: +FUN2_info_table: cell FUN_evacuate cell FUN_scavenge cell 2 -fun2_code: +FUN2_code: continue -fun3_info_table: +FUN3_info_table: cell FUN_evacuate cell FUN_scavenge cell 3 -fun3_code: +FUN3_code: continue +FUN4_info_table: + cell FUN_evacuate + cell FUN_scavenge + cell 4 +FUN4_code: + continue + +# TODO: add more funN here as needed + # indirection (Q: how to recognize IND and THUNK on return?) # | ptr | indptr | IND_evacuate: @@ -97,3 +120,9 @@ THU_scavenge: retq .endif # _data_s_file + +# evacuate and scavenge: +# - evacuate just copies the object +# - scavenge evacuates all children (to the new location IF they are in the old +# location), changes the pointer, and moves the scavenge pointer to the next +# object (because everything needs to be scavenged) |
