feat(phase-9.77): Implement BoxCall instructions and fix wasmtime version
Phase 9.77 WASM Emergency Recovery Progress: - ✅ Task 1.1: Implement BoxCall instruction for toString(), print(), equals(), clone(), log() - ✅ Task 1.2: Update wasmtime 18.0 → 35.0.0 and add runtime imports - 🔄 Task 1.3: Working on UTF-8 encoding error fix Changes: - Add generate_box_call() method in codegen.rs with 5 helper methods - Update wasmtime dependency to 35.0.0 for AOT compatibility - Add BoxCall runtime imports (box_to_string, box_print, box_equals, box_clone) - Implement wat_to_wasm() with UTF-8 validation and debug output - Update CURRENT_TASK.md with Copilot handoff notes Current issue: 'Generated WASM is not valid UTF-8' error source unknown Next: Copilot to investigate error origin and complete Task 1.3 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
8
local_tests/debug_wasm_generation.nyash
Normal file
8
local_tests/debug_wasm_generation.nyash
Normal file
@ -0,0 +1,8 @@
|
||||
// 🧪 最も単純なWASM生成テスト
|
||||
// 変数操作も避けて、純粋な計算のみ
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
return "成功"
|
||||
}
|
||||
}
|
||||
17
local_tests/test_mir_wasm_minimal.nyash
Normal file
17
local_tests/test_mir_wasm_minimal.nyash
Normal file
@ -0,0 +1,17 @@
|
||||
// 🧪 MIR → WASM変換テスト(最小版)
|
||||
// メソッド呼び出しを避けて基本演算のみテスト
|
||||
|
||||
static box Main {
|
||||
init { result }
|
||||
|
||||
main() {
|
||||
// 基本演算のみ(メソッド呼び出しなし)
|
||||
local a = 10
|
||||
local b = 20
|
||||
local sum = a + b
|
||||
local product = sum * 3
|
||||
|
||||
me.result = product
|
||||
return "計算完了"
|
||||
}
|
||||
}
|
||||
28
local_tests/test_mir_wasm_simple.nyash
Normal file
28
local_tests/test_mir_wasm_simple.nyash
Normal file
@ -0,0 +1,28 @@
|
||||
// 🧪 MIR → WASM変換テスト用シンプルプログラム
|
||||
// 基本的な演算とBox操作をテスト
|
||||
|
||||
static box Main {
|
||||
init { console, result }
|
||||
|
||||
main() {
|
||||
me.console = new ConsoleBox()
|
||||
me.console.log("🚀 MIR → WASM変換テスト開始")
|
||||
|
||||
// 基本演算テスト
|
||||
local a = 10
|
||||
local b = 20
|
||||
local sum = a + b
|
||||
|
||||
me.console.log("計算結果: " + sum.toString())
|
||||
|
||||
// StringBox操作テスト
|
||||
local greeting = "Hello"
|
||||
local name = "WASM"
|
||||
local message = greeting + " " + name + "!"
|
||||
|
||||
me.console.log("メッセージ: " + message)
|
||||
|
||||
me.result = sum
|
||||
return "MIR → WASM変換テスト完了"
|
||||
}
|
||||
}
|
||||
1
local_tests/test_simple_wasm.nyash
Normal file
1
local_tests/test_simple_wasm.nyash
Normal file
@ -0,0 +1 @@
|
||||
local result = 42
|
||||
Reference in New Issue
Block a user