🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
#[test]
|
|
|
|
|
fn vtable_array_push_get_len_pop_clear() {
|
2025-11-17 11:28:18 +09:00
|
|
|
use crate::backend::VM;
|
2025-09-17 07:43:07 +09:00
|
|
|
use crate::mir::{
|
|
|
|
|
BasicBlockId, ConstValue, EffectMask, FunctionSignature, MirFunction, MirInstruction,
|
|
|
|
|
MirModule, MirType,
|
|
|
|
|
};
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
std::env::set_var("NYASH_ABI_VTABLE", "1");
|
|
|
|
|
|
|
|
|
|
// Case 1: push("x"); get(0)
|
2025-09-17 07:43:07 +09:00
|
|
|
let sig = FunctionSignature {
|
|
|
|
|
name: "main".into(),
|
|
|
|
|
params: vec![],
|
|
|
|
|
return_type: MirType::String,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
};
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut f = MirFunction::new(sig, BasicBlockId::new(0));
|
|
|
|
|
let bb = f.entry_block;
|
|
|
|
|
let arr = f.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::NewBox {
|
|
|
|
|
dst: arr,
|
|
|
|
|
box_type: "ArrayBox".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let sval = f.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Const {
|
|
|
|
|
dst: sval,
|
|
|
|
|
value: ConstValue::String("x".into()),
|
|
|
|
|
});
|
|
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: arr,
|
|
|
|
|
method: "push".into(),
|
|
|
|
|
args: vec![sval],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let idx0 = f.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Const {
|
|
|
|
|
dst: idx0,
|
|
|
|
|
value: ConstValue::Integer(0),
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let got = f.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: Some(got),
|
|
|
|
|
box_val: arr,
|
|
|
|
|
method: "get".into(),
|
|
|
|
|
args: vec![idx0],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
|
|
|
|
f.get_block_mut(bb)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Return { value: Some(got) });
|
|
|
|
|
let mut m = MirModule::new("arr_push_get".into());
|
|
|
|
|
m.add_function(f);
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut vm = VM::new();
|
|
|
|
|
let out = vm.execute_module(&m).expect("vm exec");
|
|
|
|
|
assert_eq!(out.to_string_box().value, "x");
|
|
|
|
|
|
|
|
|
|
// Case 2: push("y"); pop() -> "y"
|
2025-09-17 07:43:07 +09:00
|
|
|
let sig2 = FunctionSignature {
|
|
|
|
|
name: "main".into(),
|
|
|
|
|
params: vec![],
|
|
|
|
|
return_type: MirType::String,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
};
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut f2 = MirFunction::new(sig2, BasicBlockId::new(0));
|
|
|
|
|
let bb2 = f2.entry_block;
|
|
|
|
|
let a2 = f2.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f2.get_block_mut(bb2)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::NewBox {
|
|
|
|
|
dst: a2,
|
|
|
|
|
box_type: "ArrayBox".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let y = f2.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f2.get_block_mut(bb2)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Const {
|
|
|
|
|
dst: y,
|
|
|
|
|
value: ConstValue::String("y".into()),
|
|
|
|
|
});
|
|
|
|
|
f2.get_block_mut(bb2)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: a2,
|
|
|
|
|
method: "push".into(),
|
|
|
|
|
args: vec![y],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let popped = f2.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f2.get_block_mut(bb2)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: Some(popped),
|
|
|
|
|
box_val: a2,
|
|
|
|
|
method: "pop".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
|
|
|
|
f2.get_block_mut(bb2)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Return {
|
|
|
|
|
value: Some(popped),
|
|
|
|
|
});
|
|
|
|
|
let mut m2 = MirModule::new("arr_pop".into());
|
|
|
|
|
m2.add_function(f2);
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut vm2 = VM::new();
|
|
|
|
|
let out2 = vm2.execute_module(&m2).expect("vm exec");
|
|
|
|
|
assert_eq!(out2.to_string_box().value, "y");
|
|
|
|
|
|
|
|
|
|
// Case 3: push("z"); clear(); len() -> 0
|
2025-09-17 07:43:07 +09:00
|
|
|
let sig3 = FunctionSignature {
|
|
|
|
|
name: "main".into(),
|
|
|
|
|
params: vec![],
|
|
|
|
|
return_type: MirType::Integer,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
};
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut f3 = MirFunction::new(sig3, BasicBlockId::new(0));
|
|
|
|
|
let bb3 = f3.entry_block;
|
|
|
|
|
let a3 = f3.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::NewBox {
|
|
|
|
|
dst: a3,
|
|
|
|
|
box_type: "ArrayBox".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let z = f3.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Const {
|
|
|
|
|
dst: z,
|
|
|
|
|
value: ConstValue::String("z".into()),
|
|
|
|
|
});
|
|
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: a3,
|
|
|
|
|
method: "push".into(),
|
|
|
|
|
args: vec![z],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
|
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: a3,
|
|
|
|
|
method: "clear".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let ln = f3.next_value_id();
|
2025-09-17 07:43:07 +09:00
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: Some(ln),
|
|
|
|
|
box_val: a3,
|
|
|
|
|
method: "len".into(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
method_id: None,
|
|
|
|
|
effects: EffectMask::PURE,
|
|
|
|
|
});
|
|
|
|
|
f3.get_block_mut(bb3)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.add_instruction(MirInstruction::Return { value: Some(ln) });
|
|
|
|
|
let mut m3 = MirModule::new("arr_clear_len".into());
|
|
|
|
|
m3.add_function(f3);
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let mut vm3 = VM::new();
|
|
|
|
|
let out3 = vm3.execute_module(&m3).expect("vm exec");
|
|
|
|
|
assert_eq!(out3.to_string_box().value, "0");
|
|
|
|
|
}
|