aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/base.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 23:10:49 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 23:10:49 +0330
commit8af3174b04f18d858653ad70669dced71f5eaa99 (patch)
tree741ad2afd7cf3b39be763d17eea6a8c01c9101e7 /src/compiler/base.zc
parentdocs: destructors: clear drop entry and bits on free; planned reuse test (diff)
destructors: heap(v), drop(v, f) / v.drop(f) / v.drop = f, struct drop methods, collector drops after the sweep (once, resurrection), freed blocks forget their drop, temporaries drop at statement end with a hint, actor send check; o3: no collection inside a region (pending until the outermost exit), no drops set or ended inside o3; spec 3.11.6, 4.10.3-4, 6.15
Diffstat (limited to 'src/compiler/base.zc')
-rw-r--r--src/compiler/base.zc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/base.zc b/src/compiler/base.zc
index b326c80..2fcc7f7 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, an actor 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);