get wasm dev backend working

This commit is contained in:
Brendan Hansknecht 2024-07-21 19:53:36 -07:00
parent 82764dc697
commit b8fb83af86
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
4 changed files with 126 additions and 7 deletions

View file

@ -1981,12 +1981,33 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
self.register_helper_proc(spec_sym, spec_layout, ProcSource::Helper);
}
self.get_existing_refcount_fn_index(proc_symbol, layout, op)
self.get_existing_helper_fn_index(proc_symbol, layout, op)
}
/// Generate a copy helper procedure and return a pointer (table index) to it
/// This allows it to be indirectly called from Zig code
pub fn get_copy_fn_index(&mut self, layout: InLayout<'a>) -> u32 {
let ident_ids = self
.interns
.all_ident_ids
.get_mut(&self.env.module_id)
.unwrap();
let (proc_symbol, new_specializations) =
self.helper_proc_gen
.gen_copy_proc(ident_ids, self.layout_interner, layout);
// If any new specializations were created, register their symbol data
for (spec_sym, spec_layout) in new_specializations.into_iter() {
self.register_helper_proc(spec_sym, spec_layout, ProcSource::Helper);
}
self.get_existing_helper_fn_index(proc_symbol, layout, HelperOp::IndirectCopy)
}
/// return a pointer (table index) to a refcount helper procedure.
/// This allows it to be indirectly called from Zig code
pub fn get_existing_refcount_fn_index(
pub fn get_existing_helper_fn_index(
&mut self,
proc_symbol: Symbol,
layout: InLayout<'a>,