wasm: Get List.map2 working

This commit is contained in:
Brian Carroll 2022-04-07 12:05:53 +01:00
parent 5cce24bc8f
commit 7b96e953ba
5 changed files with 86 additions and 21 deletions

View file

@ -25,7 +25,7 @@ const ARG_2: Symbol = Symbol::ARG_2;
pub const REFCOUNT_MAX: usize = 0;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum HelperOp {
pub enum HelperOp {
Inc,
Dec,
DecRef(JoinPointId),
@ -185,16 +185,16 @@ impl<'a> CodeGenHelp<'a> {
/// Generate a refcount increment procedure, *without* a Call expression.
/// *This method should be rarely used* - only when the proc is to be called from Zig.
/// Otherwise you want to generate the Proc and the Call together, using another method.
/// This only supports the 'inc' operation, as it's the only real use case we have.
pub fn gen_refcount_inc_proc(
pub fn gen_refcount_proc(
&mut self,
ident_ids: &mut IdentIds,
layout: Layout<'a>,
op: HelperOp,
) -> (Symbol, Vec<'a, (Symbol, ProcLayout<'a>)>) {
let mut ctx = Context {
new_linker_data: Vec::new_in(self.arena),
recursive_union: None,
op: HelperOp::Inc,
op,
};
let proc_name = self.find_or_create_proc(ident_ids, &mut ctx, layout);