Bridge canonicalize: add PhiInst.lower_phi and LLVMConstInstructionBox.lower_const diff tests; ArrayBox.pop empty strict tag [array/empty/pop] + smoke; VM README: document [map/missing] and [array/empty/pop] tags

This commit is contained in:
nyash-codex
2025-11-02 11:47:58 +09:00
parent 4011fb2898
commit c81dc20d5c
6 changed files with 133 additions and 1 deletions

View File

@ -30,6 +30,12 @@ pub(super) fn try_handle_array_box(
if let Some(d) = dst { this.regs.insert(d, VMValue::Void); }
return Ok(true);
}
"pop" => {
if !args.is_empty() { return Err(VMError::InvalidInstruction("pop expects 0 args".into())); }
let ret = ab.pop();
if let Some(d) = dst { this.regs.insert(d, VMValue::from_nyash_box(ret)); }
return Ok(true);
}
"len" | "length" | "size" => {
let ret = ab.length();
if let Some(d) = dst { this.regs.insert(d, VMValue::from_nyash_box(ret)); }