New partly working cell model
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user