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

@ -21,7 +21,7 @@ pub extern "C" fn nyash_future_spawn_method_h(
let mut invoke: Option<
unsafe extern "C" fn(u32, u32, u32, *const u8, usize, *mut u8, *mut usize) -> i32,
> = None;
if let Some(obj) = nyash_rust::jit::rt::handles::get(recv_h) {
if let Some(obj) = nyash_rust::runtime::host_handles::get(recv_h as u64) {
if let Some(p) = obj.as_any().downcast_ref::<PluginBoxV2>() {
instance_id = p.instance_id();
real_type_id = p.inner.type_id;
@ -56,7 +56,7 @@ pub extern "C" fn nyash_future_spawn_method_h(
}
8 => {
if v > 0 {
if let Some(obj) = nyash_rust::jit::rt::handles::get(v) {
if let Some(obj) = nyash_rust::runtime::host_handles::get(v as u64) {
if let Some(p) = obj.as_any().downcast_ref::<PluginBoxV2>() {
// Try common coercions: String/Integer to TLV primitives
let host = nyash_rust::runtime::get_global_plugin_host();
@ -113,7 +113,7 @@ pub extern "C" fn nyash_future_spawn_method_h(
// Prepare FutureBox and register handle
let fut_box = std::sync::Arc::new(nyash_rust::boxes::future::FutureBox::new());
let handle =
nyash_rust::jit::rt::handles::to_handle(fut_box.clone() as std::sync::Arc<dyn NyashBox>);
nyash_rust::runtime::host_handles::to_handle_arc(fut_box.clone() as std::sync::Arc<dyn NyashBox>);
// Copy data for async task
let cap: usize = 512;
let tlv = buf.clone();
@ -245,7 +245,7 @@ pub extern "C" fn nyash_future_spawn_instance3_i64(a0: i64, a1: i64, a2: i64, ar
}
// Resolve receiver invoke and type id/name
let (instance_id, real_type_id, invoke) =
if let Some(obj) = nyash_rust::jit::rt::handles::get(a0) {
if let Some(obj) = nyash_rust::runtime::host_handles::get(a0 as u64) {
if let Some(p) = obj.as_any().downcast_ref::<PluginBoxV2>() {
(p.instance_id(), p.inner.type_id, Some(p.inner.invoke_fn))
} else {
@ -265,7 +265,7 @@ pub extern "C" fn nyash_future_spawn_instance3_i64(a0: i64, a1: i64, a2: i64, ar
// Determine method name string (from a1 handle→StringBox, or a1 as C string pointer, or legacy VM args)
let mut method_name: Option<String> = None;
if a1 > 0 {
if let Some(obj) = nyash_rust::jit::rt::handles::get(a1) {
if let Some(obj) = nyash_rust::runtime::host_handles::get(a1 as u64) {
if let Some(p) = obj.as_any().downcast_ref::<PluginBoxV2>() {
if p.box_type == "StringBox" {
// Limit the lifetime of the read guard to this inner block by avoiding an outer binding
@ -324,7 +324,7 @@ pub extern "C" fn nyash_future_spawn_instance3_i64(a0: i64, a1: i64, a2: i64, ar
let mut encode_arg_into = |dst: &mut Vec<u8>, val: i64, pos: usize| {
let mut appended = false;
if val > 0 {
if let Some(obj) = nyash_rust::jit::rt::handles::get(val) {
if let Some(obj) = nyash_rust::runtime::host_handles::get(val as u64) {
if let Some(p) = obj.as_any().downcast_ref::<PluginBoxV2>() {
let host = nyash_rust::runtime::get_global_plugin_host();
if let Ok(hg) = host.read() {
@ -389,7 +389,7 @@ pub extern "C" fn nyash_future_spawn_instance3_i64(a0: i64, a1: i64, a2: i64, ar
// Create Future and schedule async invoke
let fut_box = std::sync::Arc::new(nyash_rust::boxes::future::FutureBox::new());
let handle =
nyash_rust::jit::rt::handles::to_handle(fut_box.clone() as std::sync::Arc<dyn NyashBox>);
nyash_rust::runtime::host_handles::to_handle_arc(fut_box.clone() as std::sync::Arc<dyn NyashBox>);
let tlv = buf.clone();
nyash_rust::runtime::global_hooks::spawn_task(
"nyash.future.spawn_instance3_i64",