feat: プラグインパスをOS非依存に更新(.so拡張子削除)

- nyash.tomlからすべての.so拡張子を削除
- plugin_loader_v2のresolve_library_pathが自動的に適切な拡張子を追加
  - Linux: .so
  - Windows: .dll
  - macOS: .dylib
- クロスプラットフォーム対応の準備完了
This commit is contained in:
Moe Charm
2025-08-29 23:11:21 +09:00
parent 1eee62a8ea
commit 8e58942726
27 changed files with 701 additions and 159 deletions

View File

@ -45,6 +45,8 @@ impl JitEngine {
pub fn compile_function(&mut self, func_name: &str, mir: &crate::mir::MirFunction) -> Option<u64> {
let t0 = std::time::Instant::now();
// Phase 10_b skeleton: walk MIR with LowerCore and report coverage
// Reset compile-phase counters (e.g., fallback decisions) before lowering this function
crate::jit::events::lower_counters_reset();
let mut lower = crate::jit::lower::core::LowerCore::new();
#[cfg(feature = "cranelift-jit")]
let mut builder = crate::jit::lower::builder::CraneliftBuilder::new();
@ -54,6 +56,12 @@ impl JitEngine {
eprintln!("[JIT] lower failed for {}: {}", func_name, e);
return None;
}
// Strict: fail compile if any fallback decisions were taken during lowering
let lower_fallbacks = crate::jit::events::lower_fallbacks_get();
if lower_fallbacks > 0 && std::env::var("NYASH_JIT_STRICT").ok().as_deref() == Some("1") {
eprintln!("[JIT][strict] lower produced fallback decisions for {}: {} — failing compile", func_name, lower_fallbacks);
return None;
}
// Capture per-function lower stats for manager to query later
let (phi_t, phi_b1, ret_b) = lower.last_stats();
self.last_phi_total = phi_t; self.last_phi_b1 = phi_b1; self.last_ret_bool_hint = ret_b;