🎉 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
|
|
|
mod errors;
|
2025-09-25 02:21:52 +09:00
|
|
|
mod extern_functions;
|
|
|
|
|
mod ffi_bridge;
|
2025-09-17 07:43:07 +09:00
|
|
|
mod globals;
|
🎉 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
|
|
|
mod host_bridge;
|
2025-09-25 02:21:52 +09:00
|
|
|
mod instance_manager;
|
2025-09-17 07:43:07 +09:00
|
|
|
mod loader;
|
2025-09-25 02:58:43 +09:00
|
|
|
mod method_resolver;
|
2025-09-17 07:43:07 +09:00
|
|
|
mod types;
|
2025-09-04 03:41:02 +09:00
|
|
|
|
|
|
|
|
pub use globals::{get_global_loader_v2, init_global_loader_v2, shutdown_plugins_v2};
|
2025-09-17 07:43:07 +09:00
|
|
|
pub use loader::PluginLoaderV2;
|
|
|
|
|
pub use types::{
|
|
|
|
|
construct_plugin_box, make_plugin_box_v2, NyashTypeBoxFfi, PluginBoxMetadata, PluginBoxV2,
|
|
|
|
|
PluginHandleInner,
|
|
|
|
|
};
|
2025-09-06 06:24:08 +09:00
|
|
|
|
2025-09-16 17:38:22 +09:00
|
|
|
pub fn metadata_for_type_id(type_id: u32) -> Option<PluginBoxMetadata> {
|
|
|
|
|
let loader = get_global_loader_v2();
|
|
|
|
|
let guard = loader.read().ok()?;
|
|
|
|
|
guard.metadata_for_type_id(type_id)
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 20:42:01 +09:00
|
|
|
/// Resolve per-Box invoke function for a type_id (v2 only)
|
|
|
|
|
pub fn box_invoke_for_type_id(type_id: u32) -> Option<super::enabled::host_bridge::BoxInvokeFn> {
|
|
|
|
|
let loader = get_global_loader_v2();
|
|
|
|
|
let guard = loader.read().ok()?;
|
|
|
|
|
guard.box_invoke_fn_for_type_id(type_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Library-level shim to dispatch a v2 per-Box invoke function using type_id
|
|
|
|
|
pub extern "C" fn nyash_plugin_invoke_v2_shim(
|
|
|
|
|
type_id: u32,
|
|
|
|
|
method_id: u32,
|
|
|
|
|
instance_id: u32,
|
|
|
|
|
args: *const u8,
|
|
|
|
|
args_len: usize,
|
|
|
|
|
result: *mut u8,
|
|
|
|
|
result_len: *mut usize,
|
|
|
|
|
) -> i32 {
|
|
|
|
|
if let Some(f) = box_invoke_for_type_id(type_id) {
|
2025-09-19 02:07:38 +09:00
|
|
|
// BoxInvokeFn is extern "C"; call directly (no additional unsafe needed here)
|
|
|
|
|
return f(instance_id, method_id, args, args_len, result, result_len);
|
2025-09-17 20:42:01 +09:00
|
|
|
}
|
|
|
|
|
// E_PLUGIN (-5) when not found
|
|
|
|
|
-5
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
pub fn backend_kind() -> &'static str {
|
|
|
|
|
"enabled"
|
|
|
|
|
}
|