vm: stabilize plugin-first VM output + TLV decode\n\n- runtime(plugin_loader_v2): decode plugin TLV generically (tag 1/2/3/5/6/7/8/9)\n- vm(print): coerce plugin-backed results via semantics (i64/string) for consistent output\n- vm(plugin_invoke): add decode debug; align return handling\n- bin/lib: expose runner_plugin_init in bin; fix call sites to init plugin host\n- tools(build_aot.sh): disable legacy-forbid diag and toml env for object emit\n- add VM/JIT smoke scripts (counter, filebox, jit-compare)\n\nResult: VM plugin smokes PASS; jit-direct compare PASS. AOT emit still needs CLIF block init tweak.
This commit is contained in:
14
apps/tests/mir-compare-multi/main.nyash
Normal file
14
apps/tests/mir-compare-multi/main.nyash
Normal file
@ -0,0 +1,14 @@
|
||||
// mir-compare-multi - exercise Compare ops under JIT-direct
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
local c = 0
|
||||
if 1 < 2 { c = c + 1 } // true
|
||||
if 2 < 1 { c = c + 10 } // false (unchanged)
|
||||
if 5 == 5 { c = c + 100 } // true
|
||||
if 7 != 7 { c = c + 1000 } // false
|
||||
// Expect 1 + 100 = 101
|
||||
return c
|
||||
}
|
||||
}
|
||||
|
||||
12
apps/tests/vm-plugin-smoke-counter/main.nyash
Normal file
12
apps/tests/vm-plugin-smoke-counter/main.nyash
Normal file
@ -0,0 +1,12 @@
|
||||
// vm-plugin-smoke-counter
|
||||
// Purpose: Verify VM uses plugin boxes deterministically (CounterBox)
|
||||
// Expected: returns 1 after a single inc()
|
||||
|
||||
// Note: VM runner in this branch initializes plugin host and prefers
|
||||
// plugin implementations for core boxes. CounterBox is provided by
|
||||
// libnyash_counter_plugin per nyash.toml.
|
||||
|
||||
local c = new CounterBox()
|
||||
c.inc()
|
||||
return c.get()
|
||||
|
||||
12
apps/tests/vm-plugin-smoke-filebox/main.nyash
Normal file
12
apps/tests/vm-plugin-smoke-filebox/main.nyash
Normal file
@ -0,0 +1,12 @@
|
||||
// vm-plugin-smoke-filebox
|
||||
// Purpose: Verify VM uses FileBox plugin to open/read a file.
|
||||
// Script expects the test file to be created by the runner script.
|
||||
|
||||
local path = "tmp/vm_filebox_smoke.txt"
|
||||
local f = new FileBox()
|
||||
f.open(path, "r")
|
||||
local s = f.read()
|
||||
f.close()
|
||||
// Return the length of read content to avoid printing large buffers
|
||||
return s.length()
|
||||
|
||||
Reference in New Issue
Block a user