phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
@ -106,7 +106,7 @@ static box MiniVmPrints {
|
||||
// Prefer plugin result whenever JSON route ran
|
||||
local dbg = _trace_enabled()
|
||||
local printed = 0
|
||||
printed = printed // placeholder to keep structure; logic in .nyash retained
|
||||
printed = printed // placeholder to keep structure; logic in .hako retained
|
||||
return printed
|
||||
}
|
||||
process_if_once(json) { return new MiniVmPrints().process_if_once(json) }
|
||||
|
||||
@ -6,6 +6,7 @@ using selfhost.shared.json.utils.json_frag as JsonFragBox
|
||||
using selfhost.shared.common.string_helpers as StringHelpers
|
||||
using selfhost.vm.helpers.mini_mir_v1_scan as MiniMirV1Scan
|
||||
using selfhost.vm.hakorune-vm.extern_provider as HakoruneExternProviderBox
|
||||
using selfhost.vm.helpers.method_alias_policy as MethodAliasPolicy
|
||||
|
||||
static box MirCallV1HandlerBox {
|
||||
handle(seg, regs) {
|
||||
@ -30,10 +31,11 @@ static box MirCallV1HandlerBox {
|
||||
}
|
||||
// Per‑receiver or global length counter
|
||||
local per_recv = env.get("HAKO_VM_MIRCALL_SIZESTATE_PER_RECV"); if per_recv == null { per_recv = "0" }
|
||||
local key = "__vm_len"
|
||||
if StringHelpers.int_to_str(per_recv) == "1" {
|
||||
local rid = MiniMirV1Scan.receiver_id(seg)
|
||||
if rid != null { key = "__vm_len:" + (""+rid) }
|
||||
local rid = MiniMirV1Scan.receiver_id(seg)
|
||||
local key = MethodAliasPolicy.recv_len_key(per_recv, rid)
|
||||
if env.get("HAKO_VM_MIRCALL_TRACE") == "1" {
|
||||
local rid_s = rid == null ? "null" : (""+rid)
|
||||
print("[vm/method/trace:" + mname + ",recv=" + rid_s + ",key=" + key + "]")
|
||||
}
|
||||
local cur_len_raw = regs.getField(key); if cur_len_raw == null { cur_len_raw = "0" }
|
||||
local cur_len = JsonFragBox._str_to_int(cur_len_raw)
|
||||
@ -43,7 +45,7 @@ static box MirCallV1HandlerBox {
|
||||
local d1 = JsonFragBox.get_int(seg, "dst"); if d1 != null { regs.setField(StringHelpers.int_to_str(d1), "0") }
|
||||
return
|
||||
}
|
||||
if mname == "len" || mname == "length" || mname == "size" {
|
||||
if MethodAliasPolicy.is_size_alias(mname) == 1 {
|
||||
local d2 = JsonFragBox.get_int(seg, "dst"); if d2 != null { regs.setField(StringHelpers.int_to_str(d2), StringHelpers.int_to_str(cur_len)) }
|
||||
return
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// mir_vm_m2.nyash — Ny製の最小MIR(JSON v0)実行器(M2: const/binop/ret)
|
||||
// mir_vm_m2.hako — Ny製の最小MIR(JSON v0)実行器(M2: const/binop/ret)
|
||||
|
||||
using selfhost.shared.common.string_helpers as StringHelpers
|
||||
using selfhost.shared.common.string_ops as StringOps
|
||||
|
||||
@ -6,14 +6,13 @@
|
||||
using selfhost.shared.json.utils.json_frag as JsonFragBox
|
||||
using selfhost.shared.common.string_helpers as StringHelpers
|
||||
using selfhost.shared.json.core.json_cursor as JsonCursorBox
|
||||
using selfhost.vm.hakorune-vm.str_cast as StrCast
|
||||
|
||||
static box RetResolveSimpleBox {
|
||||
_to_i64(s) { return StringHelpers.to_i64(s) }
|
||||
_load_reg(regs, id) {
|
||||
using selfhost.shared.common.string_helpers as StringHelpers
|
||||
local v = regs.get(StringHelpers.int_to_str(id))
|
||||
if v == null { return 0 }
|
||||
using selfhost.vm.hakorune-vm.str_cast as StrCast
|
||||
local s = StrCast.to_str(v)
|
||||
if StringHelpers.is_numeric_str(s) == 1 { return me._to_i64(s) }
|
||||
return 0
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// vm_kernel_box.nyash — NYABI Kernel (skeleton, dev-only; not wired)
|
||||
// vm_kernel_box.hako — NYABI Kernel (skeleton, dev-only; not wired)
|
||||
// Scope: Provide policy/decision helpers behind an explicit OFF toggle.
|
||||
// Notes: This box is not referenced by the VM by default.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user