aot(core): EXE path green (return 7); migrate NyRT jit handles → runtime::host_handles; fix mir_call.py indent; workspace excludes for missing plugins; docs(phase-33) status update

This commit is contained in:
nyash-codex
2025-10-31 18:30:50 +09:00
parent c11803797a
commit 712b370013
15 changed files with 133 additions and 122 deletions

View File

@ -2,7 +2,7 @@
// Exported as: nyash.semantics.add_hh(i64 lhs_handle, i64 rhs_handle) -> i64 (NyashBox handle)
#[export_name = "nyash.semantics.add_hh"]
pub extern "C" fn nyash_semantics_add_hh_export(lhs_h: i64, rhs_h: i64) -> i64 {
use nyash_rust::jit::rt::handles;
use nyash_rust::runtime::host_handles as handles;
use nyash_rust::{
box_trait::{IntegerBox, StringBox},
runtime::semantics,
@ -10,12 +10,12 @@ pub extern "C" fn nyash_semantics_add_hh_export(lhs_h: i64, rhs_h: i64) -> i64 {
if lhs_h <= 0 || rhs_h <= 0 {
return 0;
}
let lhs = if let Some(obj) = handles::get(lhs_h) {
let lhs = if let Some(obj) = handles::get(lhs_h as u64) {
obj
} else {
return 0;
};
let rhs = if let Some(obj) = handles::get(rhs_h) {
let rhs = if let Some(obj) = handles::get(rhs_h as u64) {
obj
} else {
return 0;
@ -28,7 +28,7 @@ pub extern "C" fn nyash_semantics_add_hh_export(lhs_h: i64, rhs_h: i64) -> i64 {
let s = format!("{}{}", ls, rs);
let arc: std::sync::Arc<dyn nyash_rust::box_trait::NyashBox> =
std::sync::Arc::new(StringBox::new(s));
return handles::to_handle(arc) as i64;
return handles::to_handle_arc(arc) as i64;
}
if let (Some(li), Some(ri)) = (
semantics::coerce_to_i64(lhs.as_ref()),
@ -36,12 +36,12 @@ pub extern "C" fn nyash_semantics_add_hh_export(lhs_h: i64, rhs_h: i64) -> i64 {
) {
let arc: std::sync::Arc<dyn nyash_rust::box_trait::NyashBox> =
std::sync::Arc::new(IntegerBox::new(li + ri));
return handles::to_handle(arc) as i64;
return handles::to_handle_arc(arc) as i64;
}
// Fallback: stringify both and concat to preserve total order
let ls = lhs.to_string_box().value;
let rs = rhs.to_string_box().value;
let arc: std::sync::Arc<dyn nyash_rust::box_trait::NyashBox> =
std::sync::Arc::new(StringBox::new(format!("{}{}", ls, rs)));
handles::to_handle(arc) as i64
handles::to_handle_arc(arc) as i64
}