diff options
| author | 2026-10-15 00:53:25 +0330 | |
|---|---|---|
| committer | 2026-10-15 00:53:25 +0330 | |
| commit | 0e333abab5d684be37043196b4c006b71bdf850e (patch) | |
| tree | d7e6664befd82268d2681c817542b3592bab379d /src/compiler/base.zc | |
| parent | bench: sieve.zc and trees.zc take namespace and include rt, so run.py's check... (diff) | |
| parent | todo: destructors item closed with what landed; what is left (reassignment fr... (diff) | |
merge work/dtor: destructors (drop on any heap value, heap(), struct drop, collector drops once with resurrection, freed blocks forget their drop)
Diffstat (limited to 'src/compiler/base.zc')
| -rw-r--r-- | src/compiler/base.zc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/base.zc b/src/compiler/base.zc index b326c80..88708f0 100644 --- a/src/compiler/base.zc +++ b/src/compiler/base.zc @@ -255,6 +255,10 @@ int fn_return_type; // a consistent return type inferred from the function body const int EF_READ = 1, EF_WRITE = 2, EF_RETAIN = 4, EF_CONSUME = 8, EF_UNKNOWN = 16, EF_ALIAS = 32, EF_IDENTITY = 64; word effect_symbols, effect_edges, effect_requirements, effect_current; int effect_floor, effect_argument_base; word local_origin, local_origin_mask, local_cell, local_captured, local_ended, local_end_info; word effect_value, argorigin_mask; int capture_enabled; word[1] capture_dummy; +// drops (docs/design/destructors.md): the code position just past a drop form (a fresh +// value with a drop still on the stack there), the type `this` gets in the next closure, +// a local whose drop is set, a mailbox send whose arguments are checked, and o3 block depth. +int drop_tail = -1, send_check, o3blk; word closure_this, local_dropset; int borrow_pending, borrow_depth, borrow_jump = -1, borrow_entry; word borrow_slots; int argorigin = -1, argtemporary, argowner = -1; word argowner_fact; int stubgen; // 1 while an extern's generated stub is compiled: the stub gets no hints @@ -748,6 +752,7 @@ int reserve_locals(int need) { if (local_origin) local_origin = chk_resize(local_origin, nloc, cap); if (local_origin_mask) local_origin_mask = chk_resize(local_origin_mask, nloc, cap); if (local_cell) local_cell = chk_resize(local_cell, nloc, cap); + if (local_dropset) local_dropset = chk_resize(local_dropset, nloc, cap); if (local_captured) local_captured = chk_resize(local_captured, nloc, cap); if (local_ended) local_ended = chk_resize(local_ended, nloc, cap); if (local_end_info) local_end_info = chk_resize(local_end_info, nloc, cap); |
