Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
stub-out js_finalize_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee authored and joshuacolvin0 committed Oct 6, 2023
1 parent c54bb5f commit c425ed1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arbitrator/jit/src/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,13 @@ fn get_field(env: &mut WasmEnv, source: u32, field: &[u8]) -> GoValue {
}

/// go side: λ(v value)
// TODO: implement ref counting
pub fn js_finalize_ref(mut env: WasmEnvMut, sp: u32) {
let (mut sp, env) = GoStack::new(sp, &mut env);
let pool = &mut env.js_state.pool;
let (mut sp, _) = GoStack::new(sp, &mut env);

let val = JsValue::new(sp.read_u64());
match val {
JsValue::Ref(x) if x < DYNAMIC_OBJECT_ID_BASE => {}
JsValue::Ref(x) => {
if pool.remove(x).is_none() {
eprintln!("Go trying to finalize unknown ref {}", x);
}
}
JsValue::Ref(_) => {}
val => eprintln!("Go trying to finalize {:?}", val),
}
}
Expand Down

0 comments on commit c425ed1

Please sign in to comment.