New partly working cell model

This commit is contained in:
2026-10-07 16:41:33 +00:00
parent 44498b32a9
commit 2b612d19ed
14 changed files with 981 additions and 1902 deletions
+9 -15
View File
@@ -118,10 +118,11 @@ impl RegFn {
}
}
// A define_field into an object that no creating op of this fn gave
// (a class field on `this`, a static field on the class) is a write
// like any other: a put_field. So a define_field is always a write
// that builds an object before it goes anywhere (see infer)
// A define_field into an object that no op of this fn made (a class
// field on `this`, a static field on the class) is a write like any
// other: a put_field. So a define_field is always a write into an
// object before it goes anywhere, and its field is never absent (see
// `Cell::write()` in infer)
let mut created = vec![false; next_val];
for instr in &out {
@@ -265,17 +266,10 @@ fn walk_block(
continue;
}
// A field or element write lands back in the object's own value: the
// object with the field is the same object. define_field also leaves
// it on the stack, put_field and put_array_el do not
if matches!(instr.op, OpCode::PutField | OpCode::DefineField | OpCode::PutArrayEl) {
let obj = *out_instr.args.last().unwrap();
if n_push == 1 {
stack.push(obj);
}
out_instr.dsts.push(obj);
// define_field leaves the object it wrote on the stack: the same value,
// not a new one
if instr.op == OpCode::DefineField {
stack.push(out_instr.args[1]);
out[instr_idx] = out_instr;
continue;
}