From 4d60c05b68cb4e0c45f67ab23892ab63ac4f6478 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Mon, 1 Apr 2024 11:24:24 -0500 Subject: [PATCH 01/20] feat(compiler)!: Custom Grain object files --- .gitignore | 1 + cli/bin/grain.js | 2 +- compiler/grainc/grainc.re | 4 +- compiler/src/codegen/comp_utils.re | 11 +- compiler/src/codegen/comp_utils.rei | 2 - compiler/src/codegen/compcore.re | 863 ++++++++++---------- compiler/src/codegen/compcore.rei | 14 +- compiler/src/codegen/compmod.re | 4 +- compiler/src/codegen/emitmod.re | 68 +- compiler/src/codegen/linkedtree.re | 214 +++++ compiler/src/codegen/mashtree.re | 34 +- compiler/src/codegen/transl_anf.re | 55 +- compiler/src/compile.re | 74 +- compiler/src/compile.rei | 17 +- compiler/src/dune | 14 +- compiler/src/linking/dune | 8 - compiler/src/linking/link.re | 824 ------------------- compiler/src/linking/linkmod.re | 6 - compiler/src/middle_end/anftree.re | 1 + compiler/src/middle_end/anftree.rei | 1 + compiler/src/middle_end/linearize.re | 3 +- compiler/src/parsing/driver.re | 8 +- compiler/src/parsing/location.re | 2 +- compiler/src/typed/cmi_format.re | 46 +- compiler/src/typed/cmi_format.rei | 5 +- compiler/src/typed/env.re | 27 +- compiler/src/typed/env.rei | 5 +- compiler/src/typed/module_resolution.re | 67 +- compiler/src/typed/module_resolution.rei | 4 +- compiler/src/typed/typedtree.re | 1 + compiler/src/typed/typedtree.rei | 1 + compiler/src/typed/typemod.re | 22 +- compiler/src/utils/config.re | 22 +- compiler/src/utils/config.rei | 10 +- compiler/src/utils/dune | 11 +- compiler/test/TestFramework.re | 8 +- compiler/test/runner.re | 15 +- compiler/test/suites/basic_functionality.re | 2 +- compiler/test/suites/modules.re | 2 +- compiler/test/suites/provides.re | 8 +- stdlib/package.json | 2 +- 41 files changed, 1007 insertions(+), 1481 deletions(-) create mode 100644 compiler/src/codegen/linkedtree.re delete mode 100644 compiler/src/linking/dune delete mode 100644 compiler/src/linking/link.re delete mode 100644 compiler/src/linking/linkmod.re diff --git a/.gitignore b/.gitignore index a104a34492..f7d6ddc499 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ _build/ .installed-pkgs notes.org node_modules/ +*.gro *.wasm *.wasm.map *.wat diff --git a/cli/bin/grain.js b/cli/bin/grain.js index 6b7683d148..d74fe28199 100755 --- a/cli/bin/grain.js +++ b/cli/bin/grain.js @@ -179,7 +179,7 @@ program .action(function (file, options, program) { const success = exec.grainc(file, options, program); if (success) { - const outFile = options.o ?? file.replace(/\.gr$/, ".gr.wasm"); + const outFile = options.o ?? file.replace(/\.gr$/, ".wasm"); exec.grainrun(unprocessedArgs, outFile, options, program); } }); diff --git a/compiler/grainc/grainc.re b/compiler/grainc/grainc.re index f903e0b11d..3555c0c83e 100644 --- a/compiler/grainc/grainc.re +++ b/compiler/grainc/grainc.re @@ -33,14 +33,14 @@ let compile_file = (name, outfile_arg) => { try({ let outfile = Option.value( - ~default=Compile.default_output_filename(name), + ~default=Compile.default_wasm_filename(name), outfile_arg, ); let hook = if (Grain_utils.Config.statically_link^) { Compile.stop_after_assembled; } else { - Compile.stop_after_object_file_emitted; + Compile.stop_after_object_emitted; }; ignore(Compile.compile_file(~is_root_file=true, ~hook, ~outfile, name)); }) { diff --git a/compiler/src/codegen/comp_utils.re b/compiler/src/codegen/comp_utils.re index 8f627eb02e..6091830416 100644 --- a/compiler/src/codegen/comp_utils.re +++ b/compiler/src/codegen/comp_utils.re @@ -79,8 +79,8 @@ let rec compile_const = (c): Literal.t => { | MConstU16(n) => Literal.int32(conv_short_int(n, Uint16Type)) | MConstU32(n) => Literal.int32(conv_uint32(n)) | MConstU64(n) => Literal.int64(conv_uint64(n)) - | MConstF32(n) => Literal.float32(conv_float32(n)) - | MConstF64(n) => Literal.float64(conv_float64(n)) + | MConstF32(n) => Literal.float32(conv_float32(Int64.float_of_bits(n))) + | MConstF64(n) => Literal.float64(conv_float64(Int64.float_of_bits(n))) | MConstChar(c) => Literal.int32(conv_char(c)) | MConstLiteral(MConstI8(n)) | MConstLiteral(MConstI16(n)) @@ -90,8 +90,8 @@ let rec compile_const = (c): Literal.t => { | MConstLiteral(MConstU16(n)) | MConstLiteral(MConstU32(n)) => Literal.int32(n) | MConstLiteral(MConstU64(n)) => Literal.int64(n) - | MConstLiteral(MConstF32(n)) => Literal.float32(n) - | MConstLiteral(MConstF64(n)) => Literal.float64(n) + | MConstLiteral(MConstF32(n)) => Literal.float32(Int64.float_of_bits(n)) + | MConstLiteral(MConstF64(n)) => Literal.float64(Int64.float_of_bits(n)) | MConstLiteral(MConstChar(c)) => Literal.int32(conv_char(c)) }; }; @@ -344,6 +344,3 @@ let write_universal_exports = ) ); }; - -let compiling_wasi_polyfill = name => - Option.is_some(Config.wasi_polyfill^) && Config.wasi_polyfill^ == name; diff --git a/compiler/src/codegen/comp_utils.rei b/compiler/src/codegen/comp_utils.rei index 427dd67b16..5dbefbabc1 100644 --- a/compiler/src/codegen/comp_utils.rei +++ b/compiler/src/codegen/comp_utils.rei @@ -65,5 +65,3 @@ let get_exported_names: let write_universal_exports: (Module.t, Cmi_format.cmi_infos, Hashtbl.t(string, string)) => unit; - -let compiling_wasi_polyfill: option(string) => bool; diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index a645ad5379..e3ad70bc29 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -1,5 +1,6 @@ open Grain_typed; open Mashtree; +open Linkedtree; open Value_tags; open Binaryen; open Concatlist; /* NOTE: This import shadows (@) and introduces (@+) and (+@) */ @@ -13,12 +14,17 @@ let sources: ref(list((Expression.t, Grain_parsing.Location.t))) = ref([]); type codegen_env = { name: option(string), + dep_id: int, + func_debug_idx: int, num_args: int, num_closure_args: int, stack_size, /* Allocated closures which need backpatching */ backpatches: ref(list((Expression.t, closure_data))), required_imports: list(import), + global_import_resolutions: Hashtbl.t(string, string), + func_import_resolutions: Hashtbl.t(string, string), + compilation_mode: Config.compilation_mode, }; let gensym_counter = ref(0); @@ -45,228 +51,36 @@ let swap_slots = swap_slots_f64, ]); -/** These are the bare-minimum imports needed for basic runtime support */ - /* The Grain environment */ let grain_env_mod = grain_env_name; -let module_runtime_id = Ident.create_persistent("moduleRuntimeId"); -let runtime_heap_start = Ident.create_persistent("runtimeHeapStart"); -let runtime_heap_next_ptr = Ident.create_persistent("runtimeHeapNextPtr"); -let metadata_ptr = Ident.create_persistent("metadataPtr"); -let reloc_base = Ident.create_persistent("relocBase"); -let table_size = Ident.create_persistent("GRAIN$TABLE_SIZE"); +let runtime_heap_start_name = + Ident.unique_name(Ident.create_persistent("runtimeHeapStart")); +let runtime_heap_next_ptr_name = + Ident.unique_name(Ident.create_persistent("runtimeHeapNextPtr")); +let metadata_ptr_name = + Ident.unique_name(Ident.create_persistent("metadataPtr")); +let reloc_base_name = + Ident.unique_name(Ident.create_persistent("relocBase")); /* Memory allocation */ -let malloc_mod = "GRAIN$MODULE$runtime/malloc.gr"; -let malloc_ident = Ident.create_persistent("malloc"); -let malloc_closure_ident = Ident.create_persistent("GRAIN$EXPORT$malloc"); +let malloc_name = Ident.unique_name(Ident.create_persistent("malloc")); /* Garbage collection */ -let gc_mod = "GRAIN$MODULE$runtime/gc.gr"; -let incref_ident = Ident.create_persistent("incRef"); -let incref_closure_ident = Ident.create_persistent("GRAIN$EXPORT$incRef"); -let decref_ident = Ident.create_persistent("decRef"); -let decref_closure_ident = Ident.create_persistent("GRAIN$EXPORT$decRef"); +let incref_name = Ident.unique_name(Ident.create_persistent("incRef")); +let decref_name = Ident.unique_name(Ident.create_persistent("decRef")); /* Exceptions */ -let exception_mod = "GRAIN$MODULE$runtime/exception.gr"; -let panic_with_exception_ident = - Ident.create_persistent("panicWithException"); -let panic_with_exception_closure_ident = - Ident.create_persistent("GRAIN$EXPORT$panicWithException"); +let panic_with_exception_name = + Ident.unique_name(Ident.create_persistent("panicWithException")); /* Equality checking */ -let equal_mod = "GRAIN$MODULE$runtime/equal.gr"; -let equal_ident = Ident.create_persistent("equal"); -let equal_closure_ident = Ident.create_persistent("GRAIN$EXPORT$equal"); - -let required_global_imports = [ - { - mimp_id: reloc_base, - mimp_mod: grain_env_mod, - mimp_name: Ident.name(reloc_base), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), false), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: true, - }, - { - mimp_id: module_runtime_id, - mimp_mod: grain_env_mod, - mimp_name: Ident.name(module_runtime_id), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), false), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: runtime_heap_start, - mimp_mod: grain_env_mod, - mimp_name: Ident.name(runtime_heap_start), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), false), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: runtime_heap_next_ptr, - mimp_mod: grain_env_mod, - mimp_name: Ident.name(runtime_heap_next_ptr), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: metadata_ptr, - mimp_mod: grain_env_mod, - mimp_name: Ident.name(metadata_ptr), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), false), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: panic_with_exception_closure_ident, - mimp_mod: exception_mod, - mimp_name: Ident.name(panic_with_exception_closure_ident), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, -]; - -let grain_runtime_imports = [ - { - mimp_id: malloc_closure_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(malloc_closure_ident), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: incref_closure_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(incref_closure_ident), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: decref_closure_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(decref_closure_ident), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: equal_closure_ident, - mimp_mod: equal_mod, - mimp_name: Ident.name(equal_closure_ident), - mimp_type: MGlobalImport(Types.Unmanaged(WasmI32), true), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, -]; - -let runtime_global_imports = - List.append(required_global_imports, grain_runtime_imports); - -let required_function_imports = [ - { - mimp_id: panic_with_exception_ident, - mimp_mod: exception_mod, - mimp_name: Ident.name(panic_with_exception_ident), - mimp_type: - MFuncImport( - [Types.Unmanaged(WasmI32), Types.Unmanaged(WasmI32)], - [Types.Unmanaged(WasmI32)], - ), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, -]; - -let grain_function_imports = [ - { - mimp_id: malloc_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(malloc_ident), - mimp_type: - MFuncImport( - [Types.Unmanaged(WasmI32), Types.Unmanaged(WasmI32)], - [Types.Unmanaged(WasmI32)], - ), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: incref_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(incref_ident), - mimp_type: - MFuncImport( - [Types.Unmanaged(WasmI32), Types.Unmanaged(WasmI32)], - [Types.Unmanaged(WasmI32)], - ), /* Returns same pointer as argument */ - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: decref_ident, - mimp_mod: gc_mod, - mimp_name: Ident.name(decref_ident), - mimp_type: - MFuncImport( - [Types.Unmanaged(WasmI32), Types.Unmanaged(WasmI32)], - [Types.Unmanaged(WasmI32)], - ), /* Returns same pointer as argument */ - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, - { - mimp_id: equal_ident, - mimp_mod: equal_mod, - mimp_name: Ident.name(equal_ident), - mimp_type: - MFuncImport( - [Types.Managed, Types.Managed, Types.Managed], - [Types.Unmanaged(WasmI32)], - ), - mimp_kind: MImportWasm, - mimp_setup: MSetupNone, - mimp_used: false, - }, -]; +let equal_name = Ident.unique_name(Ident.create_persistent("equal")); -let runtime_function_imports = - List.append(grain_function_imports, required_function_imports); - -let runtime_imports = - List.append(runtime_global_imports, runtime_function_imports); - -let runtime_imports_tbl = { - let tbl = Ident_tbl.create(64); - List.iter( - ({mimp_id} as imp) => Ident_tbl.add(tbl, mimp_id, imp), - runtime_imports, - ); - tbl; -}; - -let init_codegen_env = name => { +let init_codegen_env = + (~global_import_resolutions, ~func_import_resolutions, name) => { name, + dep_id: 0, + func_debug_idx: 0, num_args: 0, num_closure_args: 0, stack_size: { @@ -278,38 +92,38 @@ let init_codegen_env = name => { }, backpatches: ref([]), required_imports: [], + global_import_resolutions, + func_import_resolutions, + compilation_mode: Normal, }; -let reset = () => { - reset_labels(); - List.iter( - imp => imp.mimp_used = imp.mimp_mod == grain_env_mod, - runtime_imports, - ); +let linked_name = (~env, id) => { + Printf.sprintf("%s_%d", id, env.dep_id); +}; + +let rec resolve_global = (~env, name) => { + switch (Hashtbl.find_opt(env.global_import_resolutions, name)) { + | Some(resolution) => resolve_global(~env, resolution) + | _ => name + }; }; -let get_wasm_imported_name = (~runtime_import=true, mod_, name) => { - if (runtime_import) { - // Mark runtime import as used - Ident_tbl.find(runtime_imports_tbl, name).mimp_used = - true; +let rec resolve_func = (~env, name) => { + switch (Hashtbl.find_opt(env.func_import_resolutions, name)) { + | Some(resolution) => resolve_func(~env, resolution) + | _ => name }; - Ident.unique_name(name); +}; + +let reset = () => { + reset_labels(); }; let get_runtime_heap_start = wasm_mod => - Expression.Global_get.make( - wasm_mod, - get_wasm_imported_name(grain_env_mod, runtime_heap_start), - Type.int32, - ); + Expression.Global_get.make(wasm_mod, runtime_heap_start_name, Type.int32); let get_metadata_ptr = wasm_mod => - Expression.Global_get.make( - wasm_mod, - get_wasm_imported_name(grain_env_mod, metadata_ptr), - Type.int32, - ); + Expression.Global_get.make(wasm_mod, metadata_ptr_name, Type.int32); let get_grain_imported_name = (mod_, name) => Ident.unique_name(name); @@ -317,17 +131,14 @@ let call_panic_handler = (wasm_mod, env, args) => { let args = [ Expression.Global_get.make( wasm_mod, - get_wasm_imported_name( - exception_mod, - panic_with_exception_closure_ident, - ), + resolve_global(~env, panic_with_exception_name), Type.int32, ), ...args, ]; Expression.Call.make( wasm_mod, - get_wasm_imported_name(exception_mod, panic_with_exception_ident), + resolve_func(~env, panic_with_exception_name), args, Type.int32, ); @@ -337,14 +148,14 @@ let call_malloc = (wasm_mod, env, args) => { let args = [ Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(gc_mod, malloc_closure_ident), + resolve_global(~env, malloc_name), Type.int32, ), ...args, ]; Expression.Call.make( wasm_mod, - get_wasm_imported_name(gc_mod, malloc_ident), + resolve_func(~env, malloc_name), args, Type.int32, ); @@ -353,7 +164,7 @@ let call_incref = (wasm_mod, env, arg) => { let args = [ Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(gc_mod, incref_closure_ident), + resolve_global(~env, incref_name), Type.int32, ), arg, @@ -363,7 +174,7 @@ let call_incref = (wasm_mod, env, arg) => { } else { Expression.Call.make( wasm_mod, - get_wasm_imported_name(gc_mod, incref_ident), + resolve_func(~env, incref_name), args, Type.int32, ); @@ -373,7 +184,7 @@ let call_decref = (wasm_mod, env, arg) => { let args = [ Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(gc_mod, decref_closure_ident), + resolve_global(~env, decref_name), Type.int32, ), arg, @@ -383,7 +194,7 @@ let call_decref = (wasm_mod, env, arg) => { } else { Expression.Call.make( wasm_mod, - get_wasm_imported_name(gc_mod, decref_ident), + resolve_func(~env, decref_name), args, Type.int32, ); @@ -392,12 +203,12 @@ let call_decref = (wasm_mod, env, arg) => { let call_equal = (wasm_mod, env, args) => Expression.Call.make( wasm_mod, - get_wasm_imported_name(equal_mod, equal_ident), + resolve_func(~env, equal_name), [ call_incref(wasm_mod, env) @@ Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(equal_mod, equal_closure_ident), + resolve_global(~env, equal_name), Type.int32, ), ...args, @@ -610,6 +421,7 @@ let compile_bind = | BindTee({value}) => tee_slot(slot, typ, value) }; | MGlobalBind(slot, wasm_ty) => + let slot = resolve_global(~env, linked_name(~env, slot)); let typ = wasm_type(wasm_ty); switch (action) { | BindGet => Expression.Global_get.make(wasm_mod, slot, typ) @@ -799,6 +611,8 @@ let rec compile_imm = (wasm_mod, env: codegen_env, i: immediate): Expression.t = call_incref(wasm_mod, env, compile_imm(wasm_mod, env, imm)) }; +let round_to_8 = n => Int.logand(n + 7, Int.lognot(7)); + /** Heap allocations. */ /** Rounds the given number of words to be aligned correctly */ @@ -810,14 +624,15 @@ let round_to_even = num_words => }; let heap_allocate = (wasm_mod, env, num_words: int) => - if (Env.is_runtime_mode()) { + switch (env.compilation_mode) { + | Runtime => let addition = Expression.Binary.make( wasm_mod, Op.add_int32, Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(grain_env_mod, runtime_heap_next_ptr), + runtime_heap_next_ptr_name, Type.int32, ), Expression.Const.make( @@ -838,10 +653,7 @@ let heap_allocate = (wasm_mod, env, num_words: int) => wasm_mod, Expression.Global_get.make( wasm_mod, - get_wasm_imported_name( - grain_env_mod, - runtime_heap_next_ptr, - ), + runtime_heap_next_ptr_name, Type.int32, ), // fake GC refcount of 1 @@ -852,10 +664,7 @@ let heap_allocate = (wasm_mod, env, num_words: int) => Op.add_int32, Expression.Global_get.make( wasm_mod, - get_wasm_imported_name( - grain_env_mod, - runtime_heap_next_ptr, - ), + runtime_heap_next_ptr_name, Type.int32, ), Expression.Const.make(wasm_mod, const_int32(8)), @@ -868,7 +677,7 @@ let heap_allocate = (wasm_mod, env, num_words: int) => [ Expression.Global_set.make( wasm_mod, - get_wasm_imported_name(grain_env_mod, runtime_heap_next_ptr), + runtime_heap_next_ptr_name, addition, ), // Binaryen tuples must include a concrete value (and tuples are @@ -880,12 +689,12 @@ let heap_allocate = (wasm_mod, env, num_words: int) => ), 0, ); - } else { + | Normal => call_malloc( wasm_mod, env, [Expression.Const.make(wasm_mod, const_int32(4 * num_words))], - ); + ) }; type heap_allocation_type = @@ -1355,11 +1164,7 @@ let compile_closure_op = (wasm_mod, env, closure_imm, op) => { Expression.Binary.make( wasm_mod, Op.add_int32, - Expression.Global_get.make( - wasm_mod, - get_wasm_imported_name(grain_env_mod, reloc_base), - Type.int32, - ), + Expression.Global_get.make(wasm_mod, reloc_base_name, Type.int32), Expression.Const.make(wasm_mod, wrap_int32(idx)), ), ) @@ -1387,6 +1192,7 @@ let call_lambda = let retty = Type.create @@ Array.map(wasm_type, Array.of_list(retty)); switch (known) { | Some(name) => + let name = resolve_func(~env, linked_name(~env, name)); let instr = if (tail) { if (Config.no_tail_call^) { @@ -1577,7 +1383,7 @@ let allocate_closure = env, ~lambda=?, ~skip_patching=false, - {func_idx, arity, variables} as closure_data, + {func_idx, global_offset, arity, variables} as closure_data, ) => { let num_free_vars = List.length(variables); let closure_size = num_free_vars + 4; @@ -1614,7 +1420,7 @@ let allocate_closure = Op.add_int32, Expression.Global_get.make( wasm_mod, - get_wasm_imported_name(grain_env_mod, reloc_base), + linked_name(~env, global_offset), Type.int32, ), Expression.Const.make(wasm_mod, wrap_int32(idx)), @@ -2648,13 +2454,19 @@ let compile_allocation = (wasm_mod, env, alloc_type) => allocate_float32( wasm_mod, env, - Expression.Const.make(wasm_mod, Literal.float32(i)), + Expression.Const.make( + wasm_mod, + Literal.float32(Int64.float_of_bits(i)), + ), ) | MFloat64(i) => allocate_float64( wasm_mod, env, - Expression.Const.make(wasm_mod, Literal.float64(i)), + Expression.Const.make( + wasm_mod, + Literal.float64(Int64.float_of_bits(i)), + ), ) | MBigInt({flags, limbs}) => allocate_big_int( @@ -2955,12 +2767,30 @@ and compile_instr = (wasm_mod, env, instr) => call_lambda(~tail=true, wasm_mod, env, func, func_type, args) | MCallRaw({func, func_type: (_, retty), args}) => let compiled_args = List.map(compile_imm(wasm_mod, env), args); - Expression.Call.make( - wasm_mod, - func, - compiled_args, - Type.create(Array.of_list(List.map(wasm_type, retty))), - ); + let func_name = linked_name(~env, func); + let resolved_name = resolve_func(~env, func_name); + if (resolved_name == func_name) { + // Name not resolved; call normally + Expression.Call.make( + wasm_mod, + func, + compiled_args, + Type.create(Array.of_list(List.map(wasm_type, retty))), + ); + } else { + // Raw function resolved to Grain function; inject closure argument + let closure_global = resolve_global(~env, func_name); + let closure_arg = + Expression.Global_get.make(wasm_mod, closure_global, Type.int32); + let compiled_args = [closure_arg, ...compiled_args]; + Expression.Call.make( + wasm_mod, + resolved_name, + compiled_args, + Type.create(Array.of_list(List.map(wasm_type, retty))), + ); + }; + | MIf(cond, thn, els) => let compiled_cond = compile_imm(wasm_mod, env, cond); let compiled_thn = compile_block(wasm_mod, env, thn); @@ -3137,6 +2967,7 @@ let compile_function = | Some(name) => name | None => Ident.unique_name(id) }; + let func_name = linked_name(~env, func_name); let body_env = { ...env, num_args: arity, @@ -3209,21 +3040,20 @@ let compile_function = if (Config.source_map^) { open Grain_parsing.Location; List.iter( - ((exp, loc)) => { + ((exp, loc)) => Function.set_debug_location( func_ref, exp, - 0, + env.func_debug_idx, loc.loc_start.pos_lnum, loc.loc_start.pos_cnum - loc.loc_start.pos_bol, - ) - }, + ), sources^, ); Function.set_debug_location( func_ref, body, - 0, + env.func_debug_idx, func_loc.loc_start.pos_lnum, func_loc.loc_start.pos_cnum - func_loc.loc_start.pos_bol, ); @@ -3253,8 +3083,7 @@ let compile_imports = (wasm_mod, env, {imports}) => { let internal_name = switch (mimp_kind) { | MImportGrain => get_grain_imported_name(mimp_mod, mimp_id) - | MImportWasm => - get_wasm_imported_name(~runtime_import=false, mimp_mod, mimp_id) + | MImportWasm => Ident.unique_name(mimp_id) }; switch (mimp_kind, mimp_type) { | (MImportGrain, MGlobalImport(ty, mut)) => @@ -3290,19 +3119,7 @@ let compile_imports = (wasm_mod, env, {imports}) => { }; }; - let imports = - List.append( - List.filter(({mimp_used}) => mimp_used, env.required_imports), - imports, - ); - List.iter(compile_import, imports); - Import.add_table_import( - wasm_mod, - grain_global_function_table, - grain_env_mod, - grain_global_function_table, - ); }; let compile_exports = (wasm_mod, env, {imports, exports, globals}) => { @@ -3310,19 +3127,15 @@ let compile_exports = (wasm_mod, env, {imports, exports, globals}) => { switch (export) { | WasmGlobalExport({ex_global_internal_name, ex_global_name}) => let ex_global_name = "GRAIN$EXPORT$" ++ ex_global_name; + let internal_name = linked_name(~env, ex_global_internal_name); + let resolved_name = resolve_global(~env, internal_name); ignore @@ - Export.add_global_export( - wasm_mod, - ex_global_internal_name, - ex_global_name, - ); + Export.add_global_export(wasm_mod, resolved_name, ex_global_name); | WasmFunctionExport({ex_function_internal_name, ex_function_name}) => + let internal_name = linked_name(~env, ex_function_internal_name); + let resolved_name = resolve_func(~env, internal_name); ignore @@ - Export.add_function_export( - wasm_mod, - ex_function_internal_name, - ex_function_name, - ) + Export.add_function_export(wasm_mod, resolved_name, ex_function_name); }; }; @@ -3352,33 +3165,33 @@ let compile_exports = (wasm_mod, env, {imports, exports, globals}) => { ); }; List.iteri(compile_export, exports); - ignore @@ Export.add_function_export(wasm_mod, grain_main, grain_main); - if (! Config.use_start_section^) { - ignore @@ Export.add_function_export(wasm_mod, grain_start, grain_start); - }; - ignore @@ - Export.add_global_export( - wasm_mod, - Ident.name(table_size), - Ident.name(table_size), - ); }; -let compile_tables = (wasm_mod, env, {function_table_elements}) => { +let compile_tables = + (wasm_mod, env, {function_table_elements, global_function_table_offset}) => { + let global_name = + linked_name(~env, Ident.unique_name(global_function_table_offset)); + let function_table_elements = + List.map( + elem => { + let name = linked_name(~env, elem); + resolve_func(~env, name); + }, + function_table_elements, + ); + let name = linked_name(~env, "elem"); + let global = Global.get_global(wasm_mod, global_name); + let offset = Global.get_init_expr(global); Table.add_active_element_segment( wasm_mod, grain_global_function_table, - "elem", + name, function_table_elements, - Expression.Global_get.make( - wasm_mod, - get_wasm_imported_name(grain_env_mod, reloc_base), - Type.int32, - ), + offset, ); }; -let compile_globals = (wasm_mod, env, {globals} as prog) => { +let compile_globals = (wasm_mod, env, {globals}) => { let initial_value = fun | Types.Managed @@ -3387,66 +3200,94 @@ let compile_globals = (wasm_mod, env, {globals} as prog) => { | Types.Unmanaged(WasmF32) => const_float32(0.) | Types.Unmanaged(WasmF64) => const_float64(0.); List.iter( - ((id, ty)) => + ((id, mut, ty, initial)) => { + let name = linked_name(~env, Ident.unique_name(id)); ignore @@ Global.add_global( wasm_mod, - Ident.unique_name(id), + name, wasm_type(ty), - true, - Expression.Const.make(wasm_mod, initial_value(ty)), - ), + mut, + switch (initial) { + | Some(initial) => + Expression.Const.make(wasm_mod, compile_const(initial)) + | None => Expression.Const.make(wasm_mod, initial_value(ty)) + }, + ); + }, globals, ); - ignore @@ - Global.add_global( - wasm_mod, - Ident.name(table_size), - Type.int32, - false, - Expression.Const.make( - wasm_mod, - const_int32(compute_table_size(env, prog)), - ), - ); }; let compile_main = (wasm_mod, env, prog) => { - ignore @@ - compile_function( - ~name=grain_main, - wasm_mod, - env, - { - id: Ident.create(grain_main), - name: Some(grain_main), - args: [], - return_type: [Types.Unmanaged(WasmI32)], - closure: None, - body: prog.main_body, - stack_size: prog.main_body_stack_size, - attrs: [], - func_loc: Grain_parsing.Location.dummy_loc, + let num_mains = List.length(prog.programs); + List.iteri( + (dep_id, prog: mash_program) => { + let env = {...env, compilation_mode: prog.compilation_mode, dep_id}; + let compile = () => { + ignore @@ + compile_function( + ~name=grain_main, + wasm_mod, + env, + { + id: Ident.create(grain_main), + name: Some(grain_main), + args: [], + return_type: [Types.Unmanaged(WasmI32)], + closure: None, + body: prog.main_body, + stack_size: prog.main_body_stack_size, + attrs: [], + func_loc: Grain_parsing.Location.dummy_loc, + }, + ); + }; + switch (prog.compilation_mode) { + | Runtime => + Config.preserve_config(() => { + Config.no_gc := true; + compile(); + }) + | Normal => compile() + }; }, + prog.programs, ); - if (! Config.use_start_section^) { - ignore @@ + let starts = + List.init(num_mains, dep_id => + Expression.Drop.make( + wasm_mod, + Expression.Call.make( + wasm_mod, + Printf.sprintf("%s_%d", grain_main, dep_id), + [], + Type.int32, + ), + ) + ); + let start = Function.add_function( wasm_mod, grain_start, Type.none, Type.none, [||], - Expression.Drop.make( - wasm_mod, - Expression.Call.make(wasm_mod, grain_main, [], Type.int32), - ), + Expression.Block.make(wasm_mod, "_start", starts), ); + if (Grain_utils.Config.use_start_section^) { + Function.set_start(wasm_mod, start); + } else { + ignore @@ + Export.add_function_export(wasm_mod, "_start", Comp_utils.grain_start); }; }; -let compile_functions = (wasm_mod, env, {functions} as prog) => { - let handle_attrs = ({attrs} as func) => +let compile_functions = (wasm_mod, env, {functions, prog_loc}) => { + let func_debug_idx = + Module.add_debug_info_filename(wasm_mod, prog_loc.loc_start.pos_fname); + let handle_attrs = ({attrs, func_loc} as func) => { + let env = {...env, func_debug_idx}; if (List.exists( ({Grain_parsing.Location.txt}) => txt == Typedtree.Disable_gc, attrs, @@ -3458,8 +3299,216 @@ let compile_functions = (wasm_mod, env, {functions} as prog) => { } else { compile_function(wasm_mod, env, func); }; + }; ignore @@ List.map(handle_attrs, functions); - ignore @@ compile_main(wasm_mod, env, prog); +}; + +let construct_type_metadata_table = metas => { + open Cmi_format; + // Create a hash table mapping "type hashes" unique to each Grain type to + // offsets in the metadata section + + // Structure: + // | Hash table: array of (offset into mappings data, bucket size) for each hash (type_hash % num_buckets) + // | Mappings: arrays of (type_hash, offset into actual metadata table) for each hash table bucket + // | Metadata: actual metadata content; appropriate offset for type metadata found through table data + let exceptions_buf = Buffer.create(256); + let exception_metas = List.map(m => m.ctm_exceptions, metas); + let exceptions_section_len = + List.fold_left((len, e) => String.length(e) + len, 0, exception_metas) + + 4; + Buffer.add_int32_le(exceptions_buf, Int32.of_int(exceptions_section_len)); + List.iter(Buffer.add_string(exceptions_buf), exception_metas); + + let exception_meta = (Buffer.contents(exceptions_buf), [(0, 0)]); + let non_exception_metas = + List.map(m => (m.ctm_metadata, m.ctm_offsets_tbl), metas); + let metas = [exception_meta, ...non_exception_metas]; + + let metadata_buf = Buffer.create(256); + let curr_offset = ref(0); + let hash_to_offset = + List.flatten( + List.map( + ((meta, offsets_tbl)) => { + Buffer.add_string(metadata_buf, meta); + let padding_bytes = String.length(meta) mod 8; + for (_ in 1 to padding_bytes) { + Buffer.add_int8(metadata_buf, 0); + }; + let hash_to_offset = + List.map( + ((hash, offset)) => (hash, offset + curr_offset^), + offsets_tbl, + ); + curr_offset := curr_offset^ + String.length(meta) + padding_bytes; + hash_to_offset; + }, + metas, + ), + ); + let rec next_pow_of_2 = (num, res) => + if (num <= 1) { + 1 lsl res; + } else { + next_pow_of_2(num lsr 1, res + 1); + }; + let num_entries = List.length(hash_to_offset); + // Choose number of buckets to be the greatest power of 2 <= # table entries + // (limit 4K) as a memory/lookup speed tradeoff (expect 1-2 entries/bucket) + let num_buckets = min(4096, next_pow_of_2(num_entries, 0)); + let buckets = Array.make(num_buckets, []); + List.iter( + ((hash, _) as hash_and_offset) => { + let hash_hash = hash mod num_buckets; + buckets[hash_hash] = [hash_and_offset, ...buckets[hash_hash]]; + }, + hash_to_offset, + ); + for (i in 0 to num_buckets - 1) { + buckets[i] = List.rev(buckets[i]); + }; + + let tbl_buckets_buf = Buffer.create(num_buckets * 8); + let tbl_vals_buf = Buffer.create(num_entries * 8); + // Store the number of buckets at the beginning of the metadata section + Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(num_buckets)); + // For 8-byte alignment + Buffer.add_int32_le(tbl_buckets_buf, 0l); + + // # buckets + buckets + data (2 i32s each) + let tbl_size = 8 + (num_buckets + num_entries) * 8; + // Initialize offset to point after the table buckets + let tbl_data_offset = ref(8 + num_buckets * 8); + Array.iter( + hash_to_offset => { + Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(tbl_data_offset^)); + Buffer.add_int32_le( + tbl_buckets_buf, + Int32.of_int(List.length(hash_to_offset)), + ); + List.iter( + ((hash, offset)) => { + Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(hash)); + Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(offset + tbl_size)); + tbl_data_offset := tbl_data_offset^ + 8; + }, + hash_to_offset, + ); + }, + buckets, + ); + Buffer.add_buffer(tbl_buckets_buf, tbl_vals_buf); + Buffer.add_buffer(tbl_buckets_buf, metadata_buf); + Buffer.to_bytes(tbl_buckets_buf); +}; + +let compile_type_metadata = (wasm_mod, env, prog) => { + let metadata_tbl_data = + if (Config.elide_type_info^) { + None; + } else { + let metadata = + List.map( + prog => prog.Mashtree.signature.cmi_type_metadata, + prog.programs, + ); + Some(construct_type_metadata_table(metadata)); + }; + let runtime_heap_ptr = + switch (Grain_utils.Config.memory_base^) { + | Some(x) => round_to_8(x) + | None => Grain_utils.Config.default_memory_base + }; + let metadata_heap_loc = runtime_heap_ptr + 8; + let metadata_size = + round_to_8( + Option.value(~default=0, Option.map(Bytes.length, metadata_tbl_data)), + ); + let runtime_heap_start = metadata_heap_loc + metadata_size; + + ignore @@ + Global.add_global( + wasm_mod, + runtime_heap_next_ptr_name, + Type.int32, + true, + Expression.Const.make( + wasm_mod, + Literal.int32(Int32.of_int(runtime_heap_start)), + ), + ); + + ignore @@ + Global.add_global( + wasm_mod, + runtime_heap_start_name, + Type.int32, + false, + Expression.Const.make( + wasm_mod, + Literal.int32(Int32.of_int(runtime_heap_start)), + ), + ); + + ignore @@ + Global.add_global( + wasm_mod, + metadata_ptr_name, + Type.int32, + false, + Expression.Const.make( + wasm_mod, + Literal.int32(Int32.of_int(metadata_heap_loc)), + ), + ); + + let (initial_memory, maximum_memory) = + switch (Config.initial_memory_pages^, Config.maximum_memory_pages^) { + | (initial_memory, Some(maximum_memory)) => ( + initial_memory, + maximum_memory, + ) + | (initial_memory, None) => (initial_memory, Memory.unlimited) + }; + + let data_segments = + switch (metadata_tbl_data) { + | Some(data) => [ + Memory.{ + data, + kind: + Active({ + offset: + Expression.Const.make( + wasm_mod, + Literal.int32(Int32.of_int(metadata_heap_loc)), + ), + }), + size: Bytes.length(data), + }, + ] + | None => [] + }; + Memory.set_memory( + wasm_mod, + initial_memory, + maximum_memory, + "memory", + data_segments, + false, + false, + Comp_utils.grain_memory, + ); + if (Config.import_memory^) { + Import.add_memory_import( + wasm_mod, + Comp_utils.grain_memory, + "env", + "memory", + false, + ); + }; }; exception WasmRunnerError(Module.t, option(string), string); @@ -3470,32 +3519,20 @@ let validate_module = (~name=?, wasm_mod: Module.t) => raise(WasmRunnerError(wasm_mod, name, "WARNING: Invalid module")) }; -let prepare = env => { - let required_imports = - if (Env.is_runtime_mode()) { - List.concat([required_global_imports, required_function_imports]); - } else { - runtime_imports; - }; - {...env, required_imports}; -}; - -let compile_wasm_module = (~env=?, ~name=?, prog) => { +let compile_wasm_module = + ( + ~name=?, + {global_import_resolutions, func_import_resolutions} as prog: Linkedtree.linked_program, + ) => { reset(); let env = - switch (env) { - | None => init_codegen_env(name) - | Some(e) => e - }; - let env = prepare(env); - let wasm_mod = Module.create(); - if (Config.source_map^) { - ignore @@ - Module.add_debug_info_filename( - wasm_mod, - Filepath.String.basename(Option.get(name)), + init_codegen_env( + ~global_import_resolutions, + ~func_import_resolutions, + name, ); - }; + let wasm_mod = Module.create(); + let default_features = [ Module.Feature.mvp, Module.Feature.multivalue, @@ -3517,19 +3554,20 @@ let compile_wasm_module = (~env=?, ~name=?, prog) => { Settings.set_low_memory_unused( Option.is_none(Grain_utils.Config.memory_base^), ); - let _ = - Memory.set_memory( - wasm_mod, - 0, - Memory.unlimited, - "memory", - [], - false, - false, - grain_memory, - ); - let compile_all = () => { + compile_type_metadata(wasm_mod, env, prog); + + ignore @@ + Table.add_table( + wasm_mod, + Comp_utils.grain_global_function_table, + prog.num_function_table_elements, + prog.num_function_table_elements, + Type.funcref, + ); + + let compile_one = (dep_id, prog: mash_program) => { + let env = {...env, dep_id, compilation_mode: prog.compilation_mode}; ignore @@ compile_globals(wasm_mod, env, prog); ignore @@ compile_functions(wasm_mod, env, prog); ignore @@ compile_exports(wasm_mod, env, prog); @@ -3537,29 +3575,22 @@ let compile_wasm_module = (~env=?, ~name=?, prog) => { ignore @@ compile_tables(wasm_mod, env, prog); }; - if (Env.is_runtime_mode()) { - Config.preserve_config(() => { - Config.no_gc := true; - compile_all(); - }); - } else { - compile_all(); - }; + List.iteri( + (dep_id, prog: mash_program) => { + switch (prog.compilation_mode) { + | Runtime => + Config.preserve_config(() => { + Config.no_gc := true; + compile_one(dep_id, prog); + }) + | Normal => compile_one(dep_id, prog) + } + }, + prog.programs, + ); - if (compiling_wasi_polyfill(name)) { - write_universal_exports( - wasm_mod, - prog.signature, - get_exported_names(wasm_mod), - ); - }; + ignore @@ compile_main(wasm_mod, env, prog); - let serialized_cmi = Cmi_format.serialize_cmi(prog.signature); - Module.add_custom_section( - wasm_mod, - "cmi", - Bytes.to_string(serialized_cmi), - ); validate_module(~name?, wasm_mod); switch (Config.profile^) { diff --git a/compiler/src/codegen/compcore.rei b/compiler/src/codegen/compcore.rei index 710e73680f..87f147b443 100644 --- a/compiler/src/codegen/compcore.rei +++ b/compiler/src/codegen/compcore.rei @@ -3,23 +3,11 @@ open Grain_middle_end; open Mashtree; open Binaryen; -type codegen_env = { - name: option(string), - num_args: int, - num_closure_args: int, - stack_size, - /* Allocated closures which need backpatching */ - backpatches: ref(list((Expression.t, closure_data))), - required_imports: list(import), -}; - -let init_codegen_env: option(string) => codegen_env; - exception WasmRunnerError(Module.t, option(string), string); let validate_module: (~name: string=?, Module.t) => unit; let compile_wasm_module: - (~env: codegen_env=?, ~name: string=?, Mashtree.mash_program) => Module.t; + (~name: string=?, Linkedtree.linked_program) => Module.t; let module_to_bytes: Module.t => bytes; diff --git a/compiler/src/codegen/compmod.re b/compiler/src/codegen/compmod.re index ec23619e5f..eefd0c2880 100644 --- a/compiler/src/codegen/compmod.re +++ b/compiler/src/codegen/compmod.re @@ -6,7 +6,7 @@ type compiled_program = { signature: Cmi_format.cmi_infos, }; -let compile_wasm_module = (~name=?, {Mashtree.signature} as mashprog) => { - let asm = Compcore.compile_wasm_module(~name?, mashprog); +let compile_wasm_module = (~name=?, {Linkedtree.signature} as linked_program) => { + let asm = Compcore.compile_wasm_module(~name?, linked_program); {asm, signature}; }; diff --git a/compiler/src/codegen/emitmod.re b/compiler/src/codegen/emitmod.re index c7e48d0c0f..a4da0c536f 100644 --- a/compiler/src/codegen/emitmod.re +++ b/compiler/src/codegen/emitmod.re @@ -1,8 +1,72 @@ open Grain_typed; open Grain_utils; -open Compmod; +open Mashtree; -let emit_module = ({asm, signature}, outfile) => { +type bad_object = + | InvalidMagic + | InvalidVersion + | Corrupted; + +exception BadObject(bad_object); + +let emit_object = (mashed: mash_program, outfile) => { + Grain_utils.Fs_access.ensure_parent_directory_exists(outfile); + if (Config.debug^) { + let mash_string = + Sexplib.Sexp.to_string_hum @@ Mashtree.sexp_of_mash_program(mashed); + let mashfile = Filepath.String.replace_extension(outfile, "mashtree"); + let oc = open_out(mashfile); + output_string(oc, mash_string); + close_out(oc); + }; + + let oc = open_out_bin(outfile); + + output_string(oc, Cmi_format.magic); + let version_length = String.length(Config.version); + output_binary_int(oc, version_length); + output_string(oc, Config.version); + let cmi = Marshal.to_bytes(mashed.signature, []); + output_binary_int(oc, Bytes.length(cmi) + version_length + 12); + output_bytes(oc, cmi); + Marshal.to_channel(oc, mashed, []); + + close_out(oc); +}; + +let load_object = (ic): mash_program => { + let read_magic = really_input_string(ic, 4); + if (read_magic != Cmi_format.magic) { + raise(BadObject(InvalidMagic)); + }; + let version_length = input_binary_int(ic); + let read_version = really_input_string(ic, version_length); + if (read_version != Config.version) { + raise(BadObject(InvalidVersion)); + }; + let cmi_length = input_binary_int(ic); + seek_in(ic, cmi_length); + try(input_value(ic)) { + | _ => raise(BadObject(Corrupted)) + }; +}; +let load_object = object_file => { + let ic = open_in_bin(object_file); + let program = + try(load_object(ic)) { + | BadObject(_) as exn => + close_in(ic); + raise(exn); + | Failure(_) + | End_of_file => + close_in(ic); + raise(BadObject(Corrupted)); + }; + close_in(ic); + program; +}; + +let emit_binary = (asm, signature, outfile) => { Fs_access.ensure_parent_directory_exists(outfile); if (Config.debug^) { let sig_string = diff --git a/compiler/src/codegen/linkedtree.re b/compiler/src/codegen/linkedtree.re new file mode 100644 index 0000000000..b80b6b6174 --- /dev/null +++ b/compiler/src/codegen/linkedtree.re @@ -0,0 +1,214 @@ +open Grain_typed; +open Grain_utils; +open Mashtree; + +type linked_program = { + programs: list(mash_program), + func_import_resolutions: Hashtbl.t(string, string), + global_import_resolutions: Hashtbl.t(string, string), + num_function_table_elements: int, + signature: Cmi_format.cmi_infos, +}; + +let stack_size_zero = { + stack_size_ptr: 0, + stack_size_i32: 0, + stack_size_i64: 0, + stack_size_f32: 0, + stack_size_f64: 0, +}; +let max_stack_size = (s1, s2) => { + { + stack_size_ptr: max(s1.stack_size_ptr, s2.stack_size_ptr), + stack_size_i32: max(s1.stack_size_i32, s2.stack_size_i32), + stack_size_i64: max(s1.stack_size_i64, s2.stack_size_i64), + stack_size_f32: max(s1.stack_size_f32, s2.stack_size_f32), + stack_size_f64: max(s1.stack_size_f64, s2.stack_size_f64), + }; +}; + +let wasi_module = "wasi_snapshot_preview1"; + +let link = main_mashtree => { + let main_module = Module_resolution.current_filename^(); + + let new_base_dir = Filepath.String.dirname; + + let resolve = (~base_dir=?, mod_name) => + Module_resolution.locate_unit_object_file(~base_dir?, mod_name); + + let wasi_polyfill = + Option.map( + Module_resolution.get_object_name, + Config.wasi_polyfill_path(), + ); + + let dependencies = Module_resolution.get_dependencies(); + let dependencies = + switch (wasi_polyfill) { + | Some(polyfill) => [polyfill, ...dependencies] + | None => dependencies + }; + + let rec resolve_implicit_modules = (acc, modules) => { + switch (modules) { + | [mod_, ...rest] => + switch (resolve(Config.get_implicit_filepath(mod_))) { + | file => resolve_implicit_modules([file, ...acc], rest) + | exception _ => resolve_implicit_modules(acc, rest) + } + | [] => acc + }; + }; + + let implicit_modules = + resolve_implicit_modules([], Config.all_implicit_opens); + + let func_import_resolutions = Hashtbl.create(2048); + let global_import_resolutions = Hashtbl.create(2048); + let func_export_resolutions = Hashtbl.create(2048); + let global_export_resolutions = Hashtbl.create(2048); + + let num_function_table_elements = ref(0); + + let dep_id = ref(0); + + let process_mashtree = (~main, dep, tree) => { + let table_offset_global = ( + tree.global_function_table_offset, + false, + Types.Unmanaged(WasmI32), + Some( + MConstLiteral( + MConstI32(Int32.of_int(num_function_table_elements^)), + ), + ), + ); + + let globals = [table_offset_global, ...tree.globals]; + + let imports = + List.fold_left( + (imports, import) => { + let process_import = resolved_module => { + let global = + Hashtbl.find_opt( + global_export_resolutions, + (resolved_module, import.mimp_name), + ); + let func = + Hashtbl.find_opt( + func_export_resolutions, + (resolved_module, import.mimp_name), + ); + let import_name = + Printf.sprintf( + "%s_%d", + Ident.unique_name(import.mimp_id), + dep_id^, + ); + Option.iter( + global => + Hashtbl.add(global_import_resolutions, import_name, global), + global, + ); + Option.iter( + func => Hashtbl.add(func_import_resolutions, import_name, func), + func, + ); + }; + + switch (import.mimp_kind) { + | MImportWasm => + switch (wasi_polyfill) { + | Some(polyfill) + when import.mimp_mod == wasi_module && dep != polyfill => + process_import(polyfill); + imports; + | _ => [import, ...imports] + } + | MImportGrain => + let resolved_module = + resolve(~base_dir=new_base_dir(dep), import.mimp_mod); + process_import(resolved_module); + imports; + }; + }, + [], + tree.imports, + ); + + List.iter( + export => { + switch (export) { + | WasmFunctionExport({ex_function_name, ex_function_internal_name}) => + let internal_name = + Printf.sprintf("%s_%d", ex_function_internal_name, dep_id^); + Hashtbl.add( + func_export_resolutions, + (dep, ex_function_name), + internal_name, + ); + + if (List.mem(dep, implicit_modules)) { + Hashtbl.add( + func_import_resolutions, + Ident.unique_name(Ident.create_persistent(ex_function_name)), + internal_name, + ); + }; + | WasmGlobalExport({ex_global_name, ex_global_internal_name}) => + let internal_name = + Printf.sprintf("%s_%d", ex_global_internal_name, dep_id^); + Hashtbl.add( + global_export_resolutions, + (dep, ex_global_name), + internal_name, + ); + + if (List.mem(dep, implicit_modules)) { + Hashtbl.add( + global_import_resolutions, + Ident.unique_name(Ident.create_persistent(ex_global_name)), + internal_name, + ); + }; + } + }, + tree.exports, + ); + + let exports = + if (main) { + tree.exports; + } else { + []; + }; + + num_function_table_elements := + num_function_table_elements^ + List.length(tree.function_table_elements); + + incr(dep_id); + + {...tree, globals, imports, exports}; + }; + + let programs = + List.rev_map( + dep => process_mashtree(~main=false, dep, Emitmod.load_object(dep)), + dependencies, + ); + + let main_program = process_mashtree(~main=true, main_module, main_mashtree); + let programs = List.rev([main_program, ...programs]); + let num_function_table_elements = num_function_table_elements^; + let signature = main_mashtree.signature; + + { + programs, + func_import_resolutions, + global_import_resolutions, + num_function_table_elements, + signature, + }; +}; diff --git a/compiler/src/codegen/mashtree.re b/compiler/src/codegen/mashtree.re index dd128ae416..6c73c8f09b 100644 --- a/compiler/src/codegen/mashtree.re +++ b/compiler/src/codegen/mashtree.re @@ -6,10 +6,7 @@ open Grain_typed; open Value_tags; open Runtime_errors; -/* OCaml floats are 64-bit - (see section 2.3: https://github.com/janestreet/janestreet.github.com/blob/009358427533b46ba2c66200779ea05a73ef0783/ocaml-perf-notes.md)*/ -type float32 = float; -type float64 = float; +let sexp_locs_disabled = _ => ! Grain_utils.Config.sexp_locs_enabled^; type tag_type = Value_tags.tag_type; type heap_tag_type = Value_tags.heap_tag_type; @@ -305,8 +302,12 @@ type constant = | MConstU16(int32) | MConstU32(int32) | MConstU64(int64) - | MConstF32(float) - | MConstF64(float) + /* + * jsoo cannot safely marshal floats into a consistent representation because + * of how JS numbers work; we work with the bits of the float instead. + */ + | MConstF32(int64) + | MConstF64(int64) | MConstChar(string) | MConstLiteral(constant); /* Special case for things which should not be encoded */ @@ -341,6 +342,7 @@ and last_usage = [@deriving sexp] type closure_data = { func_idx: option(int32), + global_offset: string, arity: int32, variables: list(immediate), }; @@ -359,8 +361,12 @@ type allocation_type = | MInt64(int64) | MUint32(int32) | MUint64(int64) - | MFloat32(float) - | MFloat64(float) + /* + * jsoo cannot safely marshal floats into a consistent representation because + * of how JS numbers work; we work with the bits of the float instead. + */ + | MFloat32(int64) + | MFloat64(int64) | MRational({ numerator_flags: list(Bigint_flags.t), numerator_limbs: array(int64), @@ -423,6 +429,7 @@ type closure_op = [@deriving sexp] type instr = { instr_desc, + [@sexp_drop_if sexp_locs_disabled] instr_loc: Location.t, } /* Optimized path for statically-known function names */ /* value, branches, default */ /* Items in the same list have their backpatching delayed until the end of that list */ /* Ignore the result of an expression. Used for sequences. */ /* Prints a message to the console; for compiler debugging */ [@deriving sexp] @@ -531,6 +538,7 @@ type mash_function = { body: block, stack_size, attrs: attributes, + [@sexp_drop_if sexp_locs_disabled] func_loc: Location.t, } and stack_size = { @@ -548,10 +556,14 @@ type mash_program = { exports: list(export), main_body: block, main_body_stack_size: stack_size, - globals: list((Ident.t, Types.allocation_type)), + globals: list((Ident.t, bool, Types.allocation_type, option(constant))), function_table_elements: list(string), - signature: Cmi_format.cmi_infos, - type_metadata: list(Types.type_metadata), + global_function_table_offset: Ident.t, + compilation_mode: Grain_utils.Config.compilation_mode, + signature: [@sexp.opaque] Cmi_format.cmi_infos, + type_metadata: [@sexp.opaque] list(Types.type_metadata), + [@sexp_drop_if sexp_locs_disabled] + prog_loc: Location.t, }; let const_true = MConstLiteral(MConstI32(Int32.of_int(0xFFFFFFFE))); diff --git a/compiler/src/codegen/transl_anf.re b/compiler/src/codegen/transl_anf.re index c11356c85f..d335fe4205 100644 --- a/compiler/src/codegen/transl_anf.re +++ b/compiler/src/codegen/transl_anf.re @@ -38,12 +38,17 @@ let compilation_worklist: Queue.t(worklist_elt) = Queue.create(); let function_table_index = ref(0); let function_table_idents = ref([]); +let function_table_global = ref(Ident.create("function_table_global")); let reset_function_table_info = () => { function_table_index := 0; function_table_idents := []; + function_table_global := Ident.create("function_table_global"); }; +let get_function_table_global_name = () => + Ident.unique_name(function_table_global^); + type function_ident = | FuncId(Ident.t) | FuncName(string); @@ -79,7 +84,11 @@ let set_global_imports = imports => { let global_table = ref(Ident.empty: Ident.tbl(Types.allocation_type)); let get_globals = () => { - Ident.fold_all((id, ty, acc) => [(id, ty), ...acc], global_table^, []); + Ident.fold_all( + (id, ty, acc) => [(id, true, ty, None), ...acc], + global_table^, + [], + ); }; let reset_global = () => { @@ -170,12 +179,12 @@ let compile_const = (c: Asttypes.constant) => | Const_uint16(u16) => MConstU16(u16) | Const_uint32(u32) => MConstU32(u32) | Const_uint64(u64) => MConstU64(u64) - | Const_float32(f) => MConstF32(f) - | Const_float64(f) => MConstF64(f) + | Const_float32(f) => MConstF32(Int64.bits_of_float(f)) + | Const_float64(f) => MConstF64(Int64.bits_of_float(f)) | Const_wasmi32(i32) => MConstLiteral(MConstI32(i32)) | Const_wasmi64(i64) => MConstLiteral(MConstI64(i64)) - | Const_wasmf32(f32) => MConstLiteral(MConstF32(f32)) - | Const_wasmf64(f64) => MConstLiteral(MConstF64(f64)) + | Const_wasmf32(f32) => MConstLiteral(MConstF32(Int64.bits_of_float(f32))) + | Const_wasmf64(f64) => MConstLiteral(MConstF64(Int64.bits_of_float(f64))) | Const_char(c) => MConstChar(c) | Const_bool(b) when b == true => const_true | Const_bool(_) => const_false @@ -297,6 +306,7 @@ let compile_lambda = if (Option.is_some(closure) || Analyze_function_calls.has_indirect_call(id)) { Some({ func_idx, + global_offset: get_function_table_global_name(), arity: Int32.of_int(arity), /* These variables should be in scope when the lambda is constructed. */ variables: @@ -373,7 +383,12 @@ let compile_wrapper = loc: Location.dummy_loc, }; worklist_enqueue(worklist_item); - {func_idx, arity: Int32.of_int(arity + 1), variables: []}; + { + func_idx, + global_offset: get_function_table_global_name(), + arity: Int32.of_int(arity + 1), + variables: [], + }; }; let get_global = (id, ty) => { @@ -489,7 +504,8 @@ let rec compile_comp = (~id=?, env, c) => { when n <= Literals.simple_number_max && n >= Literals.simple_number_min => MImmediate(imm(MImmConst(MConstI32(Int64.to_int32(n))))) | CNumber(Const_number_int(n)) => MAllocate(MInt64(n)) - | CNumber(Const_number_float(f)) => MAllocate(MFloat64(f)) + | CNumber(Const_number_float(f)) => + MAllocate(MFloat64(Int64.bits_of_float(f))) | CNumber( Const_number_rational({ rational_negative, @@ -527,8 +543,8 @@ let rec compile_comp = (~id=?, env, c) => { | CInt64(i) => MAllocate(MInt64(i)) | CUint32(i) => MAllocate(MUint32(i)) | CUint64(i) => MAllocate(MUint64(i)) - | CFloat32(f) => MAllocate(MFloat32(f)) - | CFloat64(f) => MAllocate(MFloat64(f)) + | CFloat32(f) => MAllocate(MFloat32(Int64.bits_of_float(f))) + | CFloat64(f) => MAllocate(MFloat64(Int64.bits_of_float(f))) | CGetTupleItem(idx, tup) => MTupleOp(MTupleGet(idx), compile_imm(env, tup)) | CSetTupleItem(idx, tup, value) => @@ -773,6 +789,8 @@ let lift_imports = (env, imports) => { MAllocate( MClosure({ func_idx: Some(Int32.of_int(idx)), + global_offset: + get_function_table_global_name(), arity: Int32.of_int(List.length(args)), variables: [], }), @@ -934,15 +952,11 @@ let transl_signature = (~functions, ~imports, signature) => { let func_map = Ident_tbl.create(30); List.iter( (func: mash_function) => - switch (func.name) { - | Some(name) => - Ident_tbl.add( - func_map, - func.id, - (Ident.unique_name(func.id), Option.is_some(func.closure)), - ) - | None => () - }, + Ident_tbl.add( + func_map, + func.id, + (Ident.unique_name(func.id), Option.is_some(func.closure)), + ), functions, ); List.iter( @@ -1093,6 +1107,8 @@ let transl_anf_program = ); let globals = get_globals(); let function_table_elements = get_function_table_idents(); + let global_function_table_offset = function_table_global^; + let compilation_mode = Config.compilation_mode^; { functions, @@ -1102,7 +1118,10 @@ let transl_anf_program = main_body_stack_size, globals, function_table_elements, + global_function_table_offset, + compilation_mode, signature, type_metadata: anf_prog.type_metadata, + prog_loc: anf_prog.prog_loc, }; }; diff --git a/compiler/src/compile.re b/compiler/src/compile.re index 14a1aed29f..161539d917 100644 --- a/compiler/src/compile.re +++ b/compiler/src/compile.re @@ -2,7 +2,6 @@ open Grain_parsing; open Grain_typed; open Grain_middle_end; open Grain_codegen; -open Grain_linking; open Grain_utils; open Optimize; @@ -20,15 +19,16 @@ type compilation_state_desc = | Linearized(Anftree.anf_program) | Optimized(Anftree.anf_program) | Mashed(Mashtree.mash_program) + | ObjectEmitted(Mashtree.mash_program) + | ObjectsLinked(Linkedtree.linked_program) | Compiled(Compmod.compiled_program) - | ObjectFileEmitted(Compmod.compiled_program) - | Linked(Compmod.compiled_program) | Assembled; type compilation_state = { cstate_desc: compilation_state_desc, cstate_filename: option(string), - cstate_outfile: option(string), + cstate_object_outfile: option(string), + cstate_wasm_outfile: option(string), }; type compilation_action = @@ -41,13 +41,12 @@ type error = exception InlineFlagsError(Location.t, error); -let default_output_filename = name => name ++ ".wasm"; - +let default_wasm_filename = name => + Filepath.String.replace_extension(name, "wasm"); +let default_object_filename = name => + Filepath.String.replace_extension(name, "gro"); let default_mashtree_filename = name => - Filepath.String.remove_extension(name) ++ ".mashtree"; - -let compile_prog = p => - Compcore.module_to_bytes @@ Compcore.compile_wasm_module(p); + Filepath.String.replace_extension(name, "mashtree"); let save_mashed = (mashed, outfile) => { switch (outfile) { @@ -94,9 +93,11 @@ let log_state = state => | Mashed(mashed) => prerr_string("\nMashed program:\n"); prerr_sexp(Mashtree.sexp_of_mash_program, mashed); + | ObjectEmitted(mashed) => + prerr_string("\nMashfile emitted successfully") + | ObjectsLinked(linked) => + prerr_string("\nMashfiles linked successfully") | Compiled(compiled) => prerr_string("\nCompiled successfully") - | ObjectFileEmitted(compiled) => prerr_string("\nEmitted successfully") - | Linked(linked) => prerr_string("\nLinked successfully") | Assembled => prerr_string("\nAssembled successfully") }; prerr_string("\n\n"); @@ -171,22 +172,22 @@ let next_state = (~is_root_file=false, {cstate_desc, cstate_filename} as cs) => | Optimized(optimized) => let mashed = Transl_anf.transl_anf_program(optimized); if (Config.debug^) { - save_mashed(mashed, cs.cstate_outfile); + save_mashed(mashed, cs.cstate_object_outfile); }; Mashed(mashed); | Mashed(mashed) => - Compiled(Compmod.compile_wasm_module(~name=?cstate_filename, mashed)) - | Compiled(compiled) => - switch (cs.cstate_outfile) { - | Some(outfile) => Emitmod.emit_module(compiled, outfile) + switch (cs.cstate_object_outfile) { + | Some(outfile) => Emitmod.emit_object(mashed, outfile) | None => () }; - ObjectFileEmitted(compiled); - | ObjectFileEmitted(compiled) => - Linked(Linkmod.statically_link_wasm_module(compiled)) - | Linked(linked) => - switch (cs.cstate_outfile) { - | Some(outfile) => Emitmod.emit_module(linked, outfile) + ObjectEmitted(mashed); + | ObjectEmitted(mashed) => ObjectsLinked(Linkedtree.link(mashed)) + | ObjectsLinked(linked) => + Compiled(Compmod.compile_wasm_module(~name=?cstate_filename, linked)) + | Compiled(compiled) => + switch (cs.cstate_wasm_outfile) { + | Some(outfile) => + Emitmod.emit_binary(compiled.asm, compiled.signature, outfile) | None => () }; Assembled; @@ -250,18 +251,16 @@ let stop_after_mashed = | {cstate_desc: Mashed(_)} => Stop | s => Continue(s); -let stop_after_compiled = - fun - | {cstate_desc: Compiled(_)} => Stop - | s => Continue(s); -let stop_after_object_file_emitted = +let stop_after_object_emitted = fun - | {cstate_desc: ObjectFileEmitted(_)} => Stop + | {cstate_desc: ObjectEmitted(_)} => Stop | s => Continue(s); -let stop_after_linked = + +let stop_after_compiled = fun - | {cstate_desc: Linked(_)} => Stop + | {cstate_desc: Compiled(_)} => Stop | s => Continue(s); + let stop_after_assembled = fun | {cstate_desc: Assembled} => Stop @@ -275,12 +274,13 @@ let compile_wasi_polyfill = () => { let cstate = { cstate_desc: Initial(InputFile(file)), cstate_filename: Some(file), - cstate_outfile: Some(default_output_filename(file)), + cstate_wasm_outfile: Some(default_wasm_filename(file)), + cstate_object_outfile: Some(default_object_filename(file)), }; ignore( compile_resume( ~is_root_file=true, - ~hook=stop_after_object_file_emitted, + ~hook=stop_after_object_emitted, cstate, ), ); @@ -311,7 +311,8 @@ let compile_string = let cstate = { cstate_desc: Initial(InputString(str)), cstate_filename: name, - cstate_outfile: outfile, + cstate_wasm_outfile: outfile, + cstate_object_outfile: Option.map(default_object_filename, outfile), }; Grain_utils.Config.preserve_all_configs(() => compile_resume(~is_root_file, ~hook?, cstate) @@ -330,7 +331,8 @@ let compile_file = let cstate = { cstate_desc: Initial(InputFile(filename)), cstate_filename: Some(filename), - cstate_outfile: outfile, + cstate_wasm_outfile: outfile, + cstate_object_outfile: Option.map(default_object_filename, outfile), }; Grain_utils.Config.preserve_all_configs(() => compile_resume(~is_root_file, ~hook?, cstate) @@ -366,7 +368,7 @@ let () = ~is_root_file=false, ~outfile, ~reset=false, - ~hook=stop_after_object_file_emitted, + ~hook=stop_after_object_emitted, input, ), ) diff --git a/compiler/src/compile.rei b/compiler/src/compile.rei index 598ac3156e..0e1022af88 100644 --- a/compiler/src/compile.rei +++ b/compiler/src/compile.rei @@ -2,7 +2,6 @@ open Grain_parsing; open Grain_typed; open Grain_middle_end; open Grain_codegen; -open Grain_linking; type input_source = | InputString(string) @@ -18,15 +17,16 @@ type compilation_state_desc = | Linearized(Anftree.anf_program) | Optimized(Anftree.anf_program) | Mashed(Mashtree.mash_program) + | ObjectEmitted(Mashtree.mash_program) + | ObjectsLinked(Linkedtree.linked_program) | Compiled(Compmod.compiled_program) - | ObjectFileEmitted(Compmod.compiled_program) - | Linked(Compmod.compiled_program) | Assembled; type compilation_state = { cstate_desc: compilation_state_desc, cstate_filename: option(string), - cstate_outfile: option(string), + cstate_object_outfile: option(string), + cstate_wasm_outfile: option(string), }; type compilation_action = @@ -39,7 +39,8 @@ type error = exception InlineFlagsError(Location.t, error); -let default_output_filename: string => string; +let default_wasm_filename: string => string; +let default_object_filename: string => string; let stop_after_parse: compilation_state => compilation_action; @@ -55,11 +56,9 @@ let stop_after_optimization: compilation_state => compilation_action; let stop_after_mashed: compilation_state => compilation_action; -let stop_after_compiled: compilation_state => compilation_action; - -let stop_after_object_file_emitted: compilation_state => compilation_action; +let stop_after_object_emitted: compilation_state => compilation_action; -let stop_after_linked: compilation_state => compilation_action; +let stop_after_compiled: compilation_state => compilation_action; let stop_after_assembled: compilation_state => compilation_action; diff --git a/compiler/src/dune b/compiler/src/dune index 8a78f69fa7..16ddbcf1c1 100644 --- a/compiler/src/dune +++ b/compiler/src/dune @@ -1,9 +1,17 @@ (library (name grain) (public_name grain) - (libraries cmdliner compiler-libs.common grain_codegen grain_linking - grain_middle_end grain_parsing grain_typed grain_utils grain_diagnostics - ppx_sexp_conv.runtime-lib sexplib) + (libraries + cmdliner + compiler-libs.common + grain_codegen + grain_middle_end + grain_parsing + grain_typed + grain_utils + grain_diagnostics + ppx_sexp_conv.runtime-lib + sexplib) (preprocess (pps ppx_sexp_conv))) diff --git a/compiler/src/linking/dune b/compiler/src/linking/dune deleted file mode 100644 index 14c09bc6c5..0000000000 --- a/compiler/src/linking/dune +++ /dev/null @@ -1,8 +0,0 @@ -(library - (name grain_linking) - (public_name grain_linking) - (synopsis "The Grain linker") - (libraries compiler-libs.common grain_codegen grain_utils - ppx_sexp_conv.runtime-lib sexplib ocamlgraph binaryen) - (preprocess - (pps ppx_sexp_conv))) diff --git a/compiler/src/linking/link.re b/compiler/src/linking/link.re deleted file mode 100644 index 15a008ba78..0000000000 --- a/compiler/src/linking/link.re +++ /dev/null @@ -1,824 +0,0 @@ -open Grain_codegen; -open Compmod; -open Grain_typed; -open Grain_utils; -open Cmi_format; -open Binaryen; - -let modules: Hashtbl.t(string, Module.t) = Hashtbl.create(10); -let hard_dependencies: Hashtbl.t(string, unit) = Hashtbl.create(10); - -let grain_module_name = mod_name => { - // Remove GRAIN$MODULE$ - Str.string_after(mod_name, 13); -}; - -let resolve = (~base_dir=?, mod_name) => { - let mod_name = grain_module_name(mod_name); - Module_resolution.locate_unit_object_file(~base_dir?, mod_name); -}; - -let load_module = fullpath => { - let ic = open_in_bin(fullpath); - let length = in_channel_length(ic); - let module_bytes = Bytes.create(length); - really_input(ic, module_bytes, 0, length); - close_in(ic); - Module.read(module_bytes); -}; - -let is_grain_module = mod_name => { - Str.string_match(Str.regexp_string("GRAIN$MODULE$"), mod_name, 0); -}; - -let wasi_polyfill_module = () => - Option.get(Config.wasi_polyfill_path()) ++ ".wasm"; - -let is_wasi_module = mod_name => { - mod_name == "wasi_snapshot_preview1"; -}; - -let is_wasi_polyfill_module = mod_path => { - mod_path == wasi_polyfill_module(); -}; - -let runtime_heap_next_ptr = "GRAIN$RUNTIME_HEAP_NEXT_PTR"; - -let new_base_dir = Filepath.String.dirname; - -let rec load_hard_dependencies = (~base_dir, mod_path) => { - let wasm_mod = Hashtbl.find(modules, mod_path); - let num_globals = Global.get_num_globals(wasm_mod); - for (i in 0 to num_globals - 1) { - let global = Global.get_global_by_index(wasm_mod, i); - let imported_module = Import.global_import_get_module(global); - if (is_grain_module(imported_module)) { - let resolved_import = resolve(~base_dir, imported_module); - Hashtbl.add(hard_dependencies, resolved_import, ()); - if (!Hashtbl.mem(modules, resolved_import)) { - Hashtbl.add(modules, resolved_import, load_module(resolved_import)); - load_hard_dependencies( - ~base_dir=new_base_dir(resolved_import), - resolved_import, - ); - }; - }; - }; - let num_funcs = Function.get_num_functions(wasm_mod); - let has_wasi_polyfill = Option.is_some(Config.wasi_polyfill^); - for (i in 0 to num_funcs - 1) { - let func = Function.get_function_by_index(wasm_mod, i); - let imported_module = Import.function_import_get_module(func); - if (is_grain_module(imported_module)) { - let resolved_import = resolve(~base_dir, imported_module); - Hashtbl.add(hard_dependencies, resolved_import, ()); - if (!Hashtbl.mem(modules, resolved_import)) { - Hashtbl.add(modules, resolved_import, load_module(resolved_import)); - load_hard_dependencies( - ~base_dir=new_base_dir(resolved_import), - resolved_import, - ); - }; - } else if (has_wasi_polyfill - && is_wasi_module(imported_module) - && !is_wasi_polyfill_module(mod_path)) { - // Perform any WASI polyfilling. Note that we skip this step if we are compiling the polyfill module itself. - let imported_module = wasi_polyfill_module(); - Hashtbl.add(hard_dependencies, imported_module, ()); - if (!Hashtbl.mem(modules, imported_module)) { - Hashtbl.add(modules, imported_module, load_module(imported_module)); - load_hard_dependencies( - ~base_dir=new_base_dir(imported_module), - imported_module, - ); - }; - }; - }; -}; - -let gensym_counter = ref(0); -let gensym = name => { - incr(gensym_counter); - Printf.sprintf("%s.linked.%d", name, gensym_counter^); -}; - -let exported_names: Hashtbl.t(string, Hashtbl.t(string, string)) = - Hashtbl.create(10); - -let is_global_imported = global => - Import.global_import_get_base(global) != ""; -let is_function_imported = func => - Import.function_import_get_base(func) != ""; - -// NOTE: A Not_found being raised in the below function likely means that there -// is more than one place in the Binaryen program which has the same -// subexpression (in an identity equality sense). The substitution -// probably succeeded the first time the subexpression was found, but, -// because this process is not idempotent, failed on the second time. The fix -// for this problem is to produce two separate expression instances when -// constructing the AST (either through constructing two separate instances or by -// using Expression.copy()) - -let rec globalize_names = (~function_names, ~global_names, ~label_names, expr) => { - let globalize_names = - globalize_names(~function_names, ~global_names, ~label_names); - - let add_label = Hashtbl.add(label_names); - - let find_function = Hashtbl.find(function_names); - let find_global = Hashtbl.find(global_names); - let find_label = Hashtbl.find(label_names); - - let kind = Expression.get_kind(expr); - switch (kind) { - | Invalid => failwith("Invalid expression") - | Nop => () - | Block => - let internal_name = Expression.Block.get_name(expr); - Option.iter( - internal_name => { - let new_name = gensym(internal_name); - add_label(internal_name, new_name); - - Expression.Block.set_name(expr, new_name); - }, - internal_name, - ); - - let num_children = Expression.Block.get_num_children(expr); - for (i in 0 to num_children - 1) { - globalize_names(Expression.Block.get_child_at(expr, i)); - }; - | If => - globalize_names(Expression.If.get_condition(expr)); - globalize_names(Expression.If.get_if_true(expr)); - Option.iter(globalize_names, Expression.If.get_if_false(expr)); - | Loop => - let internal_name = Expression.Loop.get_name(expr); - let new_name = gensym(internal_name); - add_label(internal_name, new_name); - - Expression.Loop.set_name(expr, new_name); - - globalize_names(Expression.Loop.get_body(expr)); - | Break => - let internal_name = Expression.Break.get_name(expr); - Expression.Break.set_name(expr, find_label(internal_name)); - - Option.iter(globalize_names, Expression.Break.get_condition(expr)); - Option.iter(globalize_names, Expression.Break.get_value(expr)); - | Switch => - let num_names = Expression.Switch.get_num_names(expr); - for (i in 0 to num_names - 1) { - let internal_name = Expression.Switch.get_name_at(expr, i); - Expression.Switch.set_name_at(expr, i, find_label(internal_name)); - }; - - let internal_default_name = Expression.Switch.get_default_name(expr); - Option.iter( - name => Expression.Switch.set_default_name(expr, find_label(name)), - internal_default_name, - ); - - globalize_names(Expression.Switch.get_condition(expr)); - Option.iter(globalize_names, Expression.Switch.get_value(expr)); - | Call => - let internal_name = Expression.Call.get_target(expr); - Expression.Call.set_target(expr, find_function(internal_name)); - - let num_operands = Expression.Call.get_num_operands(expr); - for (i in 0 to num_operands - 1) { - globalize_names(Expression.Call.get_operand_at(expr, i)); - }; - | CallIndirect => - globalize_names(Expression.Call_indirect.get_target(expr)); - - Expression.Call_indirect.set_table( - expr, - Comp_utils.grain_global_function_table, - ); - - let num_operands = Expression.Call_indirect.get_num_operands(expr); - for (i in 0 to num_operands - 1) { - globalize_names(Expression.Call_indirect.get_operand_at(expr, i)); - }; - | LocalGet => () - | LocalSet => globalize_names(Expression.Local_set.get_value(expr)) - | GlobalGet => - let internal_name = Expression.Global_get.get_name(expr); - Expression.Global_get.set_name(expr, find_global(internal_name)); - | GlobalSet => - let internal_name = Expression.Global_set.get_name(expr); - Expression.Global_set.set_name(expr, find_global(internal_name)); - globalize_names(Expression.Global_set.get_value(expr)); - | Load => globalize_names(Expression.Load.get_ptr(expr)) - | Store => - globalize_names(Expression.Store.get_ptr(expr)); - globalize_names(Expression.Store.get_value(expr)); - | MemoryCopy => - globalize_names(Expression.Memory_copy.get_dest(expr)); - globalize_names(Expression.Memory_copy.get_source(expr)); - globalize_names(Expression.Memory_copy.get_size(expr)); - | MemoryFill => - globalize_names(Expression.Memory_fill.get_dest(expr)); - globalize_names(Expression.Memory_fill.get_value(expr)); - globalize_names(Expression.Memory_fill.get_size(expr)); - | Const => () - | Unary => globalize_names(Expression.Unary.get_value(expr)) - | Binary => - globalize_names(Expression.Binary.get_left(expr)); - globalize_names(Expression.Binary.get_right(expr)); - | Select => - globalize_names(Expression.Select.get_if_true(expr)); - globalize_names(Expression.Select.get_if_false(expr)); - globalize_names(Expression.Select.get_condition(expr)); - | Drop => globalize_names(Expression.Drop.get_value(expr)) - | Return => Option.iter(globalize_names, Expression.Return.get_value(expr)) - | MemorySize => () - | MemoryGrow => globalize_names(Expression.Memory_grow.get_delta(expr)) - | Unreachable => () - | TupleMake => - let num_operands = Expression.Tuple_make.get_num_operands(expr); - for (i in 0 to num_operands - 1) { - globalize_names(Expression.Tuple_make.get_operand_at(expr, i)); - }; - | TupleExtract => globalize_names(Expression.Tuple_extract.get_tuple(expr)) - | AtomicRMW - | AtomicCmpxchg - | AtomicWait - | AtomicNotify - | AtomicFence - | SIMDExtract - | SIMDReplace - | SIMDShuffle - | SIMDTernary - | SIMDShift - | SIMDLoad - | SIMDLoadStoreLane - | MemoryInit - | DataDrop - | Pop - | RefNull - | RefIs - | RefFunc - | RefEq - | Try - | Throw - | Rethrow - | I31New - | I31Get - | CallRef - | RefTest - | RefCast - | BrOn - | StructNew - | StructGet - | StructSet - | ArrayNew - | ArrayGet - | ArraySet - | ArrayLen - | RefAs => failwith("Linking NYI for wasm instruction") - }; -}; - -let construct_type_metadata_table = metas => { - // Create a hash table mapping "type hashes" unique to each Grain type to - // offsets in the metadata section - - // Structure: - // | Hash table: array of (offset into mappings data, bucket size) for each hash (type_hash % num_buckets) - // | Mappings: arrays of (type_hash, offset into actual metadata table) for each hash table bucket - // | Metadata: actual metadata content; appropriate offset for type metadata found through table data - let exceptions_buf = Buffer.create(256); - let exception_metas = List.map(m => m.ctm_exceptions, metas); - let exceptions_section_len = - List.fold_left((len, e) => String.length(e) + len, 0, exception_metas) - + 4; - Buffer.add_int32_le(exceptions_buf, Int32.of_int(exceptions_section_len)); - List.iter(Buffer.add_string(exceptions_buf), exception_metas); - - let exception_meta = (Buffer.contents(exceptions_buf), [(0, 0)]); - let non_exception_metas = - List.map(m => (m.ctm_metadata, m.ctm_offsets_tbl), metas); - let metas = [exception_meta, ...non_exception_metas]; - - let metadata_buf = Buffer.create(256); - let curr_offset = ref(0); - let hash_to_offset = - List.flatten( - List.map( - ((meta, offsets_tbl)) => { - Buffer.add_string(metadata_buf, meta); - let padding_bytes = String.length(meta) mod 8; - for (_ in 1 to padding_bytes) { - Buffer.add_int8(metadata_buf, 0); - }; - let hash_to_offset = - List.map( - ((hash, offset)) => (hash, offset + curr_offset^), - offsets_tbl, - ); - curr_offset := curr_offset^ + String.length(meta) + padding_bytes; - hash_to_offset; - }, - metas, - ), - ); - let rec next_pow_of_2 = (num, res) => - if (num <= 1) { - 1 lsl res; - } else { - next_pow_of_2(num lsr 1, res + 1); - }; - let num_entries = List.length(hash_to_offset); - // Choose number of buckets to be the greatest power of 2 <= # table entries - // (limit 4K) as a memory/lookup speed tradeoff (expect 1-2 entries/bucket) - let num_buckets = min(4096, next_pow_of_2(num_entries, 0)); - let buckets = Array.make(num_buckets, []); - List.iter( - ((hash, _) as hash_and_offset) => { - let hash_hash = hash mod num_buckets; - buckets[hash_hash] = [hash_and_offset, ...buckets[hash_hash]]; - }, - hash_to_offset, - ); - for (i in 0 to num_buckets - 1) { - buckets[i] = List.rev(buckets[i]); - }; - - let tbl_buckets_buf = Buffer.create(num_buckets * 8); - let tbl_vals_buf = Buffer.create(num_entries * 8); - // Store the number of buckets at the beginning of the metadata section - Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(num_buckets)); - // For 8-byte alignment - Buffer.add_int32_le(tbl_buckets_buf, 0l); - - // # buckets + buckets + data (2 i32s each) - let tbl_size = 8 + (num_buckets + num_entries) * 8; - // Initialize offset to point after the table buckets - let tbl_data_offset = ref(8 + num_buckets * 8); - Array.iter( - hash_to_offset => { - Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(tbl_data_offset^)); - Buffer.add_int32_le( - tbl_buckets_buf, - Int32.of_int(List.length(hash_to_offset)), - ); - List.iter( - ((hash, offset)) => { - Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(hash)); - Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(offset + tbl_size)); - tbl_data_offset := tbl_data_offset^ + 8; - }, - hash_to_offset, - ); - }, - buckets, - ); - Buffer.add_buffer(tbl_buckets_buf, tbl_vals_buf); - Buffer.add_buffer(tbl_buckets_buf, metadata_buf); - Buffer.to_bytes(tbl_buckets_buf); -}; - -let table_offset = ref(0); -let module_id = ref(Comp_utils.encoded_int32(0)); - -let round_to_8 = n => Int.logand(n + 7, Int.lognot(7)); - -let link_all = (linked_mod, dependencies, signature) => { - gensym_counter := 0; - table_offset := 0; - module_id := Comp_utils.encoded_int32(0); - - let main = Module_resolution.current_filename^(); - let has_wasi_polyfill = Option.is_some(Config.wasi_polyfill^); - - let metadata_tbl_data = - if (Config.elide_type_info^) { - None; - } else { - let cmis = List.map(Cmi_format.read_cmi, dependencies) @ [signature]; - let mds = List.map(x => x.cmi_type_metadata, cmis); - Some(construct_type_metadata_table(mds)); - }; - let runtime_heap_ptr = - switch (Grain_utils.Config.memory_base^) { - | Some(x) => round_to_8(x) - | None => Grain_utils.Config.default_memory_base - }; - let metadata_heap_loc = runtime_heap_ptr + 8; - let metadata_size = - round_to_8( - Option.value(~default=0, Option.map(Bytes.length, metadata_tbl_data)), - ); - let runtime_heap_start = metadata_heap_loc + metadata_size; - - let link_one = dep => { - let function_names: Hashtbl.t(string, string) = Hashtbl.create(128); - let global_names: Hashtbl.t(string, string) = Hashtbl.create(128); - let label_names: Hashtbl.t(string, string) = Hashtbl.create(128); - - let wasm_mod = - switch (Hashtbl.find_opt(modules, dep)) { - | Some(mod_) => mod_ - | None => load_module(dep) - }; - - let num_globals = Global.get_num_globals(wasm_mod); - for (i in 0 to num_globals - 1) { - let global = Global.get_global_by_index(wasm_mod, i); - if (is_global_imported(global)) { - let imported_module = Import.global_import_get_module(global); - if (is_grain_module(imported_module)) { - let imported_name = Import.global_import_get_base(global); - let internal_name = Global.get_name(global); - let new_name = - Hashtbl.find( - Hashtbl.find( - exported_names, - resolve(~base_dir=new_base_dir(dep), imported_module), - ), - imported_name, - ); - Hashtbl.add(global_names, internal_name, new_name); - } else { - let imported_name = Import.global_import_get_base(global); - let internal_name = Global.get_name(global); - let new_name = gensym(internal_name); - Hashtbl.add(global_names, internal_name, new_name); - - if (Comp_utils.is_grain_env(imported_module)) { - let value = - switch (imported_name) { - | "relocBase" => - Some( - Expression.Const.make( - wasm_mod, - Literal.int32(Int32.of_int(table_offset^)), - ), - ) - | "moduleRuntimeId" => - // Module id is tagged; incrementing by 2 is the equivalent of an untagged increment by 1 - module_id := module_id^ + 2; - Some( - Expression.Const.make( - wasm_mod, - Literal.int32(Int32.of_int(module_id^)), - ), - ); - | "runtimeHeapStart" => - Some( - Expression.Const.make( - wasm_mod, - Literal.int32(Int32.of_int(runtime_heap_start)), - ), - ) - | "runtimeHeapNextPtr" => - Hashtbl.replace( - global_names, - internal_name, - runtime_heap_next_ptr, - ); - None; - | "metadataPtr" => - Some( - Expression.Const.make( - wasm_mod, - Literal.int32(Int32.of_int(metadata_heap_loc)), - ), - ) - | value => - failwith( - Printf.sprintf("Unknown Grain runtime value `%s`", value), - ) - }; - switch (value) { - | Some(value) => - ignore @@ - Global.add_global( - linked_mod, - new_name, - Type.int32, - false, - value, - ) - | None => () - }; - } else { - let ty = Global.get_type(global); - let mut = Global.is_mutable(global); - Import.add_global_import( - linked_mod, - new_name, - imported_module, - imported_name, - ty, - mut, - ); - }; - }; - } else { - let internal_name = Global.get_name(global); - let new_name = gensym(internal_name); - Hashtbl.add(global_names, internal_name, new_name); - - let ty = Global.get_type(global); - let mut = Global.is_mutable(global); - let init = Global.get_init_expr(global); - - globalize_names(~function_names, ~global_names, ~label_names, init); - ignore @@ Global.add_global(linked_mod, new_name, ty, mut, init); - }; - }; - - let num_functions = Function.get_num_functions(wasm_mod); - let funcs = - List.init(num_functions, Function.get_function_by_index(wasm_mod)); - let (imported_funcs, funcs) = - List.partition(is_function_imported, funcs); - - List.iter( - func => { - let imported_module = Import.function_import_get_module(func); - if (is_grain_module(imported_module)) { - let imported_name = Import.function_import_get_base(func); - let internal_name = Function.get_name(func); - let new_name = - Hashtbl.find( - Hashtbl.find( - exported_names, - resolve(~base_dir=new_base_dir(dep), imported_module), - ), - imported_name, - ); - Hashtbl.add(function_names, internal_name, new_name); - } else if (has_wasi_polyfill - && is_wasi_module(imported_module) - && !is_wasi_polyfill_module(dep)) { - // Perform any WASI polyfilling. Note that we skip this step if we are compiling the polyfill module itself. - // If we are importing a foreign from WASI, then we swap it out for the foreign from the polyfill. - let imported_name = Import.function_import_get_base(func); - let internal_name = Function.get_name(func); - let wasi_polyfill = wasi_polyfill_module(); - let new_name = - Hashtbl.find_opt( - Hashtbl.find(exported_names, wasi_polyfill), - imported_name, - ); - let new_name = - switch (new_name) { - | Some(new_name) => new_name - | None => - failwith( - Printf.sprintf( - "Unable to locate `%s` in your polyfill. Required by `%s`", - imported_name, - dep, - ), - ) - }; - Hashtbl.add(function_names, internal_name, new_name); - } else { - let imported_name = Import.function_import_get_base(func); - let internal_name = Function.get_name(func); - let new_name = gensym(internal_name); - Hashtbl.add(function_names, internal_name, new_name); - - let params = Function.get_params(func); - let results = Function.get_results(func); - Import.add_function_import( - linked_mod, - new_name, - imported_module, - imported_name, - params, - results, - ); - }; - }, - imported_funcs, - ); - - // Register all function names first as functions may be recursive - List.iter( - func => { - let internal_name = Function.get_name(func); - let new_name = gensym(internal_name); - Hashtbl.add(function_names, internal_name, new_name); - }, - funcs, - ); - - List.iter( - func => { - let internal_name = Function.get_name(func); - let new_name = Hashtbl.find(function_names, internal_name); - - let params = Function.get_params(func); - let results = Function.get_results(func); - let num_locals = Function.get_num_vars(func); - let locals = Array.init(num_locals, i => Function.get_var(func, i)); - let body = Function.get_body(func); - globalize_names(~function_names, ~global_names, ~label_names, body); - ignore @@ - Function.add_function( - linked_mod, - new_name, - params, - results, - locals, - body, - ); - }, - funcs, - ); - - let local_exported_names = - Comp_utils.get_exported_names(~function_names, ~global_names, wasm_mod); - Hashtbl.add(exported_names, dep, local_exported_names); - - let num_element_segments = Table.get_num_element_segments(wasm_mod); - for (i in 0 to num_element_segments - 1) { - let segment = Table.get_element_segment_by_index(wasm_mod, i); - let name = Element_segment.get_name(segment); - let new_name = gensym(name); - let size = Element_segment.get_length(segment); - let elems = - List.init(size, i => - Hashtbl.find(function_names, Element_segment.get_data(segment, i)) - ); - ignore @@ - Table.add_active_element_segment( - linked_mod, - Comp_utils.grain_global_function_table, - new_name, - elems, - Expression.Const.make( - wasm_mod, - Literal.int32(Int32.of_int(table_offset^)), - ), - ); - table_offset := table_offset^ + size; - }; - }; - - ignore @@ - Global.add_global( - linked_mod, - runtime_heap_next_ptr, - Type.int32, - true, - Expression.Const.make( - linked_mod, - Literal.int32(Int32.of_int(runtime_heap_start)), - ), - ); - - if (has_wasi_polyfill) { - link_one(wasi_polyfill_module()); - }; - List.iter(link_one, dependencies); - link_one(main); - - Comp_utils.write_universal_exports( - linked_mod, - signature, - Hashtbl.find(exported_names, main), - ); - - ignore @@ - Table.add_table( - linked_mod, - Comp_utils.grain_global_function_table, - table_offset^, - table_offset^, - Type.funcref, - ); - - let (initial_memory, maximum_memory) = - switch (Config.initial_memory_pages^, Config.maximum_memory_pages^) { - | (initial_memory, Some(maximum_memory)) => ( - initial_memory, - maximum_memory, - ) - | (initial_memory, None) => (initial_memory, Memory.unlimited) - }; - - let data_segments = - switch (metadata_tbl_data) { - | Some(data) => [ - Memory.{ - data, - kind: - Active({ - offset: - Expression.Const.make( - linked_mod, - Literal.int32(Int32.of_int(metadata_heap_loc)), - ), - }), - size: Bytes.length(data), - }, - ] - | None => [] - }; - Memory.set_memory( - linked_mod, - initial_memory, - maximum_memory, - "memory", - data_segments, - false, - false, - Comp_utils.grain_memory, - ); - if (Config.import_memory^) { - Import.add_memory_import( - linked_mod, - Comp_utils.grain_memory, - "env", - "memory", - false, - ); - }; - - let starts = - List.filter_map( - dep => - if (Hashtbl.mem(hard_dependencies, dep)) { - let call_main = - Expression.Drop.make( - linked_mod, - Expression.Call.make( - linked_mod, - Hashtbl.find( - Hashtbl.find(exported_names, dep), - Comp_utils.grain_main, - ), - [], - Type.int32, - ), - ); - Some(call_main); - } else { - None; - }, - dependencies @ [main], - ); - - let start_name = gensym(Comp_utils.grain_start); - let start = - Function.add_function( - linked_mod, - start_name, - Type.none, - Type.none, - [||], - Expression.Block.make(linked_mod, gensym("start"), starts), - ); - - if (Grain_utils.Config.use_start_section^) { - Function.set_start(linked_mod, start); - } else { - ignore @@ - Export.add_function_export(linked_mod, start_name, Comp_utils.grain_start); - }; -}; - -let link_modules = ({asm: wasm_mod, signature}) => { - Hashtbl.clear(modules); - Hashtbl.clear(hard_dependencies); - - let main_module = Module_resolution.current_filename^(); - Hashtbl.add(modules, main_module, wasm_mod); - Hashtbl.add(hard_dependencies, main_module, ()); - - load_hard_dependencies( - ~base_dir=Filepath.String.dirname(main_module), - main_module, - ); - - let dependencies = Module_resolution.get_dependencies(); - - let linked_mod = Module.create(); - link_all(linked_mod, dependencies, signature); - - let features = Module.get_features(wasm_mod); - let _ = Module.set_features(linked_mod, features); - // we set low_memory_unused := true iff the user has not specified a memory base. - // This is because in many use cases in which this is specified (e.g. wasm4), users - // will expect the static region of memory below the heap base to all be available. - let _ = - Settings.set_low_memory_unused( - Option.is_none(Grain_utils.Config.memory_base^), - ); - if (Module.validate(linked_mod) != 1) { - failwith("Generated invalid linked module"); - }; - switch (Config.profile^) { - | Some(Release) => Optimize_mod.optimize(linked_mod) - | None => () - }; - linked_mod; -}; diff --git a/compiler/src/linking/linkmod.re b/compiler/src/linking/linkmod.re deleted file mode 100644 index 3d7eba186d..0000000000 --- a/compiler/src/linking/linkmod.re +++ /dev/null @@ -1,6 +0,0 @@ -open Grain_codegen; - -let statically_link_wasm_module = prog => { - let linked_asm = Link.link_modules(prog); - {...prog, asm: linked_asm}; -}; diff --git a/compiler/src/middle_end/anftree.re b/compiler/src/middle_end/anftree.re index 4a03ce2124..c59aedb8f0 100644 --- a/compiler/src/middle_end/anftree.re +++ b/compiler/src/middle_end/anftree.re @@ -457,6 +457,7 @@ type anf_program = { signature: Cmi_format.cmi_infos, type_metadata: list(type_metadata), analyses: [@sexp.opaque] ref(list(analysis)), + prog_loc: Location.t, }; type anf_bind = diff --git a/compiler/src/middle_end/anftree.rei b/compiler/src/middle_end/anftree.rei index 02044ef413..76dd11f5de 100644 --- a/compiler/src/middle_end/anftree.rei +++ b/compiler/src/middle_end/anftree.rei @@ -436,6 +436,7 @@ type anf_program = { signature: Cmi_format.cmi_infos, type_metadata: list(type_metadata), analyses: ref(list(analysis)), + prog_loc: Location.t, }; type anf_bind = diff --git a/compiler/src/middle_end/linearize.re b/compiler/src/middle_end/linearize.re index 8e7624bd6d..588592ccc6 100644 --- a/compiler/src/middle_end/linearize.re +++ b/compiler/src/middle_end/linearize.re @@ -2227,7 +2227,7 @@ let construct_type_metadata_buffer = type_metadata => { }; let transl_anf_module = - ({statements, env, signature}: typed_program): anf_program => { + ({statements, env, signature, prog_loc}: typed_program): anf_program => { Path_tbl.clear(type_map); Path_tbl.clear(include_map); Path_tbl.clear(module_symbol_map); @@ -2265,6 +2265,7 @@ let transl_anf_module = }, type_metadata, analyses: ref([]), + prog_loc, }; }; diff --git a/compiler/src/parsing/driver.re b/compiler/src/parsing/driver.re index 33af6de1d4..dcfa1612ad 100644 --- a/compiler/src/parsing/driver.re +++ b/compiler/src/parsing/driver.re @@ -157,13 +157,7 @@ let read_imports = (program: Parsetree.parsed_program) => { ); let implicit_opens = List.map( - o => { - switch (o) { - | Grain_utils.Config.Pervasives_mod => - Location.mknoloc("pervasives.gr") - | Grain_utils.Config.Gc_mod => Location.mknoloc("runtime/gc.gr") - } - }, + o => Location.mknoloc(Grain_utils.Config.get_implicit_filepath(o)), Grain_utils.Config.with_attribute_flags( ~no_pervasives=module_has_attr("noPervasives"), ~runtime_mode=module_has_attr("runtimeMode"), diff --git a/compiler/src/parsing/location.re b/compiler/src/parsing/location.re index b741042d9c..15c9e7cf8e 100644 --- a/compiler/src/parsing/location.re +++ b/compiler/src/parsing/location.re @@ -56,7 +56,7 @@ let position_of_sexp = (sexp: Sexplib.Sexp.t) => Sexplib.Sexp.( switch (sexp) { | Atom(str) => of_sexp_error("position_of_sexp: list needed", sexp) - | List([Atom("position"), List(sexp_fields)]) + | List([Atom("position"), ...sexp_fields]) when List.length(sexp_fields) == 4 => let fields = List.map( diff --git a/compiler/src/typed/cmi_format.re b/compiler/src/typed/cmi_format.re index aad926f822..b842ed6437 100644 --- a/compiler/src/typed/cmi_format.re +++ b/compiler/src/typed/cmi_format.re @@ -87,6 +87,8 @@ type cmi_infos = { type config_opt = | Cmi_config_opt('a): config_opt; +let magic = "\xF0\x9F\x8C\xBE"; + let config_sum = Config.get_root_config_digest; let build_crc = (~name: string, sign: Types.signature) => { @@ -103,12 +105,6 @@ let build_crc = (~name: string, sign: Types.signature) => { Digest.bytes(ns_sign); }; -let input_cmi = ic => - switch (cmi_infos_of_yojson @@ Yojson.Safe.from_channel(ic)) { - | Result.Ok(x) => x - | Result.Error(e) => raise(Invalid_argument(e)) - }; - let deserialize_cmi = (ic, size) => { let size = ref(size); let lexbuf = @@ -142,22 +138,32 @@ module CmiBinarySection = let accepts_version = ({major}) => major == 1; }); -let read_cmi = filename => { - let ic = open_in_bin(filename); - switch (CmiBinarySection.load(ic)) { - | Some(cmi) => - close_in(ic); - cmi; - | None - | exception End_of_file - | exception (Invalid_argument(_)) - | exception (Failure(_)) => - close_in(ic); +let read_cmi = (ic, filename): cmi_infos => { + let read_magic = really_input_string(ic, 4); + if (read_magic != magic) { raise(Error(Corrupted_interface(filename))); - | exception (Error(e)) => - close_in(ic); - raise(Error(e)); }; + let version_length = input_binary_int(ic); + let read_version = really_input_string(ic, version_length); + if (read_version != Config.version) { + raise(Error(Wrong_version_interface(filename, read_version))); + }; + let _ = input_binary_int(ic); + Marshal.from_channel(ic); +}; +let read_cmi = filename => { + let ic = open_in_bin(filename); + let cmi = + try(read_cmi(ic, filename)) { + | Error(_) as exn => + close_in(ic); + raise(exn); + | _ => + close_in(ic); + raise(Error(Corrupted_interface(filename))); + }; + close_in(ic); + cmi; }; let serialize_cmi = cmi => diff --git a/compiler/src/typed/cmi_format.rei b/compiler/src/typed/cmi_format.rei index 1967f36bf5..b53fa47a0d 100644 --- a/compiler/src/typed/cmi_format.rei +++ b/compiler/src/typed/cmi_format.rei @@ -35,6 +35,8 @@ type cmi_infos = { cmi_config_sum: string, }; +let magic: string; + let config_sum: unit => string; let build_crc: (~name: string, Types.signature) => Digest.t; @@ -42,9 +44,6 @@ let build_crc: (~name: string, Types.signature) => Digest.t; /* write the magic + the cmi information */ let serialize_cmi: cmi_infos => bytes; -/* read the cmi information (the magic is supposed to have already been read) */ -let input_cmi: in_channel => cmi_infos; - /* read a cmi from a filename, checking the magic */ let read_cmi: string => cmi_infos; diff --git a/compiler/src/typed/env.re b/compiler/src/typed/env.re index 725bb8a456..4a7da30261 100644 --- a/compiler/src/typed/env.re +++ b/compiler/src/typed/env.re @@ -668,19 +668,12 @@ let get_components = c => | Some(c) => c }; -let current_unit = ref(("", "", Grain_utils.Config.Normal)); +let current_unit = ref(("", "")); let set_unit = unit => current_unit := unit; let get_unit = () => current_unit^; -let is_runtime_mode = () => { - switch (current_unit^) { - | (_, _, Runtime) => true - | (_, _, Normal) => false - }; -}; - /* Persistent structure descriptions */ type pers_flags = Cmi_format.pers_flags = | Opaque | Unsafe_string; @@ -798,7 +791,7 @@ let mark_in_progress = (~loc, unit_name, sourcefile) => { Cyclic_dependencies(unit_name, get_dependency_chain(~loc, unit_name)), ); }; - let (stored_name, _, _) = get_unit(); + let (stored_name, _) = get_unit(); Hashtbl.add( compilation_in_progress, sourcefile, @@ -820,7 +813,7 @@ module Persistent_signature = { let load = ref((~loc=Location.dummy_loc, unit_name) => { - switch (Module_resolution.locate_module_file(~loc, unit_name)) { + switch (Module_resolution.locate_object_file(~loc, unit_name)) { | filename => let ret = {filename, cmi: Module_resolution.read_file_cmi(filename)}; Some(ret); @@ -859,7 +852,7 @@ let acknowledge_pers_struct = (check, {Persistent_signature.filename, cmi}) => { fun | Unsafe_string => if (Config.safe_string^) { - let (unit_name, _, _) = get_unit(); + let (unit_name, _) = get_unit(); error(Depend_on_unsafe_string_unit(ps.ps_name, unit_name)); } | Opaque => add_imported_opaque(filename), @@ -960,7 +953,7 @@ let rec find_module_descr = (path, filename, env) => { | PIdent(id) => try(IdTbl.find_same(id, env.components)) { | Not_found => - let (_, unit_source, _) = get_unit(); + let (_, unit_source) = get_unit(); switch (filename) { | Some(filename) when Ident.persistent(id) && !(filename == unit_source) => @@ -1074,7 +1067,7 @@ let find_module = (path, filename, env) => EnvLazy.force(subst_modtype_maker, data); }) { | Not_found => - let (_, unit_source, _) = get_unit(); + let (_, unit_source) = get_unit(); let filename = Option.value(~default=Ident.name(id), filename); if (Ident.persistent(id) && !(filename == unit_source)) { let ps = find_pers_struct(~loc=Location.dummy_loc, filename); @@ -1250,7 +1243,7 @@ and lookup_module = (~loc=?, ~load, ~mark, id, filename, env): Path.t => p; }) { | Not_found => - let (_, unit_source, _) = get_unit(); + let (_, unit_source) = get_unit(); if (Option.value(~default=s, filename) == unit_source) { raise(Not_found); }; @@ -2324,7 +2317,7 @@ let build_signature_with_imports = ps_comps: comps, ps_crcs: cmi.cmi_crcs, ps_crc: cmi.cmi_crc, - ps_filename: Module_resolution.get_output_name(filename), + ps_filename: Module_resolution.get_object_name(filename), ps_flags: cmi.cmi_flags, }; @@ -2630,14 +2623,14 @@ let () = { Module_resolution.current_unit_name := ( () => { - let (uname, _, _) = get_unit(); + let (uname, _) = get_unit(); uname; } ); Module_resolution.current_filename := ( () => { - let (_, source, _) = get_unit(); + let (_, source) = get_unit(); source; } ); diff --git a/compiler/src/typed/env.rei b/compiler/src/typed/env.rei index 727dd560e9..4a7b65d9d8 100644 --- a/compiler/src/typed/env.rei +++ b/compiler/src/typed/env.rei @@ -162,9 +162,8 @@ let add_local_type: (Path.t, type_declaration, t) => t; let add_item: (signature_item, t) => t; let add_signature: (signature, t) => t; -let set_unit: ((string, string, Grain_utils.Config.compilation_mode)) => unit; -let get_unit: unit => (string, string, Grain_utils.Config.compilation_mode); -let is_runtime_mode: unit => bool; +let set_unit: ((string, string)) => unit; +let get_unit: unit => (string, string); /* Insertion of a module */ let include_module: (Identifier.t, include_declaration, t) => t; diff --git a/compiler/src/typed/module_resolution.re b/compiler/src/typed/module_resolution.re index 39b542cf31..fe171fbba0 100644 --- a/compiler/src/typed/module_resolution.re +++ b/compiler/src/typed/module_resolution.re @@ -12,7 +12,7 @@ let error = err => raise(Error(err)); type module_location_result = | GrainModule(string, option(string)) /* Grain Source file, Compiled object */ - | WasmModule(string); /* Compiled object */ + | ObjectFile(string); /* Compiled object */ let compile_module_dependency: ref((string, string) => unit) = ref((filename, output_file) => @@ -49,22 +49,27 @@ let read_file_cmi = f => { }; }; -let get_output_name = name => name ++ ".wasm"; +let get_object_name = name => Filepath.String.replace_extension(name, "gro"); let find_ext_in_dir = (dir, name) => { let fullname = Filepath.String.concat(dir, name); let rec process_ext = fun | [] => None - | [ext, ..._] when file_exists(fullname ++ ext) => - Some((fullname ++ ext, dir, name)) - | [_, ...tl] => process_ext(tl); + | [ext, ...tl] => { + let with_ext = Filepath.String.replace_extension(fullname, ext); + if (file_exists(with_ext)) { + Some((with_ext, dir, name)); + } else { + process_ext(tl); + }; + }; process_ext; }; let find_in_path_uncap = - (~check_src=false, ~check_wasm=false, base_dir, path, name) => { - let exts = (check_src ? [""] : []) @ (check_wasm ? [".wasm"] : []); + (~check_src=false, ~check_object=false, base_dir, path, name) => { + let exts = (check_src ? ["gr"] : []) @ (check_object ? ["gro"] : []); let rec try_dir = fun | [] => raise(Not_found) @@ -175,7 +180,7 @@ let resolve_unit = (~search_path=?, ~cache=true, ~base_dir=?, unit_name) => { let (_, dir, basename) = find_in_path_uncap( ~check_src=true, - ~check_wasm=true, + ~check_object=true, base_dir, path, unit_name, @@ -203,16 +208,18 @@ let locate_module = (~disable_relpath=false, base_dir, path, unit_name) => { | Some(m) => m | None => let (dir, m) = - switch (find_in_path_uncap(~check_wasm=true, base_dir, path, unit_name)) { + switch ( + find_in_path_uncap(~check_object=true, base_dir, path, unit_name) + ) { | (objpath, dir, basename) => ignore(log_resolution(unit_name, dir, basename)); - let file = find_ext_in_dir(dir, basename, [""]); + let file = find_ext_in_dir(dir, basename, ["gr"]); switch (file) { | Some((srcpath, _, _)) => ( dir, GrainModule(srcpath, Some(objpath)), ) - | None => (dir, WasmModule(objpath)) + | None => (dir, ObjectFile(objpath)) }; | exception Not_found => let (srcpath, dir, _) = @@ -273,12 +280,12 @@ type dependency_node = { dn_latest_resolution: ref(option(module_location_result)), }; -let located_to_out_file_name = (~base=?, located) => { +let located_to_object_file_name = (~base=?, located) => { let ret = switch (located) { - | GrainModule(srcpath, None) => get_output_name(srcpath) + | GrainModule(srcpath, None) => get_object_name(srcpath) | GrainModule(_, Some(outpath)) - | WasmModule(outpath) => outpath + | ObjectFile(outpath) => outpath }; Filepath.to_string(Filepath.String.derelativize(~base?, ret)); }; @@ -294,7 +301,7 @@ let locate_unit_object_file = (~path=?, ~base_dir=?, unit_name) => { | Some(p) => p | None => Config.module_search_path() }; - located_to_out_file_name(locate_module(base_dir, path, unit_name)); + located_to_object_file_name(locate_module(base_dir, path, unit_name)); }; module Dependency_graph = @@ -324,7 +331,7 @@ module Dependency_graph = name.Location.txt, name.Location.loc, ); - let out_file_name = located_to_out_file_name(located); + let out_file_name = located_to_object_file_name(located); let existing_dependency = lookup(out_file_name); switch (existing_dependency) { | Some(ed) => @@ -349,7 +356,7 @@ module Dependency_graph = // nothing uses --no-pervasives or --no-gc. switch (located) { | None => failwith("get_dependencies: Should be impossible") - | Some(WasmModule(_)) => [] + | Some(ObjectFile(_)) => [] | Some(GrainModule(srcpath, None)) => from_srcpath(srcpath) | Some(GrainModule(srcpath, Some(objpath))) => switch (read_file_cmi(objpath)) { @@ -364,7 +371,7 @@ module Dependency_graph = name, Location.in_file(dn.dn_file_name), ); - let out_file_name = located_to_out_file_name(located); + let out_file_name = located_to_object_file_name(located); let existing_dependency = lookup(out_file_name); switch (existing_dependency) { | Some(ed) => @@ -395,7 +402,7 @@ module Dependency_graph = | (false, Some(GrainModule(_, None))) => // File isn't compiled, so it's not up-to-date yet. dn.dn_up_to_date := false - | (false, Some(WasmModule(_))) => + | (false, Some(ObjectFile(_))) => // WASM modules are always up-to-date dn.dn_up_to_date := true | (false, Some(GrainModule(srcpath, Some(objpath)))) => @@ -414,10 +421,10 @@ module Dependency_graph = && List.for_all( ((name, crc)) => { let resolved = resolve_unit(~base_dir, name); - let out_file_name = get_output_name(resolved); - Fs_access.file_exists(out_file_name) + let object_name = get_object_name(resolved); + Fs_access.file_exists(object_name) && ( - try(read_file_cmi(out_file_name).cmi_crc == crc) { + try(read_file_cmi(object_name).cmi_crc == crc) { | _ => false } ); @@ -440,12 +447,12 @@ module Dependency_graph = let srcpath = switch (dn.dn_latest_resolution^) { | None => failwith("impossible: compile_module > None") - | Some(WasmModule(_)) => - failwith("impossible: compile_module > WasmModule") + | Some(ObjectFile(_)) => + failwith("impossible: compile_module > ObjectFile") | Some(GrainModule(srcpath, _)) => Filepath.to_string(Filepath.String.derelativize(srcpath)) }; - let outpath = get_output_name(srcpath); + let outpath = get_object_name(srcpath); let loc = Option.value(loc, ~default=Grain_parsing.Location.dummy_loc); let chosen_unit_name = switch (Hashtbl.to_seq(dn.dn_unit_name, ())) { @@ -469,21 +476,21 @@ module Dependency_graph = }; }); -let locate_module_file = (~loc, ~disable_relpath=false, unit_name) => { +let locate_object_file = (~loc, ~disable_relpath=false, unit_name) => { let base_dir = Filepath.String.dirname(current_filename^()); let path = Config.module_search_path(); let located = try_locate_module(~disable_relpath, base_dir, path, unit_name, loc); - located_to_out_file_name(located); + located_to_object_file_name(located); }; let process_dependency = (~loc, ~base_file, unit_name) => { let base_dir = Filepath.String.dirname(base_file); let path = Config.module_search_path(); let located = try_locate_module(base_dir, path, unit_name, loc); - let out_file = located_to_out_file_name(located); + let object_file = located_to_object_file_name(located); let current_dep_node = Dependency_graph.lookup_filename(base_file); - let existing_dependency = Dependency_graph.lookup_filename(out_file); + let existing_dependency = Dependency_graph.lookup_filename(object_file); let dn = switch (existing_dependency) { | Some(ed) => @@ -494,7 +501,7 @@ let process_dependency = (~loc, ~base_file, unit_name) => { Hashtbl.add(tbl, current_dep_node, unit_name); { dn_unit_name: tbl, - dn_file_name: out_file, + dn_file_name: object_file, dn_up_to_date: ref(false), // <- needs to be checked dn_latest_resolution: ref(Some(located)), }; diff --git a/compiler/src/typed/module_resolution.rei b/compiler/src/typed/module_resolution.rei index f82f1d2c34..22ff8105ed 100644 --- a/compiler/src/typed/module_resolution.rei +++ b/compiler/src/typed/module_resolution.rei @@ -1,6 +1,6 @@ -let get_output_name: string => string; +let get_object_name: string => string; -let locate_module_file: +let locate_object_file: (~loc: Grain_parsing.Location.t, ~disable_relpath: bool=?, string) => string; let locate_unit_object_file: diff --git a/compiler/src/typed/typedtree.re b/compiler/src/typed/typedtree.re index ba60e94c37..98ceaa24a1 100644 --- a/compiler/src/typed/typedtree.re +++ b/compiler/src/typed/typedtree.re @@ -630,6 +630,7 @@ type typed_program = { env: [@sexp.opaque] Env.t, signature: Cmi_format.cmi_infos, comments: list(comment), + prog_loc: Location.t, }; let iter_pattern_desc = (f, patt) => diff --git a/compiler/src/typed/typedtree.rei b/compiler/src/typed/typedtree.rei index c5556ff828..848cc99d08 100644 --- a/compiler/src/typed/typedtree.rei +++ b/compiler/src/typed/typedtree.rei @@ -590,6 +590,7 @@ type typed_program = { env: Env.t, signature: Cmi_format.cmi_infos, comments: list(comment), + prog_loc: Location.t, }; /* Auxiliary functions over the AST */ diff --git a/compiler/src/typed/typemod.re b/compiler/src/typed/typemod.re index 0816009c04..da7bb8d768 100644 --- a/compiler/src/typed/typemod.re +++ b/compiler/src/typed/typemod.re @@ -991,11 +991,7 @@ let type_module = type_module(None); let register_implicit_modules = modules => { List.iter( m => { - let filepath = - switch (m) { - | Grain_utils.Config.Pervasives_mod => "pervasives.gr" - | Grain_utils.Config.Gc_mod => "runtime/gc.gr" - }; + let filepath = Grain_utils.Config.get_implicit_filepath(m); Env.add_import(filepath); }, modules, @@ -1004,8 +1000,11 @@ let register_implicit_modules = modules => { let lookup_implicit_module_spec = m => switch (m) { - | Grain_utils.Config.Pervasives_mod => Some(("Pervasives", "pervasives.gr")) + | Grain_utils.Config.Pervasives_mod => + Some(("Pervasives", Grain_utils.Config.get_implicit_filepath(m))) | Grain_utils.Config.Gc_mod => None + | Grain_utils.Config.Exception_mod => None + | Grain_utils.Config.Equal_mod => None }; let get_current_used_implicit_modules = implicit_opens => @@ -1034,7 +1033,7 @@ let initial_env = () => { let env = initial; let implicit_modules = Grain_utils.Config.get_implicit_opens(); register_implicit_modules(implicit_modules); - let (unit_name, source, mode) = Env.get_unit(); + let (unit_name, source) = Env.get_unit(); List.fold_left( (env, m) => { let (modname, _) = m; @@ -1049,14 +1048,10 @@ let initial_env = () => { ); }; -let type_implementation = prog => { +let type_implementation = (prog: Parsetree.parsed_program) => { let sourcefile = prog.prog_loc.loc_start.pos_fname; let module_name = prog.module_name.txt; - Env.set_unit(( - module_name, - sourcefile, - Grain_utils.Config.compilation_mode^, - )); + Env.set_unit((module_name, sourcefile)); let initenv = initial_env(); let (statements, sg, finalenv) = type_module(initenv, prog.statements); let simple_sg = simplify_signature(sg); @@ -1075,6 +1070,7 @@ let type_implementation = prog => { env: finalenv, signature, comments: prog.comments, + prog_loc: prog.prog_loc, }; }; diff --git a/compiler/src/utils/config.re b/compiler/src/utils/config.re index d8a70df045..2f41324a0b 100644 --- a/compiler/src/utils/config.re +++ b/compiler/src/utils/config.re @@ -16,6 +16,12 @@ type digestible_opt = type config = list(saved_config_opt); +let version = + switch (Build_info.V1.version()) { + | None => "unknown" + | Some(v) => Build_info.V1.Version.to_string(v) + }; + let empty: config = []; /* Here we model the API provided by cmdliner without introducing @@ -398,6 +404,7 @@ let import_memory = false, ); +[@deriving sexp] type compilation_mode = | Normal /* Standard compilation with regular bells and whistles */ | Runtime /* GC doesn't exist yet, allocations happen in runtime heap */; @@ -580,7 +587,19 @@ let with_attribute_flags = (~no_pervasives, ~runtime_mode, thunk) => { type implicit_opens = | Pervasives_mod - | Gc_mod; + | Gc_mod + | Exception_mod + | Equal_mod; + +let all_implicit_opens = [Pervasives_mod, Gc_mod, Exception_mod, Equal_mod]; + +let get_implicit_filepath = m => + switch (m) { + | Pervasives_mod => "pervasives.gr" + | Gc_mod => "runtime/gc.gr" + | Exception_mod => "runtime/exception.gr" + | Equal_mod => "runtime/equal.gr" + }; let get_implicit_opens = () => { let ret = @@ -595,6 +614,7 @@ let get_implicit_opens = () => { // Pervasives goes first, just for good measure. List.rev([ Gc_mod, + Exception_mod, ...ret, ]); }; diff --git a/compiler/src/utils/config.rei b/compiler/src/utils/config.rei index bab3999d17..7ea10bceee 100644 --- a/compiler/src/utils/config.rei +++ b/compiler/src/utils/config.rei @@ -1,10 +1,14 @@ type profile = | Release; +[@deriving sexp] type compilation_mode = | Normal /* Standard compilation with regular bells and whistles */ | Runtime /* GC doesn't exist yet, allocations happen in runtime heap */; +/** The version of the Grain compiler */ +let version: string; + /** The Grain stdlib directory, based on the current configuration */ let stdlib_directory: unit => option(string); @@ -187,6 +191,10 @@ let with_attribute_flags: type implicit_opens = | Pervasives_mod - | Gc_mod; + | Gc_mod + | Exception_mod + | Equal_mod; +let all_implicit_opens: list(implicit_opens); +let get_implicit_filepath: implicit_opens => string; let get_implicit_opens: unit => list(implicit_opens); diff --git a/compiler/src/utils/dune b/compiler/src/utils/dune index a126a024cd..a459fc1651 100644 --- a/compiler/src/utils/dune +++ b/compiler/src/utils/dune @@ -2,8 +2,15 @@ (name grain_utils) (public_name grain_utils) (synopsis "Utilities for the Grain compiler") - (libraries fp fs.lib cmdliner compiler-libs.common ppx_sexp_conv.runtime-lib - sexplib str) + (libraries + fp + fs.lib + cmdliner + compiler-libs.common + ppx_sexp_conv.runtime-lib + sexplib + str + dune-build-info) (preprocess (pps ppx_sexp_conv sedlex.ppx)) (js_of_ocaml diff --git a/compiler/test/TestFramework.re b/compiler/test/TestFramework.re index 1b2ea853a6..f9cfdeb208 100644 --- a/compiler/test/TestFramework.re +++ b/compiler/test/TestFramework.re @@ -38,9 +38,11 @@ let clean_grain_output = stdlib_dir => Array.iter( file => { let filename = Filepath.to_string(file); - if (Filepath.String.check_suffix(filename, ".gr.wasm") - || Filepath.String.check_suffix(filename, ".gr.wat") - || Filepath.String.check_suffix(filename, ".gr.modsig")) { + if (Filepath.String.check_suffix(filename, ".wasm") + || Filepath.String.check_suffix(filename, ".wat") + || Filepath.String.check_suffix(filename, ".gro") + || Filepath.String.check_suffix(filename, ".mashtree") + || Filepath.String.check_suffix(filename, ".modsig")) { Fs.rmExn(file); }; }, diff --git a/compiler/test/runner.re b/compiler/test/runner.re index de1b3d3c60..2a985fdbeb 100644 --- a/compiler/test/runner.re +++ b/compiler/test/runner.re @@ -23,9 +23,9 @@ let stdlibfile = name => let runtimefile = name => Filepath.to_string(Fp.At.(test_runtime_dir / (name ++ ".gr"))); let wasmfile = name => - Filepath.to_string(Fp.At.(test_output_dir / (name ++ ".gr.wasm"))); -let watfile = name => - Filepath.to_string(Fp.At.(test_output_dir / (name ++ ".gr.wat"))); + Filepath.to_string(Fp.At.(test_output_dir / (name ++ ".wasm"))); +let mashfile = name => + Filepath.to_string(Fp.At.(test_output_dir / (name ++ ".mashtree"))); let grainfmt_out_file = name => Filepath.to_string(Fp.At.(test_grainfmt_dir / (name ++ ".expected.gr"))); @@ -223,12 +223,12 @@ let makeSnapshotRunner = Config.preserve_all_configs(() => { ignore @@ compile( - ~hook=stop_after_object_file_emitted, + ~hook=stop_after_object_emitted, ~config_fn?, name, module_header ++ prog, ); - expect.file(watfile(name)).toMatchSnapshot(); + expect.file(mashfile(name)).toMatchSnapshot(); }) }); }; @@ -253,13 +253,12 @@ let makeSnapshotFileRunner = (test, ~config_fn=?, name, filename) => { let outfile = wasmfile(name); ignore @@ compile_file( - ~hook=stop_after_object_file_emitted, + ~hook=stop_after_object_emitted, ~config_fn?, infile, outfile, ); - let file = watfile(name); - expect.file(file).toMatchSnapshot(); + expect.file(mashfile(name)).toMatchSnapshot(); }) }); }; diff --git a/compiler/test/suites/basic_functionality.re b/compiler/test/suites/basic_functionality.re index dd75d71186..3e2f96199a 100644 --- a/compiler/test/suites/basic_functionality.re +++ b/compiler/test/suites/basic_functionality.re @@ -377,6 +377,6 @@ describe("basic functionality", ({test, testSkip}) => { ~config_fn=smallestFileConfig, "smallest_grain_program", "", - 4750, + 6424, ); }); diff --git a/compiler/test/suites/modules.re b/compiler/test/suites/modules.re index 475a4d1d71..ef4102b413 100644 --- a/compiler/test/suites/modules.re +++ b/compiler/test/suites/modules.re @@ -131,7 +131,7 @@ describe("modules", ({test, testSkip}) => { let outfile = wasmfile(name); ignore @@ compile( - ~hook=Grain.Compile.stop_after_object_file_emitted, + ~hook=Grain.Compile.stop_after_assembled, name, {| module ReprovidedSimple diff --git a/compiler/test/suites/provides.re b/compiler/test/suites/provides.re index e91797a3b0..59938b7cd5 100644 --- a/compiler/test/suites/provides.re +++ b/compiler/test/suites/provides.re @@ -20,14 +20,10 @@ describe("provides", ({test, testSkip}) => { name, ({expect}) => { let state = - compile( - ~hook=Grain.Compile.stop_after_object_file_emitted, - name, - prog, - ); + compile(~hook=Grain.Compile.stop_after_compiled, name, prog); (); switch (state.Grain.Compile.cstate_desc) { - | ObjectFileEmitted({asm}) => + | Compiled({asm}) => let num_exports = Binaryen.Export.get_num_exports(asm); let exports = List.init( diff --git a/stdlib/package.json b/stdlib/package.json index b2757c3ee2..4092183f22 100644 --- a/stdlib/package.json +++ b/stdlib/package.json @@ -27,7 +27,7 @@ "index.js" ], "scripts": { - "clean": "del-cli \"**/*.wasm\" \"**/*.wat\" \"**/*.modsig\"" + "clean": "del-cli \"**/*.wasm\" \"**/*.wat\" \"**/*.gro\" \"**/*.modsig\"" }, "dependencies": {}, "devDependencies": { From ee7936ed6ad344dd896e1437babe066cb82bac53 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sun, 28 Apr 2024 01:01:26 -0500 Subject: [PATCH 02/20] snapshots --- .../__snapshots__/arrays.0f9e7d37.0.snapshot | 276 +- .../__snapshots__/arrays.1deb7b51.0.snapshot | 295 +-- .../__snapshots__/arrays.24453e6e.0.snapshot | 81 +- .../__snapshots__/arrays.28fcc534.0.snapshot | 276 +- .../__snapshots__/arrays.4c8c9f91.0.snapshot | 276 +- .../__snapshots__/arrays.6eac4e1f.0.snapshot | 276 +- .../__snapshots__/arrays.74d79181.0.snapshot | 276 +- .../__snapshots__/arrays.9e17b4d1.0.snapshot | 81 +- .../__snapshots__/arrays.b85cb7fc.0.snapshot | 81 +- .../basic_functionality.00bcbc39.0.snapshot | 135 +- .../basic_functionality.00cfdb2e.0.snapshot | 46 +- .../basic_functionality.03de4778.0.snapshot | 46 +- .../basic_functionality.040643b3.0.snapshot | 113 +- .../basic_functionality.06bd2a80.0.snapshot | 84 +- .../basic_functionality.0996c5f7.0.snapshot | 79 +- .../basic_functionality.0a230f18.0.snapshot | 79 +- .../basic_functionality.0a2e4afa.0.snapshot | 79 +- .../basic_functionality.0c0b170b.0.snapshot | 79 +- .../basic_functionality.0c400bde.0.snapshot | 79 +- .../basic_functionality.0e812a39.0.snapshot | 121 +- .../basic_functionality.0f79ce35.0.snapshot | 80 +- .../basic_functionality.10dda088.0.snapshot | 113 +- .../basic_functionality.122e74b0.0.snapshot | 160 +- .../basic_functionality.125626a9.0.snapshot | 79 +- .../basic_functionality.13335202.0.snapshot | 121 +- .../basic_functionality.1ad0f349.0.snapshot | 121 +- .../basic_functionality.1ae16d82.0.snapshot | 79 +- .../basic_functionality.1b68c8db.0.snapshot | 79 +- .../basic_functionality.1bf5759c.0.snapshot | 171 +- .../basic_functionality.1d2ec323.0.snapshot | 365 +-- .../basic_functionality.1e4b1f39.0.snapshot | 79 +- .../basic_functionality.1f787365.0.snapshot | 138 +- .../basic_functionality.20f7581b.0.snapshot | 46 +- .../basic_functionality.240ef39e.0.snapshot | 113 +- .../basic_functionality.2756b429.0.snapshot | 46 +- .../basic_functionality.27a7e2f7.0.snapshot | 72 +- .../basic_functionality.28405f1f.0.snapshot | 121 +- .../basic_functionality.28bf4c9e.0.snapshot | 79 +- .../basic_functionality.2bcc447b.0.snapshot | 279 +-- .../basic_functionality.2cb30a54.0.snapshot | 73 +- .../basic_functionality.2d7e34cf.0.snapshot | 46 +- .../basic_functionality.2f2f8795.0.snapshot | 79 +- .../basic_functionality.2f53324c.0.snapshot | 80 +- .../basic_functionality.2f65c8cf.0.snapshot | 46 +- .../basic_functionality.304ca65f.0.snapshot | 46 +- .../basic_functionality.31e0d562.0.snapshot | 64 +- .../basic_functionality.32a8c452.0.snapshot | 171 +- .../basic_functionality.34dcfbdd.0.snapshot | 64 +- .../basic_functionality.3c2ba165.0.snapshot | 413 +-- .../basic_functionality.3e5f990b.0.snapshot | 79 +- .../basic_functionality.3edefd23.0.snapshot | 74 +- .../basic_functionality.3ffd0bf3.0.snapshot | 46 +- .../basic_functionality.427c6671.0.snapshot | 60 +- .../basic_functionality.448497ab.0.snapshot | 46 +- .../basic_functionality.46348f36.0.snapshot | 140 +- .../basic_functionality.48db380c.0.snapshot | 46 +- .../basic_functionality.4d1501b9.0.snapshot | 64 +- .../basic_functionality.4d6f9417.0.snapshot | 46 +- .../basic_functionality.4f5bd247.0.snapshot | 64 +- .../basic_functionality.52ca8e0e.0.snapshot | 395 +-- .../basic_functionality.565dbeda.0.snapshot | 46 +- .../basic_functionality.5705b20c.0.snapshot | 79 +- .../basic_functionality.593b8d63.0.snapshot | 201 +- .../basic_functionality.5b56d472.0.snapshot | 46 +- .../basic_functionality.5cd54e52.0.snapshot | 46 +- .../basic_functionality.5d973a3e.0.snapshot | 79 +- .../basic_functionality.61c58118.0.snapshot | 118 +- .../basic_functionality.626b2e44.0.snapshot | 192 +- .../basic_functionality.65d36891.0.snapshot | 79 +- .../basic_functionality.67d2cc45.0.snapshot | 79 +- .../basic_functionality.684b6ecb.0.snapshot | 79 +- .../basic_functionality.68d08483.0.snapshot | 79 +- .../basic_functionality.6f9706c2.0.snapshot | 46 +- .../basic_functionality.704872bc.0.snapshot | 46 +- .../basic_functionality.711a4824.0.snapshot | 1298 ++++------ .../basic_functionality.7222ab37.0.snapshot | 46 +- .../basic_functionality.7287219f.0.snapshot | 79 +- .../basic_functionality.7599b5a6.0.snapshot | 135 +- .../basic_functionality.7848308f.0.snapshot | 46 +- .../basic_functionality.79ea1ccc.0.snapshot | 135 +- .../basic_functionality.7b13e79a.0.snapshot | 46 +- .../basic_functionality.7bb7b0d4.0.snapshot | 60 +- .../basic_functionality.7beffe4d.0.snapshot | 64 +- .../basic_functionality.7ccc4940.0.snapshot | 126 +- .../basic_functionality.7d0640b4.0.snapshot | 192 +- .../basic_functionality.83f51526.0.snapshot | 64 +- .../basic_functionality.86f332c6.0.snapshot | 46 +- .../basic_functionality.8c8313f3.0.snapshot | 64 +- .../basic_functionality.8e01d666.0.snapshot | 64 +- .../basic_functionality.903ff701.0.snapshot | 64 +- .../basic_functionality.9110d0f5.0.snapshot | 80 +- .../basic_functionality.9157dba1.0.snapshot | 79 +- .../basic_functionality.9379df0d.0.snapshot | 371 +-- .../basic_functionality.950b8fda.0.snapshot | 46 +- .../basic_functionality.970a2a2b.0.snapshot | 46 +- .../basic_functionality.974b7936.0.snapshot | 79 +- .../basic_functionality.994117f8.0.snapshot | 74 +- .../basic_functionality.9b9c7047.0.snapshot | 64 +- .../basic_functionality.9c18b19d.0.snapshot | 149 +- .../basic_functionality.9df4a5e0.0.snapshot | 46 +- .../basic_functionality.9fb01eb5.0.snapshot | 46 +- .../basic_functionality.a0045d1c.0.snapshot | 79 +- .../basic_functionality.a0747361.0.snapshot | 46 +- .../basic_functionality.a2e63440.0.snapshot | 113 +- .../basic_functionality.a3f7e180.0.snapshot | 112 +- .../basic_functionality.a4ec9fca.0.snapshot | 46 +- .../basic_functionality.a58a9361.0.snapshot | 79 +- .../basic_functionality.a5d5182f.0.snapshot | 114 +- .../basic_functionality.a72898d0.0.snapshot | 113 +- .../basic_functionality.abd9d13c.0.snapshot | 113 +- .../basic_functionality.b07cc734.0.snapshot | 192 +- .../basic_functionality.b6a1b657.0.snapshot | 79 +- .../basic_functionality.b836b89a.0.snapshot | 207 +- .../basic_functionality.bb137371.0.snapshot | 135 +- .../basic_functionality.bd891a1f.0.snapshot | 46 +- .../basic_functionality.bef9449e.0.snapshot | 114 +- .../basic_functionality.c1554a92.0.snapshot | 46 +- .../basic_functionality.c2c74be4.0.snapshot | 79 +- .../basic_functionality.c4090bb1.0.snapshot | 498 ++-- .../basic_functionality.c49928a5.0.snapshot | 79 +- .../basic_functionality.c55feb83.0.snapshot | 80 +- .../basic_functionality.c8095f7c.0.snapshot | 74 +- .../basic_functionality.c8144b17.0.snapshot | 46 +- .../basic_functionality.cb9c6c66.0.snapshot | 74 +- .../basic_functionality.cdeddcd2.0.snapshot | 79 +- .../basic_functionality.cefeb364.0.snapshot | 79 +- .../basic_functionality.d0c0c62b.0.snapshot | 79 +- .../basic_functionality.d0cb4f44.0.snapshot | 74 +- .../basic_functionality.d124f931.0.snapshot | 46 +- .../basic_functionality.d6ca4146.0.snapshot | 138 +- .../basic_functionality.d8a7dcf9.0.snapshot | 79 +- .../basic_functionality.d8f6f027.0.snapshot | 64 +- .../basic_functionality.d9fc01df.0.snapshot | 79 +- .../basic_functionality.dbf5d3ff.0.snapshot | 79 +- .../basic_functionality.df4cd2bf.0.snapshot | 80 +- .../basic_functionality.e2902464.0.snapshot | 121 +- .../basic_functionality.e3995c7d.0.snapshot | 158 +- .../basic_functionality.e56cd2a2.0.snapshot | 113 +- .../basic_functionality.e58c3266.0.snapshot | 79 +- .../basic_functionality.e6ea6b06.0.snapshot | 60 +- .../basic_functionality.e811c1e1.0.snapshot | 79 +- .../basic_functionality.ee7c0ebc.0.snapshot | 79 +- .../basic_functionality.f132ca8b.0.snapshot | 74 +- .../basic_functionality.f47797ca.0.snapshot | 64 +- .../basic_functionality.f58be537.0.snapshot | 419 +--- .../basic_functionality.f90a3baa.0.snapshot | 64 +- .../basic_functionality.f9743171.0.snapshot | 64 +- .../basic_functionality.fd64a58f.0.snapshot | 79 +- .../basic_functionality.fe19cffe.0.snapshot | 79 +- .../basic_functionality.fe88cb04.0.snapshot | 666 ++--- .../__snapshots__/boxes.08fca3f7.0.snapshot | 172 +- .../__snapshots__/boxes.0c59fc4e.0.snapshot | 192 +- .../__snapshots__/boxes.17668725.0.snapshot | 192 +- .../__snapshots__/boxes.2b56febf.0.snapshot | 192 +- .../__snapshots__/boxes.7d564476.0.snapshot | 172 +- .../__snapshots__/boxes.9035923e.0.snapshot | 192 +- .../__snapshots__/boxes.adbe1660.0.snapshot | 172 +- .../__snapshots__/boxes.bc258c1b.0.snapshot | 172 +- .../__snapshots__/boxes.eb81e542.0.snapshot | 122 +- .../__snapshots__/chars.200d9e1a.0.snapshot | 46 +- .../__snapshots__/chars.259e330c.0.snapshot | 46 +- .../__snapshots__/chars.27fb7f30.0.snapshot | 46 +- .../__snapshots__/chars.51010573.0.snapshot | 46 +- .../__snapshots__/chars.7e0f68db.0.snapshot | 46 +- .../__snapshots__/chars.af4b3613.0.snapshot | 46 +- .../__snapshots__/chars.e1cac8cd.0.snapshot | 46 +- .../comments.573e549e.0.snapshot | 46 +- .../comments.8f52e899.0.snapshot | 46 +- .../comments.ccf5fcf4.0.snapshot | 46 +- .../comments.fd91c233.0.snapshot | 46 +- .../early_return.1183a893.0.snapshot | 201 +- .../__snapshots__/enums.aa34084a.0.snapshot | 82 +- .../__snapshots__/enums.ae26523b.0.snapshot | 569 ++--- .../exceptions.a68ae348.0.snapshot | 82 +- .../exceptions.ccac3e71.0.snapshot | 82 +- .../functions.06134c8a.0.snapshot | 117 +- .../functions.0b8146ea.0.snapshot | 131 +- .../functions.14922a92.0.snapshot | 144 +- .../functions.1be5ecd5.0.snapshot | 120 +- .../functions.23afd9c9.0.snapshot | 664 ++--- .../functions.28e0f2b3.0.snapshot | 160 +- .../functions.49ccab54.0.snapshot | 262 +- .../functions.6eacded0.0.snapshot | 821 +++--- .../functions.7a8986a5.0.snapshot | 112 +- .../functions.84b6e84b.0.snapshot | 120 +- .../functions.8baf471f.0.snapshot | 418 ++-- .../functions.9223245d.0.snapshot | 586 ++--- .../functions.9fd69835.0.snapshot | 144 +- .../functions.b37949b2.0.snapshot | 424 ++-- .../functions.b3a8d88b.0.snapshot | 592 ++--- .../functions.b632a2ab.0.snapshot | 152 +- .../functions.c6e8a9aa.0.snapshot | 160 +- .../functions.ce978f54.0.snapshot | 46 +- .../functions.d9466880.0.snapshot | 332 +-- .../functions.e6c6212b.0.snapshot | 147 +- .../functions.f400bb7b.0.snapshot | 670 ++--- .../functions.f647681b.0.snapshot | 252 +- .../includes.1d829099.0.snapshot | 52 +- .../includes.46f78654.0.snapshot | 84 +- .../includes.5dfba7dd.0.snapshot | 52 +- .../includes.6c8d23dc.0.snapshot | 84 +- .../includes.6e78c003.0.snapshot | 84 +- .../includes.7afbe731.0.snapshot | 52 +- .../includes.8222ee98.0.snapshot | 52 +- .../includes.86ff4075.0.snapshot | 84 +- .../includes.a3212bd0.0.snapshot | 52 +- .../includes.b3434679.0.snapshot | 141 +- .../includes.bd3eb3af.0.snapshot | 183 +- .../includes.beda767e.0.snapshot | 52 +- .../includes.c0c0d5ca.0.snapshot | 167 +- .../includes.c62f45f8.0.snapshot | 155 +- .../includes.cedde8e9.0.snapshot | 141 +- .../includes.de6b420f.0.snapshot | 82 +- .../includes.f2bf866b.0.snapshot | 141 +- .../includes.f4ba5583.0.snapshot | 84 +- .../__snapshots__/let_mut.00e05fe2.0.snapshot | 135 +- .../__snapshots__/let_mut.1176df90.0.snapshot | 150 +- .../__snapshots__/let_mut.3307d5a7.0.snapshot | 91 +- .../__snapshots__/let_mut.43f6980c.0.snapshot | 150 +- .../__snapshots__/let_mut.48249b50.0.snapshot | 150 +- .../__snapshots__/let_mut.4c3f3b2b.0.snapshot | 131 +- .../__snapshots__/let_mut.4c75261e.0.snapshot | 135 +- .../__snapshots__/let_mut.634331f0.0.snapshot | 150 +- .../__snapshots__/let_mut.63c16374.0.snapshot | 99 +- .../__snapshots__/let_mut.6796c72d.0.snapshot | 135 +- .../__snapshots__/let_mut.baaea1d3.0.snapshot | 150 +- .../__snapshots__/let_mut.cbbbaeb4.0.snapshot | 150 +- .../__snapshots__/let_mut.d2de286b.0.snapshot | 135 +- .../__snapshots__/let_mut.e90db621.0.snapshot | 150 +- .../__snapshots__/let_mut.f8f208a2.0.snapshot | 150 +- .../__snapshots__/let_mut.f9e32f30.0.snapshot | 150 +- .../__snapshots__/let_mut.fcc9c65d.0.snapshot | 61 +- .../__snapshots__/lists.884ce894.0.snapshot | 318 +-- .../__snapshots__/lists.d9fd46fb.0.snapshot | 259 +- .../__snapshots__/lists.e5378351.0.snapshot | 259 +- .../__snapshots__/loops.0a25def1.0.snapshot | 415 ++-- .../__snapshots__/loops.0fafc5f0.0.snapshot | 323 +-- .../__snapshots__/loops.c2b7bfc6.0.snapshot | 223 +- .../__snapshots__/loops.f1c03b79.0.snapshot | 322 +-- .../__snapshots__/modules.52d25a2f.0.snapshot | 46 +- .../optimizations.d72b00c6.0.snapshot | 133 +- .../optimizations.ff6d5bfb.0.snapshot | 262 +- .../pattern_matching.0539d13e.0.snapshot | 345 +-- .../pattern_matching.05b60a1e.0.snapshot | 513 ++-- .../pattern_matching.0ad4ac05.0.snapshot | 2034 ++++++--------- .../pattern_matching.0bb6923e.0.snapshot | 1570 +++++------- .../pattern_matching.0fa61137.0.snapshot | 403 ++- .../pattern_matching.14dc7554.0.snapshot | 280 +-- .../pattern_matching.16cd197e.0.snapshot | 240 +- .../pattern_matching.16eb3dbf.0.snapshot | 617 ++--- .../pattern_matching.25930935.0.snapshot | 408 ++- .../pattern_matching.3722b060.0.snapshot | 659 ++--- .../pattern_matching.46f91987.0.snapshot | 280 +-- .../pattern_matching.5b158103.0.snapshot | 686 ++--- .../pattern_matching.5b6ff2d3.0.snapshot | 755 ++---- .../pattern_matching.5ff49e44.0.snapshot | 482 ++-- .../pattern_matching.64686134.0.snapshot | 434 +--- .../pattern_matching.702ed9b0.0.snapshot | 2152 ++++++---------- .../pattern_matching.7082d3ca.0.snapshot | 426 +--- .../pattern_matching.79346fef.0.snapshot | 1975 ++++++--------- .../pattern_matching.7f7fe4ef.0.snapshot | 116 +- .../pattern_matching.8614dff3.0.snapshot | 168 +- .../pattern_matching.8c0dc67a.0.snapshot | 1393 ++++------- .../pattern_matching.9561763b.0.snapshot | 1235 ++++----- .../pattern_matching.98756c45.0.snapshot | 316 +-- .../pattern_matching.9ffaa7a7.0.snapshot | 408 ++- .../pattern_matching.aa8d2963.0.snapshot | 676 ++--- .../pattern_matching.ac58ffc3.0.snapshot | 617 ++--- .../pattern_matching.b1b060ad.0.snapshot | 1452 +++++------ .../pattern_matching.b9db0dd9.0.snapshot | 676 ++--- .../pattern_matching.be46eb0e.0.snapshot | 401 ++- .../pattern_matching.c91eac29.0.snapshot | 1511 +++++------ .../pattern_matching.c9582b6d.0.snapshot | 562 ++--- .../pattern_matching.d048ece0.0.snapshot | 1629 +++++------- .../pattern_matching.e17bcd61.0.snapshot | 193 +- .../pattern_matching.e41ad64e.0.snapshot | 2093 ++++++---------- .../pattern_matching.eb4334e1.0.snapshot | 738 ++---- .../pattern_matching.f0c08ea4.0.snapshot | 2211 ++++++----------- .../pattern_matching.f25e0163.0.snapshot | 916 +++---- .../pattern_matching.f3d48b0e.0.snapshot | 193 +- .../pattern_matching.f6c9c89c.0.snapshot | 514 ++-- .../provides.0ef7e7b3.0.snapshot | 52 +- .../provides.10f4f118.0.snapshot | 84 +- .../provides.2a5f527b.0.snapshot | 67 +- .../provides.30cbc409.0.snapshot | 321 +-- .../provides.82c10ab4.0.snapshot | 275 +- .../provides.c3bb4eff.0.snapshot | 127 +- .../provides.c6bf4567.0.snapshot | 112 +- .../provides.f378d570.0.snapshot | 52 +- .../__snapshots__/records.012b017b.0.snapshot | 46 +- .../__snapshots__/records.02742729.0.snapshot | 190 +- .../__snapshots__/records.02af5946.0.snapshot | 82 +- .../__snapshots__/records.2dc39420.0.snapshot | 82 +- .../__snapshots__/records.49dfc6ff.0.snapshot | 220 +- .../__snapshots__/records.54f5977c.0.snapshot | 399 ++- .../__snapshots__/records.5f340064.0.snapshot | 82 +- .../__snapshots__/records.60c0a141.0.snapshot | 427 +--- .../__snapshots__/records.60c7acc4.0.snapshot | 89 +- .../__snapshots__/records.63a951b8.0.snapshot | 220 +- .../__snapshots__/records.89d08e01.0.snapshot | 82 +- .../__snapshots__/records.98824516.0.snapshot | 256 +- .../__snapshots__/records.a3299dd2.0.snapshot | 296 +-- .../__snapshots__/records.a702778a.0.snapshot | 210 +- .../__snapshots__/records.a9c472b1.0.snapshot | 126 +- .../__snapshots__/records.b50d234d.0.snapshot | 123 +- .../__snapshots__/records.d34c4740.0.snapshot | 89 +- .../__snapshots__/records.d393173c.0.snapshot | 399 ++- .../__snapshots__/records.d44e8007.0.snapshot | 89 +- .../__snapshots__/records.e4326567.0.snapshot | 126 +- .../__snapshots__/records.e5b56da8.0.snapshot | 82 +- .../__snapshots__/records.e705a980.0.snapshot | 89 +- .../__snapshots__/records.f6e43cdb.0.snapshot | 89 +- .../__snapshots__/records.f6feee77.0.snapshot | 126 +- .../__snapshots__/records.fae50a8e.0.snapshot | 89 +- .../__snapshots__/stdlib.179d20b9.0.snapshot | 80 +- .../__snapshots__/stdlib.1c0b04b7.0.snapshot | 266 +- .../__snapshots__/stdlib.24cb9bbf.0.snapshot | 144 +- .../__snapshots__/stdlib.323e410a.0.snapshot | 169 +- .../__snapshots__/stdlib.37483d2d.0.snapshot | 259 +- .../__snapshots__/stdlib.4a5061c2.0.snapshot | 266 +- .../__snapshots__/stdlib.5fe88631.0.snapshot | 142 +- .../__snapshots__/stdlib.648f406e.0.snapshot | 188 +- .../__snapshots__/stdlib.69635cff.0.snapshot | 266 +- .../__snapshots__/stdlib.6bf88430.0.snapshot | 138 +- .../__snapshots__/stdlib.6de47be2.0.snapshot | 138 +- .../__snapshots__/stdlib.8300ad7c.0.snapshot | 532 ++-- .../__snapshots__/stdlib.91a94037.0.snapshot | 158 +- .../__snapshots__/stdlib.a70e79ca.0.snapshot | 143 +- .../__snapshots__/stdlib.b30d7785.0.snapshot | 164 +- .../__snapshots__/stdlib.c09a513a.0.snapshot | 81 +- .../__snapshots__/stdlib.cbf0318e.0.snapshot | 267 +- .../__snapshots__/stdlib.d28dee65.0.snapshot | 152 +- .../__snapshots__/stdlib.d4faa5bf.0.snapshot | 134 +- .../__snapshots__/stdlib.d887bb04.0.snapshot | 81 +- .../__snapshots__/stdlib.dae8b12a.0.snapshot | 80 +- .../__snapshots__/stdlib.e306600a.0.snapshot | 134 +- .../__snapshots__/stdlib.e6349872.0.snapshot | 144 +- .../__snapshots__/strings.434adad0.0.snapshot | 64 +- .../__snapshots__/strings.a67428df.0.snapshot | 64 +- .../__snapshots__/strings.b2ad5a89.0.snapshot | 81 +- .../__snapshots__/strings.fb85549f.0.snapshot | 142 +- .../__snapshots__/tuples.1451773e.0.snapshot | 474 ++-- .../__snapshots__/tuples.1d60b40c.0.snapshot | 315 +-- .../__snapshots__/tuples.2c91b91d.0.snapshot | 302 +-- .../__snapshots__/tuples.8d1f0463.0.snapshot | 81 +- .../__snapshots__/tuples.a34621a0.0.snapshot | 371 +-- .../__snapshots__/tuples.b4f702d8.0.snapshot | 46 +- .../__snapshots__/tuples.c1eb0a50.0.snapshot | 474 ++-- .../__snapshots__/tuples.f206002b.0.snapshot | 81 +- 349 files changed, 26753 insertions(+), 51394 deletions(-) diff --git a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot index e5c9a4010b..8543860541 100644 --- a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot +++ b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot @@ -1,250 +1,28 @@ arrays › array_access -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $MArrayGet.9 (result i32) - (local.set $1 - (i32.const 1) - ) - (local.set $2 - (global.get $x_1113) - ) - (block $resolve_idx.8 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.7 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot b/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot index 43ccc57b0e..58fc2ee09f 100644 --- a/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot +++ b/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot @@ -1,265 +1,32 @@ arrays › array_access5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (tuple.extract 0 - (tuple.make - (block $MArrayGet.10 (result i32) - (local.set $1 - (i32.const -5) - ) - (local.set $2 - (local.get $6) - ) - (block $resolve_idx.9 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.8 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - (block $cleanup.4 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot b/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot index 617668248f..f151bcdb86 100644 --- a/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot +++ b/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot @@ -1,65 +1,18 @@ arrays › array1_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot index d6b32719c8..13d5c033d6 100644 --- a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot +++ b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot @@ -1,250 +1,28 @@ arrays › array_access4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $MArrayGet.9 (result i32) - (local.set $1 - (i32.const -3) - ) - (local.set $2 - (global.get $x_1113) - ) - (block $resolve_idx.8 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.7 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot index c660f7449e..898af8fb45 100644 --- a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot +++ b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot @@ -1,250 +1,28 @@ arrays › array_access2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $MArrayGet.9 (result i32) - (local.set $1 - (i32.const 3) - ) - (local.set $2 - (global.get $x_1113) - ) - (block $resolve_idx.8 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.7 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot index f845fb6622..248d4a6df5 100644 --- a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot +++ b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot @@ -1,250 +1,28 @@ arrays › array_access3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $MArrayGet.9 (result i32) - (local.set $1 - (i32.const 5) - ) - (local.set $2 - (global.get $x_1113) - ) - (block $resolve_idx.8 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.7 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot index 11a9b199a9..d0b5bde11f 100644 --- a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot +++ b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot @@ -1,250 +1,28 @@ arrays › array_access5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $MArrayGet.9 (result i32) - (local.set $1 - (i32.const -5) - ) - (local.set $2 - (global.get $x_1113) - ) - (block $resolve_idx.8 - (if - (i32.eqz - (i32.and - (local.get $1) - (i32.const 1) - ) - ) - (block $IndexNotSimpleInteger.7 - (local.set $1 - (i32.load offset=4 - (local.get $1) - ) - ) - (drop - (if (result i32) - (i32.or - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.eq - (local.get $1) - (i32.const 4) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - ) - (local.set $1 - (i32.shr_s - (local.get $1) - (i32.const 1) - ) - ) - (if - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.load offset=4 - (local.get $2) - ) - ) - ) - ) - (if - (i32.le_u - (i32.load offset=4 - (local.get $2) - ) - (local.get $1) - ) - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (i32.add - (i32.shl - (local.get $1) - (i32.const 2) - ) - (local.get $2) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot b/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot index 356b660f0c..bbd587e825 100644 --- a/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot +++ b/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot @@ -1,65 +1,18 @@ arrays › array3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot b/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot index 4ec5675f0c..343071485d 100644 --- a/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot +++ b/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot @@ -1,65 +1,18 @@ arrays › array1_trailing_space -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot index 761bd6d9f3..901140719f 100644 --- a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot @@ -1,85 +1,52 @@ basic functionality › assignment1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $t_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $t_1113 - (i32.const 5) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $t_1113) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $t_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $t_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot index aa59bf5b19..17fd9e9315 100644 --- a/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot @@ -1,35 +1,13 @@ basic functionality › binop2.4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -3) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot b/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot index 10e9abfad9..975015b113 100644 --- a/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot @@ -1,35 +1,13 @@ basic functionality › neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -79) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -40))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot index 6235792196..66f8fcc2cd 100644 --- a/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $<_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 9) - ) - (block $compile_block.4 (result i32) - (i32.const 11) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot index 7dcb135c25..cfac5f319a 100644 --- a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot @@ -1,64 +1,22 @@ basic functionality › assignment1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $t_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.4 (result i32) - (block $compile_store.2 - (global.set $t_1113 - (i32.const 5) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_set.3 (result i32) - (global.set $t_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.const 3) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $t_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot index cf6e106090..467b63cf88 100644 --- a/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const -33) - (i32.const 35) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot index bc8734bd25..8b0f041873 100644 --- a/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot @@ -1,48 +1,33 @@ basic functionality › land4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$&\" (global $&_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"&\" (func $&_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $&_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $&_1113) - ) - (i32.const 1) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot index dc2f4c8c0b..584c762767 100644 --- a/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lxor1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$^\" (global $^_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"^\" (func $^_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $^_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $^_1113) - ) - (i32.const 3) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot index 2381f4173a..a51e6996fc 100644 --- a/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lor1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$|\" (global $|_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"|\" (func $|_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $|_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $|_1113) - ) - (i32.const 3) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot index 1f2757e893..0a542c8340 100644 --- a/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo6 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const 35) - (i32.const 35) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot index ac5ef3233b..f3a56107b8 100644 --- a/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot @@ -1,65 +1,58 @@ basic functionality › precedence1 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1116 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1116 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $*_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1116) - ) - (i32.const 9) - (i32.const 13) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (i32.const 7) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot index 1ba18ed5d7..84f8e83932 100644 --- a/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot @@ -1,48 +1,34 @@ basic functionality › comp16 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const 2147483646) - (i32.const 2147483646) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot b/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot index ac8a9e2d25..ca4645dced 100644 --- a/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>=\" (global $>=_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">=\" (func $>=_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $>=_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>=_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 9) - ) - (block $compile_block.4 (result i32) - (i32.const 11) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot index 86fd6579ef..eb165c8810 100644 --- a/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot @@ -1,112 +1,50 @@ basic functionality › print_line_ending1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $print_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1113) - ) - (i32.const 3) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot index e0f7a5415f..c6ef4f5ee6 100644 --- a/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot @@ -1,48 +1,33 @@ basic functionality › orshadow -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $+_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1114) - ) - (i32.const 3) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot b/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot index da00cb8d1e..2129eaacb0 100644 --- a/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot @@ -1,65 +1,58 @@ basic functionality › precedence2 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1115 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1115 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $*_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1115) - ) - (i32.const 9) - (i32.const 13) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (local.get $6) - (i32.const 7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot index 5d0d6a8655..ea8bcce9d7 100644 --- a/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot @@ -1,65 +1,58 @@ basic functionality › precedence3 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1116 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1116 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $%_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1116) - ) - (i32.const 9) - (i32.const 13) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (i32.const 7) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func %_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot index c4ac6bdb5e..e08790f3b2 100644 --- a/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $*_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1113) - ) - (i32.const 5) - (i32.const 7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func *_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot index 2754fe0c88..5b1d94acd5 100644 --- a/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lsl1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<<\" (global $<<_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<<\" (func $<<_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $<<_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<<_1113) - ) - (i32.const 15) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func <<_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot index 1b7cb1b034..4ba4f71b16 100644 --- a/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot @@ -1,72 +1,101 @@ basic functionality › unsafe_wasm_globals -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$unsafeWasmGlobalsExports.gr\" \"GRAIN$EXPORT$_F64_VAL\" (global $_F64_VAL_1159 (mut f64))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"GRAIN$EXPORT$printF64\" (global $printF64_1158 (mut i32))) - (import \"GRAIN$MODULE$unsafeWasmGlobalsExports.gr\" \"GRAIN$EXPORT$_F32_VAL\" (global $_F32_VAL_1157 (mut f32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"GRAIN$EXPORT$printF32\" (global $printF32_1156 (mut i32))) - (import \"GRAIN$MODULE$unsafeWasmGlobalsExports.gr\" \"GRAIN$EXPORT$_I64_VAL\" (global $_I64_VAL_1155 (mut i64))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"GRAIN$EXPORT$printI64\" (global $printI64_1154 (mut i32))) - (import \"GRAIN$MODULE$unsafeWasmGlobalsExports.gr\" \"GRAIN$EXPORT$_I32_VAL\" (global $_I32_VAL_1153 (mut i32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"GRAIN$EXPORT$printI32\" (global $printI32_1152 (mut i32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"printF64\" (func $printF64_1158 (param i32 f64) (result i32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"printF32\" (func $printF32_1156 (param i32 f32) (result i32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"printI64\" (func $printI64_1154 (param i32 i64) (result i32))) - (import \"GRAIN$MODULE$runtime/debugPrint.gr\" \"printI32\" (func $printI32_1152 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (drop - (call $printI32_1152 - (global.get $printI32_1152) - (global.get $_I32_VAL_1153) - ) - ) - (drop - (call $printI64_1154 - (global.get $printI64_1154) - (global.get $_I64_VAL_1155) - ) - ) - (drop - (call $printF32_1156 - (global.get $printF32_1156) - (global.get $_F32_VAL_1157) - ) - ) - (return_call $printF64_1158 - (global.get $printF64_1158) - (global.get $_F64_VAL_1159) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 509 -) +((functions ()) + (imports + (((mimp_id ((name _F64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _F64_VAL) (mimp_type (MGlobalImport (Unmanaged WasmF64) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF64) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmF64)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF64) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _F32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _F32_VAL) (mimp_type (MGlobalImport (Unmanaged WasmF32) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF32) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmF32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF32) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _I64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _I64_VAL) (mimp_type (MGlobalImport (Unmanaged WasmI64) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI64) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI64)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI64) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _I32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _I32_VAL) (mimp_type (MGlobalImport (Unmanaged WasmI32) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI32) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI32) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printI32_1152) + (closure + ((immediate_desc (MImmBinding (MGlobalBind printI32_1152 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _I32_VAL_1153 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printI64_1154) + (closure + ((immediate_desc (MImmBinding (MGlobalBind printI64_1154 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI64)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _I64_VAL_1155 (Unmanaged WasmI64)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printF32_1156) + (closure + ((immediate_desc (MImmBinding (MGlobalBind printF32_1156 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmF32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _F32_VAL_1157 (Unmanaged WasmF32)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func printF64_1158) + (closure + ((immediate_desc (MImmBinding (MGlobalBind printF64_1158 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmF64)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _F64_VAL_1159 (Unmanaged WasmF64)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot index 020c5a1280..0dd7da0483 100644 --- a/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot @@ -1,260 +1,107 @@ basic functionality › comp22 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$isnt\" (global $isnt_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"isnt\" (func $isnt_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.19 - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_tuple.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (return_call $isnt_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $isnt_1113) - ) - (local.get $8) - (local.get $11) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot index 147bc96820..4aa86f09a0 100644 --- a/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot @@ -1,48 +1,33 @@ basic functionality › land1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$&\" (global $&_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"&\" (func $&_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $&_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $&_1113) - ) - (i32.const 3) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot index 6039c5a95b..9310368cbc 100644 --- a/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot @@ -1,88 +1,52 @@ basic functionality › orshort2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.4 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (drop - (call $print_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1113) - ) - (i32.const 3) - (local.get $6) - ) - ) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot index b793ef5c15..efa319c05d 100644 --- a/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot @@ -1,35 +1,13 @@ basic functionality › simple_min -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2147483647) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -1073741824))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot index a37c84ec63..dbbed7c9c4 100644 --- a/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $>_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 9) - ) - (block $compile_block.4 (result i32) - (i32.const 11) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot index 269bbdd8a1..c4cb5f237a 100644 --- a/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot @@ -1,35 +1,13 @@ basic functionality › forty -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 81) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 40))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot b/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot index cdd63deb09..1fe5a735e7 100644 --- a/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot @@ -1,65 +1,9 @@ basic functionality › bigint_start_pos -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const -1) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MBigInt (flags ()) (limbs (-1)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot index e936146093..c85a425567 100644 --- a/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot @@ -1,65 +1,58 @@ basic functionality › precedence4 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1115 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1115 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $%_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1115) - ) - (i32.const 9) - (i32.const 13) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (local.get $6) - (i32.const 7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func %_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot index 0237f8d80b..3758891900 100644 --- a/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $-_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1113) - ) - (i32.const 5) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot index 2096b8083b..8106e7a605 100644 --- a/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot @@ -1,186 +1,95 @@ basic functionality › assert2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"GRAIN$EXPORT$panicWithException\" (global $GRAIN$EXPORT$panicWithException_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1116 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/exception.gr\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1116 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.14 (result i32) - (block $compile_store.2 - (local.set $6 - (call $+_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1116) - ) - (i32.const 7) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $9 - (call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (local.get $6) - (i32.const 13) - ) - ) - (block $do_backpatches.3 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.5 (result i32) - (i32.const 1879048190) - ) - (block $compile_block.13 - (block $compile_store.8 - (local.set $7 - (block $allocate_string.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 64) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 51) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 8028075845441778497) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 2322294380849939822) - ) - (i64.store offset=24 - (local.get $0) - (i64.const 8028075845441778497) - ) - (i64.store offset=32 - (local.get $0) - (i64.const 7234307576302018670) - ) - (i64.store offset=40 - (local.get $0) - (i64.const 7310313481145575712) - ) - (i64.store offset=48 - (local.get $0) - (i64.const 7956009102162949234) - ) - (i64.store offset=56 - (local.get $0) - (i64.const 3219557) - ) - (local.get $0) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.11 - (local.set $8 - (block $allocate_adt.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 59) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 65) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $throw.12 - (drop - (call $panicWithException_0 - (global.get $GRAIN$EXPORT$panicWithException_0) - (local.get $8) - ) - ) - (unreachable) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MString + \"AssertionError: Assertion failed in assert2, line 1\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 29))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 32))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MPrim1 Throw + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot index 8b73fb0d95..1cbb461b95 100644 --- a/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot @@ -1,65 +1,10 @@ basic functionality › bigint_start_neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i64.store offset=16 - (local.get $0) - (i64.const -1) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc (MAllocate (MBigInt (flags (BigIntNegative)) (limbs (-1)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot index ae9e0d8841..167643539d 100644 --- a/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot @@ -1,35 +1,13 @@ basic functionality › and2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot index 44f59ae1b2..549f6056db 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lsl2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<<\" (global $<<_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<<\" (func $<<_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $<<_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<<_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func <<_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot index 64450037bd..6116f9b0c7 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot @@ -1,48 +1,34 @@ basic functionality › comp17 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$isnt\" (global $isnt_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"isnt\" (func $isnt_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $isnt_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $isnt_1113) - ) - (i32.const 2147483646) - (i32.const -2) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot index cf253a5373..96a8a8d80d 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot @@ -1,35 +1,13 @@ basic functionality › fals -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot index 857a37750a..2aba1f7321 100644 --- a/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot @@ -1,35 +1,13 @@ basic functionality › oct_neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -125) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -63))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot b/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot index 0589e6612a..d1e74fd4f9 100644 --- a/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot @@ -1,57 +1,9 @@ basic functionality › infinity -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const inf) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 9218868437227405312)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot b/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot index 030c9ebdb3..87d276037a 100644 --- a/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot @@ -1,102 +1,71 @@ basic functionality › complex2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1116 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1116 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.6 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (call $+_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1116) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.4 - ) - ) - (return_call $print_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1113) - ) - (local.get $7) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot b/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot index 20ccce0ac1..0c685317b3 100644 --- a/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot @@ -1,57 +1,9 @@ basic functionality › int64_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 99999999999999999) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 99999999999999999)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot index d38657bc3b..d838604ae5 100644 --- a/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot @@ -1,292 +1,123 @@ basic functionality › comp20 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$isnt\" (global $isnt_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"isnt\" (func $isnt_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.19 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (return_call $isnt_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $isnt_1113) - ) - (local.get $8) - (local.get $11) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot index 5cceacca29..3032f97169 100644 --- a/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lor3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$|\" (global $|_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"|\" (func $|_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $|_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $|_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot index eb7bdd441e..fe5aac76f9 100644 --- a/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot @@ -1,46 +1,30 @@ basic functionality › decr_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$decr\" (global $decr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"decr\" (func $decr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $decr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $decr_1113) - ) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot index b0e2e3dbcd..a1d5e014be 100644 --- a/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot @@ -1,35 +1,13 @@ basic functionality › orshort1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot b/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot index 552237e7d7..ac894d738f 100644 --- a/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot @@ -1,53 +1,9 @@ basic functionality › uint64_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_uint64.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 99999999999999999) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MUint64 99999999999999999)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot b/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot index 547ac7c6c4..c3a2256754 100644 --- a/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot @@ -1,35 +1,13 @@ basic functionality › binop5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 5) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot b/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot index 43c408598f..abc07701fa 100644 --- a/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot @@ -1,76 +1,66 @@ basic functionality › precedence5 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1117 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1117 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $>_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1114) - ) - (i32.const 9) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 - (return_call $<_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1117) - ) - (i32.const 19) - (i32.const 27) - ) - ) - (block $compile_block.4 (result i32) - (local.get $6) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MReturnCallKnown (func <_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 13))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot index cb94986b24..2920904cc2 100644 --- a/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot @@ -1,35 +1,13 @@ basic functionality › if4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 7) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot index 60072f874a..18109681c8 100644 --- a/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot @@ -1,57 +1,9 @@ basic functionality › nan -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const nan:0x8000000000000) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 9221120237041090560)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot index a40b2ea9f4..f0374692eb 100644 --- a/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot @@ -1,35 +1,13 @@ basic functionality › not1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot index 7dac306da3..9c2a1be3c3 100644 --- a/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot @@ -1,57 +1,9 @@ basic functionality › heap_number_i64_wrapper -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 2147483648) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 2147483648)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot index d0364f37f0..2aa7d1cfa9 100644 --- a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot @@ -1,261 +1,136 @@ basic functionality › func_shadow -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1118 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1118 (param i32 i32 i32) (result i32))) - (global $foo_1115 (mut i32) (i32.const 0)) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.3 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_string.2 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 7496034) - ) - (local.get $1) - ) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $foo_1115 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.6 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_string.5 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 8020322) - ) - (local.get $1) - ) - (block $cleanup.4 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.21 - (block $compile_store.8 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.11 - (local.set $6 - (block $allocate_adt.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $7 - (call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (drop - (call $print_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1118) - ) - (local.get $7) - (local.get $6) - ) - ) - (block $compile_store.15 - (global.set $foo_1115 - (i32.const 0) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $8 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $9 - (call $foo_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1115) - ) - ) - ) - (block $do_backpatches.19 - ) - ) - (return_call $print_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1118) - ) - (local.get $9) - (local.get $8) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 374 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString bar))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString baz))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func foo_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()) (((name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot b/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot index f18cf7240f..7e1547b370 100644 --- a/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot @@ -1,35 +1,13 @@ basic functionality › hex_neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -509) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -255))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot index c1004010ce..4e7e0ee573 100644 --- a/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const 35) - (i32.const -33) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot index f451431079..1e7e2f5600 100644 --- a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot @@ -1,113 +1,90 @@ basic functionality › if_one_sided6 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1121 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1121 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1116 (param i32 i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.10 (result i32) - (block $compile_store.2 - (global.set $x_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $7 - (call $<_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1116) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.3 - ) - ) - (drop - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.8 (result i32) - (block $compile_store.6 - (local.set $6 - (call $+_1121 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1121) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_set.7 (result i32) - (global.set $x_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $x_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_block.9 (result i32) - (i32.const 1879048190) - ) - ) - ) - (global.get $x_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot index f18af66caa..7905be67b1 100644 --- a/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot @@ -1,35 +1,13 @@ basic functionality › and3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot index 9fa9298045..4cecbd4d17 100644 --- a/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot @@ -1,35 +1,13 @@ basic functionality › or4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot index 213e0f4ea8..b3e6e5ab3b 100644 --- a/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop6 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const 19) - (i32.const 11) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot index 4ea5c5a801..badadf60f3 100644 --- a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot @@ -1,78 +1,42 @@ basic functionality › block_no_expression -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $f_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $f_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 1879048190) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $f_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $f_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $f_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name f))) (name (f)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind f_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func f_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind f_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() ((Unmanaged WasmI32)))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name f)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot index af8a0cb99c..118e833b38 100644 --- a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot @@ -1,110 +1,84 @@ basic functionality › if_one_sided5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1121 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1121 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1116 (param i32 i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.10 (result i32) - (block $compile_store.2 - (global.set $x_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $7 - (call $<_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1116) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.3 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.8 (result i32) - (block $compile_store.6 - (local.set $6 - (call $+_1121 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1121) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_set.7 (result i32) - (global.set $x_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $x_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_block.9 (result i32) - (i32.const 1879048190) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot b/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot index 3db36ae851..d5b7e732bb 100644 --- a/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lor2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$|\" (global $|_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"|\" (func $|_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $|_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $|_1113) - ) - (i32.const 3) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot b/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot index 528e6e32c1..dedfc7d940 100644 --- a/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $-_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1113) - ) - (i32.const 5) - (i32.const 9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot b/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot index 2456fd12ac..030ca58336 100644 --- a/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop2.2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $-_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1113) - ) - (i32.const 5) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot b/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot index 2ea4898657..f2b197d83b 100644 --- a/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot @@ -1,48 +1,33 @@ basic functionality › land2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$&\" (global $&_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"&\" (func $&_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $&_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $&_1113) - ) - (i32.const 3) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot index d17a157cff..0490300ad6 100644 --- a/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot @@ -1,35 +1,13 @@ basic functionality › or1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot index 42f12e1f22..a100bc53ce 100644 --- a/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot @@ -1,35 +1,13 @@ basic functionality › assert1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot index 2c5df87c49..78404fabeb 100644 --- a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot @@ -1,784 +1,516 @@ basic functionality › pattern_match_unsafe_wasm -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1125 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1125 (param i32 i32 i32) (result i32))) - (global $test_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $test_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (local $7 i32) - (block $compile_block.4 - (block $compile_store.2 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (drop - (call $foo_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 0) - ) - ) - (drop - (call $foo_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 1) - ) - ) - (drop - (call $foo_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 5) - ) - ) - (drop - (call $foo_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 8) - ) - ) - (block $cleanup.3 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $foo_1114 - (local.get $7) - (i32.const 42) - ) - ) - ) - (func $foo_1114 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (block $compile_block.72 (result i32) - (block $compile_store.6 - (local.set $16 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.30 - (local.set $17 - (if (result i32) - (i32.shr_u - (local.get $16) - (i32.const 31) - ) - (block $compile_block.7 (result i32) - (i32.const 1) - ) - (block $compile_block.28 (result i32) - (block $compile_store.9 - (local.set $18 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 2) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.8 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $18) - (i32.const 31) - ) - (block $compile_block.10 (result i32) - (i32.const 3) - ) - (block $compile_block.27 (result i32) - (block $compile_store.12 - (local.set $19 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.11 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $19) - (i32.const 31) - ) - (block $compile_block.13 (result i32) - (i32.const 5) - ) - (block $compile_block.26 (result i32) - (block $compile_store.15 - (local.set $20 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 4) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.14 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $20) - (i32.const 31) - ) - (block $compile_block.16 (result i32) - (i32.const 7) - ) - (block $compile_block.25 (result i32) - (block $compile_store.18 - (local.set $21 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 5) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.17 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $21) - (i32.const 31) - ) - (block $compile_block.19 (result i32) - (i32.const 9) - ) - (block $compile_block.24 (result i32) - (block $compile_store.21 - (local.set $22 - (i32.or - (i32.shl - (i32.eq - (local.get $1) - (i32.const 6) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.20 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $22) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (i32.const 11) - ) - (block $compile_block.23 (result i32) - (i32.const 13) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.32_outer (result i32) - (block $switch.32_branch_0 (result i32) - (drop - (block $switch.32_branch_1 (result i32) - (drop - (block $switch.32_branch_2 (result i32) - (drop - (block $switch.32_branch_3 (result i32) - (drop - (block $switch.32_branch_4 (result i32) - (drop - (block $switch.32_branch_5 (result i32) - (drop - (block $switch.32_branch_6 (result i32) - (drop - (block $switch.32_branch_7 (result i32) - (drop - (block $switch.32_default (result i32) - (br_table $switch.32_branch_1 $switch.32_branch_2 $switch.32_branch_3 $switch.32_branch_4 $switch.32_branch_5 $switch.32_branch_6 $switch.32_branch_7 $switch.32_default $switch.32_default - (i32.const 0) - (i32.shr_s - (local.get $17) - (i32.const 1) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.71 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.70 - (block $compile_store.65 - (local.set $14 - (block $allocate_adt.63 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.64 - ) - ) - (block $compile_store.68 - (local.set $15 - (block $allocate_string.66 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 5) - ) - (i64.store offset=8 - (local.get $2) - (i64.const 491327616111) - ) - (local.get $2) - ) - ) - (block $do_backpatches.67 - ) - ) - (block $cleanup.69 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (local.get $15) - (local.get $14) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.62 - (block $compile_store.60 - (local.set $13 - (block $allocate_adt.58 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.59 - ) - ) - (block $cleanup.61 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 13) - (local.get $13) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.57 - (block $compile_store.55 - (local.set $12 - (block $allocate_adt.53 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.54 - ) - ) - (block $cleanup.56 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 11) - (local.get $12) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.52 - (block $compile_store.50 - (local.set $11 - (block $allocate_adt.48 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.49 - ) - ) - (block $cleanup.51 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 9) - (local.get $11) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.47 - (block $compile_store.45 - (local.set $10 - (block $allocate_adt.43 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $cleanup.46 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 7) - (local.get $10) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.42 - (block $compile_store.40 - (local.set $9 - (block $allocate_adt.38 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $cleanup.41 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 5) - (local.get $9) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.37 - (block $compile_store.35 - (local.set $8 - (block $allocate_adt.33 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $cleanup.36 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1125) - ) - (i32.const 3) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.31 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.75 - (block $compile_store.74 - (global.set $test_1113 - (i32.const 0) - ) - (block $do_backpatches.73 - ) - ) - (return_call $test_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $test_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 386 -) +((functions + (((id ((name test))) (name (test)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 5)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 8)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1114) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 42)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs (((txt Unsafe))))) + ((id ((name foo))) (name ()) (args (Managed (Unmanaged WasmI32))) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 3)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 4)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 5)))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 6)))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 6))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))))))))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (1 + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (5 + (((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (6 + (((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc (MAllocate (MString other))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 8) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs (((txt Unsafe))))))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind test_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func test_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind test_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() ((Unmanaged WasmI32)))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name test)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot index 9e228c6485..56804653d3 100644 --- a/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot @@ -1,35 +1,13 @@ basic functionality › tru -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot index 4362755621..208bf196d8 100644 --- a/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot @@ -1,48 +1,33 @@ basic functionality › asr1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>>\" (global $>>_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">>\" (func $>>_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $>>_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>>_1113) - ) - (i32.const 359) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 179))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot index 95c86e8bb7..5f1901cd69 100644 --- a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot @@ -1,85 +1,52 @@ basic functionality › assignment1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $t_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $t_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $t_1113) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $t_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $t_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot index 42ffcc7678..b4e658abfd 100644 --- a/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot @@ -1,35 +1,13 @@ basic functionality › or3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot index 5ecd8659de..47ab22b3bd 100644 --- a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot @@ -1,85 +1,52 @@ basic functionality › assignment1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $t_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $t_1113 - (i32.const 5) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $t_1113) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $t_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $t_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot index cad7a59606..2630e9ad29 100644 --- a/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot @@ -1,35 +1,13 @@ basic functionality › and4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot index 5f95dbf37e..b8da694fa1 100644 --- a/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot @@ -1,53 +1,9 @@ basic functionality › uint32_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_uint32.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 11) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 42) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MUint32 42)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot index 8a64f95e17..396e01d17a 100644 --- a/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 841.25) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650610929073913856)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot index 231d372984..59781da516 100644 --- a/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot @@ -1,115 +1,13 @@ basic functionality › division1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.4 (result i32) - (block $allocate_number.3 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $1) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 5) - ) - (local.get $0) - ) - ) - (i32.store offset=12 - (local.get $1) - (block $allocate_number.2 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 2) - ) - (local.get $0) - ) - ) - (local.get $1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (5)) + (denominator_flags ()) (denominator_limbs (2)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot index 0257d5678c..72e554d89b 100644 --- a/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot @@ -1,113 +1,81 @@ basic functionality › if_one_sided2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1117 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1117 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (local.set $7 - (call $>_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1114) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 - (block $compile_store.5 - (local.set $6 - (block $allocate_adt.3 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.4 - ) - ) - (return_call $print_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1117) - ) - (i32.const 11) - (local.get $6) - ) - ) - (block $compile_block.7 (result i32) - (i32.const 1879048190) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot b/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot index d3f39fb416..ae35121728 100644 --- a/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 0.03125) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4584664420663164928)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot b/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot index 635eebae02..6964ec0685 100644 --- a/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot @@ -1,35 +1,13 @@ basic functionality › bin_neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -19) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot index b1dfe80c13..9707a9e316 100644 --- a/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 40) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4630826316843712512)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot b/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot index 9c26197c02..7af3ec5687 100644 --- a/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot @@ -1,57 +1,9 @@ basic functionality › infinity_neg -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const -inf) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 -4503599627370496)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot b/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot index c52ad996fa..1e43425908 100644 --- a/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 832) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650529565213458432)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot index 9414e71f43..b73d83555c 100644 --- a/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot @@ -1,48 +1,34 @@ basic functionality › comp13 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const -2) - (i32.const -2) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot index adc57c3894..dc6776940f 100644 --- a/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot @@ -1,48 +1,33 @@ basic functionality › andshadow -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $+_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1114) - ) - (i32.const 3) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot index 35429d4b8f..ed354172e7 100644 --- a/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot @@ -1,278 +1,95 @@ basic functionality › comp21 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.20 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_tuple.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (tuple.extract 0 - (tuple.make - (i32.or - (i32.shl - (i32.eq - (local.get $8) - (local.get $11) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - (block $cleanup.19 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot b/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot index 69cf61785d..3ecd5c03b0 100644 --- a/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot @@ -1,35 +1,13 @@ basic functionality › binop2.3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -3) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot index 92753c8388..34dca4d971 100644 --- a/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot @@ -1,35 +1,13 @@ basic functionality › not2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot b/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot index 765ff01bb0..b3a5c47b23 100644 --- a/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lxor3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$^\" (global $^_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"^\" (func $^_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $^_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $^_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot b/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot index c39ec95248..f2b9b0402b 100644 --- a/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot @@ -1,46 +1,30 @@ basic functionality › incr_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$incr\" (global $incr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"incr\" (func $incr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $incr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $incr_1113) - ) - (i32.const -1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot index be05c133f3..e2b66619df 100644 --- a/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot @@ -1,57 +1,9 @@ basic functionality › void -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot index 4276db4d61..2d21d61103 100644 --- a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot @@ -1,93 +1,58 @@ basic functionality › if_one_sided3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1116 (param i32 i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $x_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $<_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1116) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.3 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (block $compile_set.5 (result i32) - (global.set $x_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.const 5) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $x_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_block.7 (result i32) - (i32.const 1879048190) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot index 0b162d1e9d..0d83cdd05d 100644 --- a/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot @@ -1,35 +1,13 @@ basic functionality › and1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot index 0844291c77..a69e5d27f6 100644 --- a/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot @@ -1,35 +1,13 @@ basic functionality › simple_max -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483647) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1073741823))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot index 0174f48439..8f40c52db0 100644 --- a/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (i32.const 5) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot index f9daffac27..14c14ad851 100644 --- a/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot @@ -1,35 +1,13 @@ basic functionality › hex -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 511) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 255))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot index bc63392a28..c6433cc329 100644 --- a/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp9 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>=\" (global $>=_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">=\" (func $>=_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $>=_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>=_1114) - ) - (i32.const 5) - (i32.const 5) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 21) - ) - (block $compile_block.4 (result i32) - (i32.const 23) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 11))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot index 21b4ff882e..182b21c4a3 100644 --- a/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot @@ -1,77 +1,37 @@ basic functionality › bigint_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.4 - (block $compile_store.3 - (local.set $6 - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 9223372036854775807) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (return_call $+_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1113) - ) - (local.get $6) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MInt64 9223372036854775807))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot index 454c7501ab..2fee0217e1 100644 --- a/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot @@ -1,35 +1,13 @@ basic functionality › andshort2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot index 4c82ef2406..b9269d16a0 100644 --- a/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lxor2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$^\" (global $^_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"^\" (func $^_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $^_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $^_1113) - ) - (i32.const 3) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot index baecb81e8b..fd346ab509 100644 --- a/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot @@ -1,67 +1,49 @@ basic functionality › comp2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<=\" (global $<=_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<=\" (func $<=_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $<=_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<=_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const -2) - ) - (block $compile_block.4 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot index 0c4539f63e..68656b7de0 100644 --- a/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp8 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<=\" (global $<=_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<=\" (func $<=_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $<=_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<=_1114) - ) - (i32.const 5) - (i32.const 5) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 21) - ) - (block $compile_block.4 (result i32) - (i32.const 23) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 11))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot index a6567f4015..38ee6772ef 100644 --- a/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp7 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (i32.const 5) - (i32.const 5) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 17) - ) - (block $compile_block.4 (result i32) - (i32.const 19) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot index 1990822d62..871e63ed40 100644 --- a/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot @@ -1,113 +1,81 @@ basic functionality › if_one_sided -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1117 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1117 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (local.set $7 - (call $<_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1114) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 - (block $compile_store.5 - (local.set $6 - (block $allocate_adt.3 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.4 - ) - ) - (return_call $print_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1117) - ) - (i32.const 11) - (local.get $6) - ) - ) - (block $compile_block.7 (result i32) - (i32.const 1879048190) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot index 8bb888f3a4..9d988a27c7 100644 --- a/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lxor4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$^\" (global $^_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"^\" (func $^_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $^_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $^_1113) - ) - (i32.const 1) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot index ffc3d6867d..8607e552be 100644 --- a/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot @@ -1,114 +1,95 @@ basic functionality › complex1 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1127 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1125 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1120 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1127 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1125 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1120 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.6 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (i32.const 7) - (local.get $6) - ) - ) - (block $compile_store.5 - (local.set $7 - (call $+_1127 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1127) - ) - (i32.const 9) - (i32.const 5) - ) - ) - (block $do_backpatches.4 - ) - ) - (return_call $-_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1125) - ) - (i32.const 7) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1127) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1127 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func -_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot index f872336d95..a6789a5c00 100644 --- a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot @@ -1,85 +1,52 @@ basic functionality › assignment1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $t_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $t_1113 - (i32.const 5) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $t_1113) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $t_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $t_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot index 72c8fd2a5b..e9e1c1d029 100644 --- a/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot @@ -1,35 +1,13 @@ basic functionality › oct -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 127) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 63))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot index 29b7676c38..1dd0829dbc 100644 --- a/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot @@ -1,67 +1,49 @@ basic functionality › comp1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $<_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const -2) - ) - (block $compile_block.4 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot index 18a423f3b9..8583c44da6 100644 --- a/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot @@ -1,35 +1,13 @@ basic functionality › or2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const -2) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot index dea3ec445d..3ee849c72a 100644 --- a/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lsr2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>>>\" (global $>>>_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">>>\" (func $>>>_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $>>>_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>>>_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot index 572ea64e70..f2ef9aaf94 100644 --- a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot @@ -1,307 +1,193 @@ basic functionality › toplevel_statements -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1126 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1120 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1126 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1120 (param i32 i32 i32) (result i32))) - (global $five_1117 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.19 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (i32.const 3) - (local.get $6) - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (i32.const 5) - (local.get $7) - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (i32.const 7) - (local.get $8) - ) - ) - (block $compile_store.11 - (global.set $five_1117 - (call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.14 - (local.set $9 - (block $allocate_adt.12 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.13 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (i32.const 9) - (local.get $9) - ) - ) - (block $compile_store.17 - (local.set $10 - (block $allocate_adt.15 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.16 - ) - ) - (drop - (call $print_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1120) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $five_1117) - ) - (local.get $10) - ) - ) - (block $allocate_string.18 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 382 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind five_1117 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind five_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name five)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot index 474d01aa2b..d343ea96f4 100644 --- a/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lsr1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>>>\" (global $>>>_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">>>\" (func $>>>_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $>>>_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>>>_1113) - ) - (i32.const 15) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot index 8446a1ca82..e88e1c8ee1 100644 --- a/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot @@ -1,48 +1,34 @@ basic functionality › comp14 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const -2) - (i32.const 2147483646) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot index 35dfd430dd..730a8b2739 100644 --- a/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot @@ -1,46 +1,30 @@ basic functionality › incr_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$incr\" (global $incr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"incr\" (func $incr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $incr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $incr_1113) - ) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot index fdceacd95c..454dad58b4 100644 --- a/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot @@ -1,35 +1,13 @@ basic functionality › bin -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 21) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot index 0c6a4249bb..aa6eca1c8b 100644 --- a/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot @@ -1,46 +1,30 @@ basic functionality › incr_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$incr\" (global $incr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"incr\" (func $incr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $incr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $incr_1113) - ) - (i32.const 11) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot index bd5e3ee2f6..b4b96521e8 100644 --- a/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const -33) - (i32.const -7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot index 46a2039c39..5abcea6adc 100644 --- a/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot @@ -1,48 +1,33 @@ basic functionality › lor4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$|\" (global $|_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"|\" (func $|_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $|_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $|_1113) - ) - (i32.const 1) - (i32.const 1) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot index 4df627fd26..653666ee36 100644 --- a/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot @@ -1,48 +1,33 @@ basic functionality › int64_pun_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $*_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1113) - ) - (i32.const 19999999) - (i32.const 199999999) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func *_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 9999999))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 99999999))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot index 907cb6ea2c..0fa3481229 100644 --- a/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot @@ -1,46 +1,30 @@ basic functionality › decr_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$decr\" (global $decr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"decr\" (func $decr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $decr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $decr_1113) - ) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot index 032be440d9..03b2f51dfb 100644 --- a/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot @@ -1,35 +1,13 @@ basic functionality › nil -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot index 41e3667f27..91f0814b64 100644 --- a/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot @@ -1,88 +1,52 @@ basic functionality › andshort1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.4 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (drop - (call $print_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1113) - ) - (i32.const 3) - (local.get $6) - ) - ) - (i32.const 2147483646) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot index 071a69798b..368a8f31aa 100644 --- a/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const -33) - (i32.const 9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot index d7a97c55f4..20b2f67827 100644 --- a/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 32) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4629700416936869888)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot index a15bdbbe7a..bbd1afde6c 100644 --- a/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot @@ -1,48 +1,33 @@ basic functionality › land3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$&\" (global $&_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"&\" (func $&_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $&_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $&_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot b/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot index 935e4d858a..1bd882aaf2 100644 --- a/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot @@ -1,48 +1,33 @@ basic functionality › comp18 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$isnt\" (global $isnt_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"isnt\" (func $isnt_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $isnt_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $isnt_1113) - ) - (i32.const 9) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot index a35d8162cc..47afb004ca 100644 --- a/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot @@ -1,48 +1,34 @@ basic functionality › comp15 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const 2147483646) - (i32.const -2) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot index 967fe61f2d..ff77cef932 100644 --- a/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot @@ -1,65 +1,58 @@ basic functionality › comp10 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1119 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1119 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1117 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $-_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1119) - ) - (i32.const 9) - (i32.const 5) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $==_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1117) - ) - (local.get $6) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot index 3c5f193270..fa20170750 100644 --- a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot @@ -1,96 +1,64 @@ basic functionality › if_one_sided4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$<\" (global $<_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"<\" (func $<_1116 (param i32 i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $x_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $<_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $<_1116) - ) - (i32.const 7) - (i32.const 9) - ) - ) - (block $do_backpatches.3 - ) - ) - (drop - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (block $compile_set.5 (result i32) - (global.set $x_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.const 5) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $x_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_block.7 (result i32) - (i32.const 1879048190) - ) - ) - ) - (global.get $x_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot index 2e596f97f9..0ab708089b 100644 --- a/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot @@ -1,67 +1,48 @@ basic functionality › comp6 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.2 - (local.set $6 - (call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (i32.const 5) - (i32.const 7) - ) - ) - (block $do_backpatches.1 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 17) - ) - (block $compile_block.4 (result i32) - (i32.const 19) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot index c5d698b87c..3f355b55c9 100644 --- a/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot @@ -1,48 +1,33 @@ basic functionality › asr2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>>\" (global $>>_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">>\" (func $>>_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $>>_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>>_1113) - ) - (i32.const 1) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot index 54e8fca915..f9fd91c219 100644 --- a/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot @@ -1,53 +1,9 @@ basic functionality › int32_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_int32.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 9) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 42) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt32 42)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot index 92723cfb85..ca9b39d597 100644 --- a/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot @@ -1,48 +1,33 @@ basic functionality › binop2.1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $-_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1113) - ) - (i32.const 5) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot index 5475bd1031..63fe01a693 100644 --- a/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot @@ -1,48 +1,33 @@ basic functionality › modulo2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$%\" (global $%_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"%\" (func $%_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $%_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $%_1113) - ) - (i32.const 35) - (i32.const -7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot index 40b0c7922b..017a6cdfdc 100644 --- a/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot @@ -1,46 +1,30 @@ basic functionality › decr_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$decr\" (global $decr_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"decr\" (func $decr_1113 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $decr_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $decr_1113) - ) - (i32.const 11) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot index f4ce8713ed..670548bbb4 100644 --- a/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot @@ -1,57 +1,9 @@ basic functionality › hex_dec_exp5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (f64.store offset=8 - (local.get $0) - (f64.const 840) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650599933957636096)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot index 0d283a38dd..53f7326bf1 100644 --- a/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot @@ -1,310 +1,111 @@ basic functionality › comp19 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.20 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (tuple.extract 0 - (tuple.make - (i32.or - (i32.shl - (i32.eq - (local.get $8) - (local.get $11) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - (block $cleanup.19 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot index 16c4487ae8..09d635affb 100644 --- a/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot @@ -1,57 +1,9 @@ basic functionality › heap_number_i32_wrapper_max -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 2147483647) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 2147483647)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot index e5af6f2030..997ce6d1db 100644 --- a/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot @@ -1,57 +1,9 @@ basic functionality › heap_number_i32_wrapper -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 1073741824) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 1073741824)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot index 947273f86b..efe331610b 100644 --- a/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot @@ -1,48 +1,33 @@ basic functionality › int64_pun_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $-_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1113) - ) - (i32.const -199999997) - (i32.const 1999999999) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -99999999))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 999999999))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot index 84e0ed0270..a9ac09db27 100644 --- a/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot @@ -1,69 +1,12 @@ basic functionality › bigint_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 32) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const -7851998425750883293) - ) - (i64.store offset=24 - (local.get $0) - (i64.const 1164749010670168) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MBigInt (flags ()) (limbs (-7851998425750883293 1164749010670168)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot index dfeb70294d..5f5af36905 100644 --- a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot @@ -1,443 +1,225 @@ basic functionality › func_shadow_and_indirect_call -(module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1121 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1121 (param i32 i32 i32) (result i32))) - (global $foo_1119 (mut i32) (i32.const 0)) - (global $foo_1117 (mut i32) (i32.const 0)) - (global $foo_1115 (mut i32) (i32.const 0)) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $func_1133) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.3 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_string.2 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 7496034) - ) - (local.get $1) - ) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $foo_1115 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.6 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_string.5 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 8020322) - ) - (local.get $1) - ) - (block $cleanup.4 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $foo_1117 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.9 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_closure.8 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $1) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $1) - (i32.const 0) - ) - (local.get $1) - ) - (block $cleanup.7 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $func_1133 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $closure_elements.16 (result i32) - (block $compile_block.15 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_string.14 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 7894385) - ) - (local.get $1) - ) - (block $cleanup.13 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.41 - (block $compile_store.18 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.21 - (local.set $6 - (block $allocate_adt.19 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $7 - (call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (drop - (call $print_1121 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1121) - ) - (local.get $7) - (local.get $6) - ) - ) - (block $compile_store.25 - (global.set $foo_1115 - (i32.const 0) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.28 - (local.set $8 - (block $allocate_adt.26 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $9 - (call $foo_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1115) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (drop - (call $print_1121 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1121) - ) - (local.get $9) - (local.get $8) - ) - ) - (block $compile_store.32 - (global.set $foo_1117 - (i32.const 0) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (global.set $foo_1119 - (call $foo_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1117) - ) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.37 - (local.set $10 - (block $allocate_adt.35 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.40 - (local.set $11 - (block $call_lambda.38 (result i32) - (local.set $0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1119) - ) - ) - (call_indirect (type $i32_=>_i32) - (local.get $0) - (i32.load offset=8 - (local.get $0) - ) - ) - ) - ) - (block $do_backpatches.39 - ) - ) - (return_call $print_1121 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1121) - ) - (local.get $11) - (local.get $10) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 385 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString bar))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString baz))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1130) + (arity 1) (variables ()))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed)) (return_type (Managed)) + (closure (0)) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString qux))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func foo_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1117 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1119 Managed) + ((instr_desc + (MCallKnown (func foo_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((name foo)) true Managed ()) (((name foo)) true Managed ()) + (((name foo)) true Managed ()) (((name foo)) true Managed ()))) + (function_table_elements (func_1134)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot index 28c3e5a3ae..2239eba119 100644 --- a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot +++ b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot @@ -1,116 +1,58 @@ boxes › box_subtraction1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.9 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot index 0fe2e435bf..af13b0c2e6 100644 --- a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot @@ -1,129 +1,65 @@ boxes › box_multiplication2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.10 - (local.set $8 - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.9 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.17668725.0.snapshot b/compiler/test/__snapshots__/boxes.17668725.0.snapshot index 4734e61afc..221199aea6 100644 --- a/compiler/test/__snapshots__/boxes.17668725.0.snapshot +++ b/compiler/test/__snapshots__/boxes.17668725.0.snapshot @@ -1,129 +1,65 @@ boxes › box_division2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 153) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.10 - (local.set $8 - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.9 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot index f4831e6f97..56ec896b31 100644 --- a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot +++ b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot @@ -1,129 +1,65 @@ boxes › box_addition2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.10 - (local.set $8 - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.9 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot index 957fc0520a..0f4cafb4f7 100644 --- a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot +++ b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot @@ -1,116 +1,58 @@ boxes › box_division1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.9 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 153) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot index f30ca37562..5a1dfd182b 100644 --- a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot @@ -1,129 +1,65 @@ boxes › box_subtraction2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.10 - (local.set $8 - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.9 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot index 1f6ee78a0d..8b4c6a2dde 100644 --- a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot +++ b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot @@ -1,116 +1,58 @@ boxes › box_addition1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.9 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot index 21ab39f1b4..bc22f7262b 100644 --- a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot +++ b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot @@ -1,116 +1,58 @@ boxes › box_multiplication1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.9 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $7 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (local.get $6) - (i32.const 39) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $MTupleSet.8 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot b/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot index 6bf1af481a..9b0afc2fec 100644 --- a/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot +++ b/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot @@ -1,96 +1,28 @@ boxes › test_set_extra1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (tuple.extract 0 - (tuple.make - (block $MTupleSet.5 (result i32) - (i32.store offset=8 - (local.get $6) - (tuple.extract 0 - (tuple.make - (i32.const 5) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - (block $cleanup.4 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot b/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot index eacb069aee..b1d024cc3b 100644 --- a/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot +++ b/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot @@ -1,35 +1,13 @@ chars › char4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 16642) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.259e330c.0.snapshot b/compiler/test/__snapshots__/chars.259e330c.0.snapshot index e670892db7..23aaeea0bd 100644 --- a/compiler/test/__snapshots__/chars.259e330c.0.snapshot +++ b/compiler/test/__snapshots__/chars.259e330c.0.snapshot @@ -1,35 +1,13 @@ chars › char2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 16642) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot b/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot index 4c88bebb84..37f70f96f9 100644 --- a/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot +++ b/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot @@ -1,35 +1,13 @@ chars › char8 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 2566146) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\226\\156\\168\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.51010573.0.snapshot b/compiler/test/__snapshots__/chars.51010573.0.snapshot index e0d2df47ca..fadb2cc199 100644 --- a/compiler/test/__snapshots__/chars.51010573.0.snapshot +++ b/compiler/test/__snapshots__/chars.51010573.0.snapshot @@ -1,35 +1,13 @@ chars › char7 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 32718338) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\140\\190\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot b/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot index eedcc32939..aa0381202a 100644 --- a/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot +++ b/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot @@ -1,35 +1,13 @@ chars › char6 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 32812802) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\146\\175\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.af4b3613.0.snapshot b/compiler/test/__snapshots__/chars.af4b3613.0.snapshot index fa01c9a34a..928581c68f 100644 --- a/compiler/test/__snapshots__/chars.af4b3613.0.snapshot +++ b/compiler/test/__snapshots__/chars.af4b3613.0.snapshot @@ -1,35 +1,13 @@ chars › char5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 16642) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot b/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot index 67af1fbcaf..234bb1e95f 100644 --- a/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot +++ b/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot @@ -1,35 +1,13 @@ chars › char3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 16642) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/comments.573e549e.0.snapshot b/compiler/test/__snapshots__/comments.573e549e.0.snapshot index 7fcc08f0b4..15acdf20fc 100644 --- a/compiler/test/__snapshots__/comments.573e549e.0.snapshot +++ b/compiler/test/__snapshots__/comments.573e549e.0.snapshot @@ -1,35 +1,13 @@ comments › comment_alone -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 21) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/comments.8f52e899.0.snapshot b/compiler/test/__snapshots__/comments.8f52e899.0.snapshot index 5a4e6e383c..02b185d8a9 100644 --- a/compiler/test/__snapshots__/comments.8f52e899.0.snapshot +++ b/compiler/test/__snapshots__/comments.8f52e899.0.snapshot @@ -1,35 +1,13 @@ comments › comment_block -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 21) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot b/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot index 6cb5e597d4..f5a2d92127 100644 --- a/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot +++ b/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot @@ -1,35 +1,13 @@ comments › comment_shebang -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 21) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/comments.fd91c233.0.snapshot b/compiler/test/__snapshots__/comments.fd91c233.0.snapshot index 832ff9cad7..9634c290e2 100644 --- a/compiler/test/__snapshots__/comments.fd91c233.0.snapshot +++ b/compiler/test/__snapshots__/comments.fd91c233.0.snapshot @@ -1,35 +1,13 @@ comments › comment_doc -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 21) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot index 44bf4e8ece..d2d4f3fe6f 100644 --- a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot +++ b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot @@ -1,114 +1,89 @@ early return › early_return3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1116 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"foo\" (func $foo_1113)) - (export \"GRAIN$EXPORT$foo\" (global $foo_1113)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.2 - (local.set $7 - (call $==_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1116) - ) - (i32.const 3) - (i32.const 1) - ) - ) - (block $do_backpatches.1 - ) - ) - (drop - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.4 - (block $cleanup.3 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return - (i32.const -2) - ) - ) - (block $compile_block.5 (result i32) - (i32.const 1879048190) - ) - ) - ) - (block $cleanup.6 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return - (i32.const 2147483646) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.10 (result i32) - (block $compile_store.9 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1000 -) +((functions + (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturn + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturn + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name foo) + (ex_function_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1113) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/enums.aa34084a.0.snapshot b/compiler/test/__snapshots__/enums.aa34084a.0.snapshot index b75fc2c0f9..9da66ae655 100644 --- a/compiler/test/__snapshots__/enums.aa34084a.0.snapshot +++ b/compiler/test/__snapshots__/enums.aa34084a.0.snapshot @@ -1,65 +1,19 @@ enums › adt_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 992856951) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 652 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 496428475))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/enums.ae26523b.0.snapshot b/compiler/test/__snapshots__/enums.ae26523b.0.snapshot index fc73935194..a2e2f16140 100644 --- a/compiler/test/__snapshots__/enums.ae26523b.0.snapshot +++ b/compiler/test/__snapshots__/enums.ae26523b.0.snapshot @@ -1,416 +1,155 @@ enums › enum_recursive_data_definition -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1129 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1129 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (block $compile_block.31 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 6) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 54015209861748) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 6) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 55114721489524) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1215441249) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1675317329) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1215441249) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1215441249) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.21 - (local.set $12 - (block $allocate_adt.19 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1675317329) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (local.get $11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.24 - (local.set $13 - (block $allocate_adt.22 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1215441249) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.27 - (local.set $14 - (block $allocate_adt.25 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1215441249) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $12) - ) - (i32.store offset=24 - (local.get $0) - (local.get $13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.30 - (local.set $15 - (block $allocate_adt.28 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.29 - ) - ) - (return_call $print_1129 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1129) - ) - (local.get $14) - (local.get $15) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 930 -) +((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"tree 1\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"tree 2\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 837658664))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 837658664))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1129) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1129 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 10) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot b/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot index 1a9cefb890..701095c381 100644 --- a/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot +++ b/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot @@ -1,65 +1,19 @@ exceptions › exception_4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1760 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot b/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot index d62326d06a..c1fac147e3 100644 --- a/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot +++ b/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot @@ -1,65 +1,19 @@ exceptions › exception_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 892 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot index 5c6a9cf856..5fa7268883 100644 --- a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot +++ b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot @@ -1,78 +1,41 @@ functions › dup_func -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1117 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1117 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 19) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $foo_1117 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $foo_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1117) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1117 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot index 0b5bf9f59d..f096cd421d 100644 --- a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot +++ b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot @@ -1,85 +1,48 @@ functions › regression_1725 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (local $7 i32) - (block $compile_block.4 - (block $compile_store.2 - (local.tee $7 - (return - (i32.const 11) - ) - ) - (block $do_backpatches.1 - ) - ) - (block $cleanup.3 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return - (i32.const 13) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.7 - (block $compile_store.6 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MReturn + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturn + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.14922a92.0.snapshot b/compiler/test/__snapshots__/functions.14922a92.0.snapshot index 4e5fe1589d..3dac22ca2c 100644 --- a/compiler/test/__snapshots__/functions.14922a92.0.snapshot +++ b/compiler/test/__snapshots__/functions.14922a92.0.snapshot @@ -1,83 +1,63 @@ functions › shorthand_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1115 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1115 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 - (block $cleanup.1 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1115) - ) - (local.get $1) - (i32.const 7) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot index 5e47989221..f32774fae6 100644 --- a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot +++ b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot @@ -1,78 +1,44 @@ functions › shorthand_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (local.get $1) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot b/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot index b1308be3c5..6417d24360 100644 --- a/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot +++ b/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot @@ -1,410 +1,256 @@ functions › lam_destructure_5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1119 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1119 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1118 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (block $compile_block.35 - (block $compile_store.2 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $cleanup.13 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (drop - (block $compile_set.14 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.15 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.16 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.18 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $2) - ) - ) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $2) - ) - ) - ) - (block $do_backpatches.23 - ) - ) - (block $cleanup.25 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $2) - ) - ) - ) - (drop - (block $compile_set.26 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.27 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.29 - (local.set $19 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $9) - (local.get $10) - ) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $20 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $19) - (local.get $11) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $21 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $20) - (local.get $15) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $cleanup.34 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $21) - (local.get $16) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.44 - (block $compile_store.37 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.40 - (local.set $7 - (block $allocate_tuple.38 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.43 - (local.set $8 - (block $allocate_tuple.41 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.42 - ) - ) - (return_call $lam_lambda_1118 - (local.get $6) - (local.get $7) - (local.get $8) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1118) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot index 6a6bcd7116..3b46e750e2 100644 --- a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot +++ b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot @@ -1,113 +1,49 @@ functions › lambda_pat_any -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $x_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 11) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.8 - (block $compile_store.4 - (global.set $x_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $6 - (block $allocate_string.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.6 - ) - ) - (return_call $x_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1113) - ) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name x))) (name (x)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func x_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot index 2683530eff..e43257bcad 100644 --- a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot +++ b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot @@ -1,169 +1,95 @@ functions › curried_func -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1116 (param i32 i32 i32) (result i32))) - (global $add_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $func_1123) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $add_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.3 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_closure.2 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $2) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $2) - (local.get $1) - ) - (local.get $2) - ) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $func_1123 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (block $closure_elements.8 - (local.set $2 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $0) - ) - ) - ) - (block $compile_block.7 - (block $cleanup.6 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1116) - ) - (local.get $2) - (local.get $1) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.14 - (block $compile_store.10 - (global.set $add_1113 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $6 - (call $add_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $add_1113) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $call_lambda.13 - (local.set $0 - (local.get $6) - ) - (return_call_indirect (type $i32_i32_=>_i32) - (local.get $0) - (i32.const 7) - (i32.load offset=8 - (local.get $0) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name add))) (name (add)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1122) + (arity 2) + (variables + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (1)) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind add_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func add_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind add_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name add)) true Managed ()))) + (function_table_elements (func_1124)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot index ad915f5820..3d98b63b64 100644 --- a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot +++ b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot @@ -1,481 +1,342 @@ functions › func_recursive_closure -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1137 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1132 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1137 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1132 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1122 (param i32 i32 i32) (result i32))) - (global $truc_1116 (mut i32) (i32.const 0)) - (global $makeAdder_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $func_1145) - (export \"memory\" (memory $0)) - (export \"truc\" (func $truc_1116)) - (export \"GRAIN$EXPORT$truc\" (global $truc_1116)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $makeAdder_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.3 (result i32) - (tuple.extract 0 - (tuple.make - (block $allocate_closure.2 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $2) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $2) - (local.get $1) - ) - (local.get $2) - ) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $truc_1116 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $cleanup.6 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $foo_1117 - (local.get $7) - (i32.const 11) - ) - ) - ) - (func $func_1145 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (block $closure_elements.12 - (local.set $2 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $0) - ) - ) - ) - (block $compile_block.11 - (block $cleanup.10 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1122) - ) - (local.get $1) - (local.get $2) - ) - ) - ) - ) - (func $foo_1117 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.31 (result i32) - (block $compile_store.14 - (local.set $8 - (call $makeAdder_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $makeAdder_1113) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.17 - (local.set $9 - (block $allocate_closure.15 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $2) - (i32.const -1) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 2) - ) - (local.get $2) - ) - ) - (block $do_backpatches.16 - (local.set $2 - (local.get $9) - ) - (i32.store offset=16 - (local.get $2) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $0) - ) - ) - (i32.store offset=20 - (local.get $2) - (local.get $8) - ) - ) - ) - (block $compile_store.19 - (local.set $11 - (call $==_1132 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1132) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $1) - ) - (i32.const 1) - ) - ) - (block $do_backpatches.18 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $11) - (i32.const 31) - ) - (block $compile_block.21 (result i32) - (i32.const 1) - ) - (block $compile_block.30 - (block $compile_store.23 - (local.set $12 - (call $==_1132 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1132) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $1) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.22 - ) - ) - (if - (i32.shr_u - (local.get $12) - (i32.const 31) - ) - (block $compile_block.25 - (block $cleanup.24 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (return_call $bar_1120 - (local.get $9) - (i32.const 3) - ) - ) - (block $compile_block.29 - (block $compile_store.27 - (local.set $10 - (call $-_1137 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1137) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $1) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.26 - ) - ) - (block $cleanup.28 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - (return_call $foo_1117 - (local.get $0) - (local.get $10) - ) - ) - ) - ) - ) - (block $cleanup.20 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $bar_1120 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 f32) - (local $9 f64) - (local $10 i32) - (local $11 i32) - (block $closure_elements.46 - (local.set $3 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $0) - ) - ) - ) - (local.set $2 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $0) - ) - ) - ) - (block $compile_block.45 - (block $compile_store.40 - (local.set $10 - (call $foo_1117 - (local.get $2) - (i32.const 1) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.43 - (local.set $11 - (block $call_lambda.41 (result i32) - (local.set $4 - (local.get $3) - ) - (call_indirect (type $i32_i32_=>_i32) - (local.get $4) - (i32.const 3) - (i32.load offset=8 - (local.get $4) - ) - ) - ) - ) - (block $do_backpatches.42 - ) - ) - (block $cleanup.44 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (return_call $+_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1122) - ) - (local.get $10) - (local.get $11) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.51 - (block $compile_store.48 - (global.set $makeAdder_1113 - (i32.const 0) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.50 - (global.set $truc_1116 - (i32.const 0) - ) - (block $do_backpatches.49 - ) - ) - (return_call $truc_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $truc_1116) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1025 -) +((functions + (((id ((name makeAdder))) (name (makeAdder)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1143) + (arity 2) + (variables + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name truc))) (name (truc)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (1)) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func makeAdder_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind makeAdder_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx ()) (global_offset function_table_global_1143) + (arity 2) + (variables + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1132) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1132 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1132) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1132 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func bar_1120) + (closure + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MCallKnown (func -_1137) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1137 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 3) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name bar))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (2)) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MClosureBind 1))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name truc) + (ex_function_internal_name truc_1116)) + (WasmGlobalExport (ex_global_name truc) + (ex_global_internal_name truc_1116)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind makeAdder_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind truc_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func truc_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind truc_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((name truc)) true Managed ()) (((name makeAdder)) true Managed ()))) + (function_table_elements (func_1146)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot b/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot index c1720ca673..286a8b41ed 100644 --- a/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot +++ b/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot @@ -1,73 +1,41 @@ functions › app_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1114 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (local.get $1) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 - (block $compile_store.4 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $lam_lambda_1114 - (local.get $6) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1114) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot index 3a79d9bc68..506f348f56 100644 --- a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot +++ b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot @@ -1,78 +1,44 @@ functions › shorthand_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (local.get $1) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.8baf471f.0.snapshot b/compiler/test/__snapshots__/functions.8baf471f.0.snapshot index 92c03b5086..0c30f2b4fa 100644 --- a/compiler/test/__snapshots__/functions.8baf471f.0.snapshot +++ b/compiler/test/__snapshots__/functions.8baf471f.0.snapshot @@ -1,260 +1,160 @@ functions › lam_destructure_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1116 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.20 - (block $compile_store.2 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $cleanup.13 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (drop - (block $compile_set.14 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.15 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.16 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.18 - (local.set $14 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $8) - (local.get $9) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $cleanup.19 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $14) - (local.get $10) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.26 - (block $compile_store.22 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.25 - (local.set $7 - (block $allocate_tuple.23 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.24 - ) - ) - (return_call $lam_lambda_1116 - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1116) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.9223245d.0.snapshot b/compiler/test/__snapshots__/functions.9223245d.0.snapshot index e5c7a08c5f..16f8338642 100644 --- a/compiler/test/__snapshots__/functions.9223245d.0.snapshot +++ b/compiler/test/__snapshots__/functions.9223245d.0.snapshot @@ -1,367 +1,221 @@ functions › lam_destructure_7 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1118 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1118 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1117 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (block $compile_block.30 - (block $compile_store.2 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $cleanup.15 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (block $compile_store.17 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $14) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $14) - ) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $cleanup.20 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - (drop - (block $compile_set.21 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.22 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.23 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.24 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.26 - (local.set $17 - (call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $8) - (local.get $9) - ) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $18 - (call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $17) - (local.get $10) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $cleanup.29 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $18) - (local.get $11) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.39 - (block $compile_store.32 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.35 - (local.set $7 - (block $allocate_tuple.33 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.38 - (local.set $8 - (block $allocate_tuple.36 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.37 - ) - ) - (return_call $lam_lambda_1117 - (local.get $6) - (local.get $8) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1117) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot index 4776b97204..80544a2a79 100644 --- a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot +++ b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot @@ -1,83 +1,63 @@ functions › shorthand_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1115 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1115 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 - (block $cleanup.1 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1115) - ) - (local.get $1) - (i32.const 7) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot index f9da9683a2..99e3846bc7 100644 --- a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot +++ b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot @@ -1,263 +1,163 @@ functions › lam_destructure_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.20 - (block $compile_store.2 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $cleanup.13 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (drop - (block $compile_set.14 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.15 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.16 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.18 - (local.set $14 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $8) - (local.get $9) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $cleanup.19 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (local.get $14) - (local.get $10) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.26 - (block $compile_store.22 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.25 - (local.set $6 - (block $allocate_tuple.23 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.24 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot index f53e729a68..c8101ce445 100644 --- a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot +++ b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot @@ -1,370 +1,224 @@ functions › lam_destructure_8 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1118 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1118 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (block $compile_block.30 - (block $compile_store.2 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $cleanup.15 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (block $compile_store.17 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $14) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $14) - ) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $cleanup.20 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - (drop - (block $compile_set.21 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.22 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.23 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.24 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.26 - (local.set $17 - (call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $8) - (local.get $9) - ) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $18 - (call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $17) - (local.get $10) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $cleanup.29 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $18) - (local.get $11) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.39 - (block $compile_store.32 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.35 - (local.set $6 - (block $allocate_tuple.33 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.38 - (local.set $7 - (block $allocate_tuple.36 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.37 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot b/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot index b1e84ed43a..37c62d92f5 100644 --- a/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot +++ b/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot @@ -1,108 +1,46 @@ functions › lam_destructure_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 11) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 - (block $compile_store.4 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $allocate_string.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.6 - ) - ) - (return_call $lam_lambda_1113 - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1113) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot index ce918b7148..0b72aa6a36 100644 --- a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot +++ b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot @@ -1,113 +1,49 @@ functions › lam_destructure_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 11) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.8 - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $6 - (block $allocate_string.5 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.6 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.ce978f54.0.snapshot b/compiler/test/__snapshots__/functions.ce978f54.0.snapshot index 66f683d7f8..552e37a9b1 100644 --- a/compiler/test/__snapshots__/functions.ce978f54.0.snapshot +++ b/compiler/test/__snapshots__/functions.ce978f54.0.snapshot @@ -1,35 +1,13 @@ functions › multi_bind2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 7) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.d9466880.0.snapshot b/compiler/test/__snapshots__/functions.d9466880.0.snapshot index 8a6c3d20c9..5a292b4000 100644 --- a/compiler/test/__snapshots__/functions.d9466880.0.snapshot +++ b/compiler/test/__snapshots__/functions.d9466880.0.snapshot @@ -1,239 +1,95 @@ functions › func_record_associativity2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $lam_lambda_1121) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1121 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $closure_elements.5 (result i32) - (block $compile_block.4 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 2147483646) - (block $cleanup.3 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (block $compile_block.24 (result i32) - (block $compile_store.8 - (local.set $6 - (block $allocate_closure.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.7 - (local.set $0 - (local.get $6) - ) - ) - ) - (block $compile_store.11 - (local.set $7 - (block $allocate_record.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1631403427) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.14 - (local.set $8 - (block $allocate_record.12 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 485893719) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $8) - ) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $cleanup.17 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (block $compile_store.19 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $9) - ) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $cleanup.20 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - (block $compile_store.23 - (local.set $11 - (block $call_lambda.21 (result i32) - (local.set $0 - (local.get $10) - ) - (call_indirect (type $i32_=>_i32) - (local.get $0) - (i32.load offset=8 - (local.get $0) - ) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (i32.xor - (local.get $11) - (i32.const -2147483648) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 626 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure (0)) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1125) + (arity 1) (variables ()))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 815701713))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((g) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 242946859))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((f) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) + ((instr_desc + (MPrim1 Not + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1121)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot index 99de1e8a5a..dacc10aa82 100644 --- a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot +++ b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot @@ -1,84 +1,65 @@ functions › fn_trailing_comma -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1116 (param i32 i32 i32) (result i32))) - (global $testFn_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $testFn_1113 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (block $compile_block.2 - (block $cleanup.1 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1116) - ) - (local.get $1) - (local.get $2) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $testFn_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $testFn_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $testFn_1113) - ) - (i32.const 5) - (i32.const 7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name testFn))) (name (testFn)) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind testFn_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func testFn_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind testFn_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name testFn)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot index 5ae53c6b0c..eeec45e070 100644 --- a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot +++ b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot @@ -1,413 +1,259 @@ functions › lam_destructure_6 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1119 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1119 (param i32 i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (block $compile_block.35 - (block $compile_store.2 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.6 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $1) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $cleanup.13 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (drop - (block $compile_set.14 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.15 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.16 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.18 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $2) - ) - ) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $2) - ) - ) - ) - (block $do_backpatches.23 - ) - ) - (block $cleanup.25 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $2) - ) - ) - ) - (drop - (block $compile_set.26 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.27 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.29 - (local.set $19 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $9) - (local.get $10) - ) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $20 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $19) - (local.get $11) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $21 - (call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $20) - (local.get $15) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $cleanup.34 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $+_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1119) - ) - (local.get $21) - (local.get $16) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.44 - (block $compile_store.37 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.40 - (local.set $6 - (block $allocate_tuple.38 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.43 - (local.set $7 - (block $allocate_tuple.41 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.42 - ) - ) - (return_call $foo_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.f647681b.0.snapshot b/compiler/test/__snapshots__/functions.f647681b.0.snapshot index ef38b07655..f38710b804 100644 --- a/compiler/test/__snapshots__/functions.f647681b.0.snapshot +++ b/compiler/test/__snapshots__/functions.f647681b.0.snapshot @@ -1,183 +1,71 @@ functions › func_record_associativity1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $lam_lambda_1118) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1118 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $closure_elements.5 (result i32) - (block $compile_block.4 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 2147483646) - (block $cleanup.3 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.18 (result i32) - (block $compile_store.8 - (local.set $6 - (block $allocate_closure.6 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.7 - (local.set $0 - (local.get $6) - ) - ) - ) - (block $compile_store.11 - (local.set $7 - (block $allocate_record.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 485893719) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $cleanup.14 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.17 - (local.set $9 - (block $call_lambda.15 (result i32) - (local.set $0 - (local.get $8) - ) - (call_indirect (type $i32_=>_i32) - (local.get $0) - (i32.load offset=8 - (local.get $0) - ) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (i32.xor - (local.get $9) - (i32.const -2147483648) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 496 -) +((functions + (((id ((name lam_lambda))) (name ()) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure (0)) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1121) + (arity 1) (variables ()))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 242946859))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((f) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) + ((instr_desc + (MPrim1 Not + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1118)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.1d829099.0.snapshot b/compiler/test/__snapshots__/includes.1d829099.0.snapshot index 4731179f70..9a7cbceb93 100644 --- a/compiler/test/__snapshots__/includes.1d829099.0.snapshot +++ b/compiler/test/__snapshots__/includes.1d829099.0.snapshot @@ -1,36 +1,18 @@ includes › include_relative_path2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$../../test/test-libs/provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 453 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod ../../test/test-libs/provideAll.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.46f78654.0.snapshot b/compiler/test/__snapshots__/includes.46f78654.0.snapshot index cfa601d016..d86c564f43 100644 --- a/compiler/test/__snapshots__/includes.46f78654.0.snapshot +++ b/compiler/test/__snapshots__/includes.46f78654.0.snapshot @@ -1,50 +1,36 @@ includes › include_some_multiple -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot b/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot index 11a9fba19d..2f34a20f37 100644 --- a/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot +++ b/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot @@ -1,36 +1,18 @@ includes › include_alias -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot b/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot index eac4043ae3..65be517fcf 100644 --- a/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot +++ b/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot @@ -1,50 +1,36 @@ includes › include_some_multiple_trailing2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.6e78c003.0.snapshot b/compiler/test/__snapshots__/includes.6e78c003.0.snapshot index 409acc60d0..2cd370a1a5 100644 --- a/compiler/test/__snapshots__/includes.6e78c003.0.snapshot +++ b/compiler/test/__snapshots__/includes.6e78c003.0.snapshot @@ -1,50 +1,36 @@ includes › include_some_multiple_trailing -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.7afbe731.0.snapshot b/compiler/test/__snapshots__/includes.7afbe731.0.snapshot index 8a13625134..3e6ddfee40 100644 --- a/compiler/test/__snapshots__/includes.7afbe731.0.snapshot +++ b/compiler/test/__snapshots__/includes.7afbe731.0.snapshot @@ -1,36 +1,18 @@ includes › include_some -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.8222ee98.0.snapshot b/compiler/test/__snapshots__/includes.8222ee98.0.snapshot index 7027f8dcdc..ef665bbda5 100644 --- a/compiler/test/__snapshots__/includes.8222ee98.0.snapshot +++ b/compiler/test/__snapshots__/includes.8222ee98.0.snapshot @@ -1,36 +1,18 @@ includes › include_module -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.86ff4075.0.snapshot b/compiler/test/__snapshots__/includes.86ff4075.0.snapshot index 5fd1034367..cc8fda1b62 100644 --- a/compiler/test/__snapshots__/includes.86ff4075.0.snapshot +++ b/compiler/test/__snapshots__/includes.86ff4075.0.snapshot @@ -1,50 +1,36 @@ includes › include_alias_multiple -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot b/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot index 45a9450f9e..002219a808 100644 --- a/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot +++ b/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot @@ -1,36 +1,18 @@ includes › include_relative_path3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$nested/nested.gr\" \"GRAIN$EXPORT$j\" (global $j_1116 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $j_1116) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 435 -) +((functions ()) + (imports + (((mimp_id ((name j))) (mimp_mod nested/nested.gr) (mimp_name j) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind j_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.b3434679.0.snapshot b/compiler/test/__snapshots__/includes.b3434679.0.snapshot index 981458dbf2..c80b06659f 100644 --- a/compiler/test/__snapshots__/includes.b3434679.0.snapshot +++ b/compiler/test/__snapshots__/includes.b3434679.0.snapshot @@ -1,108 +1,35 @@ includes › include_some_constructor -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 417 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot b/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot index c46804bb9a..0a492bea1a 100644 --- a/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot +++ b/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot @@ -1,126 +1,59 @@ includes › include_some_mixed -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$tlists.gr\" \"GRAIN$EXPORT$sum\" (global $sum_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$tlists.gr\" \"sum\" (func $sum_1126 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $sum_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $sum_1126) - ) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 417 -) +((functions ()) + (imports + (((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func sum_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind sum_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.beda767e.0.snapshot b/compiler/test/__snapshots__/includes.beda767e.0.snapshot index f7c605b7fa..01fe68ee39 100644 --- a/compiler/test/__snapshots__/includes.beda767e.0.snapshot +++ b/compiler/test/__snapshots__/includes.beda767e.0.snapshot @@ -1,36 +1,18 @@ includes › include_relative_path1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$../test-libs/provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 446 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod ../test-libs/provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot b/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot index 92f4e5f892..cf7b1fc9b0 100644 --- a/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot +++ b/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot @@ -1,101 +1,68 @@ includes › include_relative_path4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$./bar/bar.gr\" \"GRAIN$EXPORT$bar\" (global $bar_1119 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$./bar/bar.gr\" \"bar\" (func $bar_1119 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1116 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.6 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (call $bar_1119 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $bar_1119) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.4 - ) - ) - (return_call $print_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1116) - ) - (local.get $7) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 419 -) +((functions ()) + (imports + (((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func bar_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind bar_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot b/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot index 1c43486098..10d2567116 100644 --- a/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot +++ b/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot @@ -1,114 +1,43 @@ includes › include_muliple_modules -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1136 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1136) - ) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 470 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1136 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot b/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot index 706b117ef8..b6e9a96671 100644 --- a/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot +++ b/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot @@ -1,108 +1,35 @@ includes › include_same_module_unify -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 417 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.de6b420f.0.snapshot b/compiler/test/__snapshots__/includes.de6b420f.0.snapshot index 37b3b08a0b..1c229012b7 100644 --- a/compiler/test/__snapshots__/includes.de6b420f.0.snapshot +++ b/compiler/test/__snapshots__/includes.de6b420f.0.snapshot @@ -1,65 +1,19 @@ includes › annotation_across_import -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 417 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot b/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot index d10c38b449..1baab32c26 100644 --- a/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot +++ b/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot @@ -1,108 +1,35 @@ includes › include_all_constructor -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1218386633) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2243) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 417 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot b/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot index 9e852f7236..7cb3561b03 100644 --- a/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot +++ b/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot @@ -1,50 +1,36 @@ includes › include_module2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot index 8e8647a680..f47c5a5555 100644 --- a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot @@ -1,85 +1,52 @@ let mut › let-mut_division1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 153) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot index 21f3c3cda8..24fca54d03 100644 --- a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_multiplication2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot index d61ed4bbfb..496ce14bf6 100644 --- a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot @@ -1,72 +1,21 @@ let mut › let-mut3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.4 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot index 087c385be3..cdc4c9c8ee 100644 --- a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_division3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 153) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot index 41325073ac..89b56701d6 100644 --- a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot index cd74f4d8ed..e3c5785e44 100644 --- a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot @@ -1,100 +1,33 @@ let mut › let-mut2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.7 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (global.set $b_1113 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=12 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot index 9e8b4d5e11..362e5f3c98 100644 --- a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot @@ -1,85 +1,52 @@ let mut › let-mut_multiplication1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot index b99c66a0f4..a51731dd2e 100644 --- a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_multiplication3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $*_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $*_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot index b4cc9a238f..a33750d1fa 100644 --- a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot @@ -1,72 +1,29 @@ let mut › let-mut4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.5 - (local.set $6 - (block $compile_set.3 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.const 7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.4 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot index 95ffb67ecc..0e9ac9ae8e 100644 --- a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot @@ -1,85 +1,52 @@ let mut › let-mut_subtraction1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot index ea552860f0..e0d8711a83 100644 --- a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_subtraction2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot index f77cfefd09..75b69a3a95 100644 --- a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_addition2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot index 97735a2e47..33f8361b6c 100644 --- a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot @@ -1,85 +1,52 @@ let mut › let-mut_addition1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.6 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot index 27bf2fafca..40d036fe04 100644 --- a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_subtraction3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $-_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot index 42357fccf5..f0ccc153c3 100644 --- a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_addition3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $+_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot index a57b08f22b..d6ca478086 100644 --- a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot @@ -1,93 +1,59 @@ let mut › let-mut_division2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$/\" (global $/_1117 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"/\" (func $/_1117 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 153) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $6 - (call $/_1117 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $/_1117) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 39) - ) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.7 - (local.set $7 - (block $compile_set.5 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.6 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot index d6c372eeb9..300b42237a 100644 --- a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot @@ -1,43 +1,20 @@ let mut › let-mut1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.3 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 9) - ) - (block $do_backpatches.1 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/lists.884ce894.0.snapshot b/compiler/test/__snapshots__/lists.884ce894.0.snapshot index 52e737b7e8..2c5ad2dba0 100644 --- a/compiler/test/__snapshots__/lists.884ce894.0.snapshot +++ b/compiler/test/__snapshots__/lists.884ce894.0.snapshot @@ -1,237 +1,83 @@ lists › list_spread -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.14 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot b/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot index 85cd722772..6fafb863ca 100644 --- a/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot +++ b/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot @@ -1,194 +1,67 @@ lists › list1_trailing_space -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/lists.e5378351.0.snapshot b/compiler/test/__snapshots__/lists.e5378351.0.snapshot index 5a371e9f30..74f6f64933 100644 --- a/compiler/test/__snapshots__/lists.e5378351.0.snapshot +++ b/compiler/test/__snapshots__/lists.e5378351.0.snapshot @@ -1,194 +1,67 @@ lists › list1_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot index 38725f2826..6c8b50b94d 100644 --- a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot +++ b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot @@ -1,261 +1,156 @@ loops › loop2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1128 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1125 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1120 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1128 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1125 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1120 (param i32 i32 i32) (result i32))) - (global $count_1114 (mut i32) (i32.const 0)) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.29 (result i32) - (block $compile_store.3 - (global.set $b_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 25) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (global.set $count_1114 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.28 - (local.set $11 - (block $MFor.7 (result i32) - (drop - (loop $MFor_loop.8 - (block $MFor_loop_body.26 - (drop - (br_if $MFor.7 - (i32.const 1879048190) - (i32.eqz - (i32.shr_u - (block $compile_block.12 (result i32) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (call $>_1128 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1128) - ) - (local.get $10) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - ) - (block $MFor_continue.9 - (drop - (block $compile_block.25 (result i32) - (block $compile_store.14 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $7 - (call $-_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1120) - ) - (local.get $6) - (i32.const 3) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.19 - (local.set $12 - (block $MTupleSet.17 (result i32) - (i32.store offset=8 - (global.get $b_1113) - (tuple.extract 0 - (tuple.make - (local.get $7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $b_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $count_1114) - ) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $9 - (call $+_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1125) - ) - (local.get $8) - (i32.const 3) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $MTupleSet.24 (result i32) - (i32.store offset=8 - (global.get $count_1114) - (tuple.extract 0 - (tuple.make - (local.get $9) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $count_1114) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (br $MFor_loop.8) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.27 - ) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $count_1114) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCallKnown (func >_1128) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1128 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot index 19a0a186d8..296d4a1429 100644 --- a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot +++ b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot @@ -1,186 +1,139 @@ loops › loop5 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>=\" (global $>=_1126 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1124 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1120 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">=\" (func $>=_1126 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1124 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1120 (param i32 i32 i32) (result i32))) - (global $count_1114 (mut i32) (i32.const 0)) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.21 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 25) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (global.set $count_1114 - (i32.const 1) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.20 - (local.set $8 - (block $MFor.5 (result i32) - (drop - (loop $MFor_loop.6 - (block $MFor_loop_body.18 - (drop - (br_if $MFor.5 - (i32.const 1879048190) - (i32.eqz - (i32.shr_u - (block $compile_block.13 (result i32) - (block $compile_store.9 - (local.set $7 - (call $-_1124 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1124) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $compile_set.10 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.11 - ) - ) - (call $>=_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>=_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - ) - (block $MFor_continue.7 - (drop - (block $compile_block.17 (result i32) - (block $compile_store.15 - (local.set $6 - (call $+_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1120) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $count_1114) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_set.16 (result i32) - (global.set $count_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $count_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (br $MFor_loop.6) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.19 - ) - ) - (global.get $count_1114) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1124) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1124 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MCallKnown (func >=_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >=_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot index e5fe786174..217661d975 100644 --- a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot +++ b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot @@ -1,134 +1,91 @@ loops › loop3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1120 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1118 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1120 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1118 (param i32 i32 i32) (result i32))) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.14 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 7) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.13 - (local.set $7 - (block $MFor.3 (result i32) - (drop - (loop $MFor_loop.4 - (block $MFor_loop_body.11 - (drop - (br_if $MFor.3 - (i32.const 1879048190) - (i32.eqz - (i32.shr_u - (block $compile_block.6 (result i32) - (call $>_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1120) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - ) - (block $MFor_continue.5 - (drop - (block $compile_block.10 (result i32) - (block $compile_store.8 - (local.set $6 - (call $-_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1118) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_set.9 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (br $MFor_loop.4) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.12 - ) - ) - (global.get $b_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MCallKnown (func >_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot index b2f373ac3a..3850ba0c86 100644 --- a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot +++ b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot @@ -1,186 +1,138 @@ loops › loop4 -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$>\" (global $>_1126 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1124 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$-\" (global $-_1120 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \">\" (func $>_1126 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1124 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"-\" (func $-_1120 (param i32 i32 i32) (result i32))) - (global $count_1114 (mut i32) (i32.const 0)) - (global $b_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.21 (result i32) - (block $compile_store.2 - (global.set $b_1113 - (i32.const 25) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (global.set $count_1114 - (i32.const 1) - ) - (block $do_backpatches.3 - ) - ) - (block $compile_store.20 - (local.set $8 - (block $MFor.5 (result i32) - (drop - (loop $MFor_loop.6 - (block $MFor_loop_body.18 - (drop - (br_if $MFor.5 - (i32.const 1879048190) - (i32.eqz - (i32.shr_u - (block $compile_block.8 (result i32) - (call $>_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $>_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - ) - (block $MFor_continue.7 - (drop - (block $compile_block.17 (result i32) - (block $compile_store.10 - (local.set $6 - (call $-_1120 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $-_1120) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1113) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.13 - (local.set $9 - (block $compile_set.11 (result i32) - (global.set $b_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $7 - (call $+_1124 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1124) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $count_1114) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_set.16 (result i32) - (global.set $count_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $count_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (br $MFor_loop.6) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.19 - ) - ) - (global.get $count_1114) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MCallKnown (func >_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1124) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1124 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot b/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot index 52fc1828b4..93d336be05 100644 --- a/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot +++ b/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot @@ -1,35 +1,13 @@ modules › smallest_submodule -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot index b3858414a8..43949e05fc 100644 --- a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot @@ -1,86 +1,49 @@ optimizations › trs1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $f1_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $f1_1113 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 f32) - (local $8 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (local.get $1) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $2) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 - (block $compile_store.4 - (global.set $f1_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (return_call $f1_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $f1_1113) - ) - (i32.const 3) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions + (((id ((stamp 1113) (name f1))) (name (f1)) + (args (Managed Managed Managed)) (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind f1_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func f1_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind f1_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1113) (name f1)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot index 4181471b71..f7d187faf6 100644 --- a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot @@ -1,180 +1,84 @@ optimizations › test_dead_branch_elimination_5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1126 (param i32 i32 i32) (result i32))) - (global $y_1114 (mut i32) (i32.const 0)) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.17 - (block $compile_store.3 - (global.set $x_1113 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (global.set $y_1114 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $MTupleSet.7 (result i32) - (i32.store offset=8 - (global.get $x_1113) - (tuple.extract 0 - (tuple.make - (i32.const 7) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $x_1113) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $MTupleSet.10 (result i32) - (i32.store offset=8 - (global.get $y_1114) - (tuple.extract 0 - (tuple.make - (i32.const 9) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=8 - (global.get $y_1114) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $6 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $x_1113) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (global.get $y_1114) - ) - ) - ) - (block $do_backpatches.15 - ) - ) - (return_call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind y_1114 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((name y)) true Managed ()) (((name x)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot index f768a3ae70..a9604da3bb 100644 --- a/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot @@ -1,230 +1,117 @@ pattern matching › record_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1125 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1125 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.19 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $cleanup.12 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.13 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.14 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.16_outer (result i32) - (block $switch.16_branch_0 (result i32) - (drop - (block $switch.16_branch_1 (result i32) - (drop - (block $switch.16_default (result i32) - (br_table $switch.16_branch_1 $switch.16_default $switch.16_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.16_outer - (block $compile_block.18 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.16_outer - (block $compile_block.17 - (return_call $+_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1125) - ) - (local.get $7) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.15 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MReturnCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1126) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot index b0da5a7ecf..56fa3a8998 100644 --- a/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot @@ -1,351 +1,164 @@ pattern matching › adt_match_deep -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (block $compile_block.36 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $12 - (i32.load offset=12 - (local.get $8) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $13 - (i32.or - (i32.shl - (i32.eq - (local.get $12) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.29 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (block $compile_store.17 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $8) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $10) - ) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $cleanup.20 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - (drop - (block $compile_set.21 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.27 (result i32) - (block $compile_store.24 - (local.set $15 - (i32.or - (i32.shl - (i32.eq - (local.get $12) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.23 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $15) - (i32.const 31) - ) - (block $compile_block.25 (result i32) - (i32.const 1) - ) - (block $compile_block.26 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.28 - ) - ) - (block $cleanup.30 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.32_outer (result i32) - (block $switch.32_branch_0 (result i32) - (drop - (block $switch.32_branch_1 (result i32) - (drop - (block $switch.32_branch_2 (result i32) - (drop - (block $switch.32_default (result i32) - (br_table $switch.32_branch_1 $switch.32_branch_2 $switch.32_default $switch.32_default - (i32.const 0) - (i32.shr_s - (local.get $14) - (i32.const 1) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.35 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.34 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.33 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (block $cleanup.31 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 486 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 4) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot index 4c38937f6d..c0e20a9305 100644 --- a/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot @@ -1,1260 +1,776 @@ pattern matching › tuple_match_deep4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1153 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1153 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (local $41 i32) - (block $compile_block.117 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_tuple.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $18 - (i32.const 0) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $8) - ) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $8) - ) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $cleanup.34 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (block $compile_store.36 - (local.set $30 - (i32.load offset=12 - (local.get $20) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $compile_store.38 - (local.set $31 - (i32.or - (i32.shl - (i32.eq - (local.get $30) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.37 - ) - ) - (block $compile_store.98 - (local.set $32 - (if (result i32) - (i32.shr_u - (local.get $31) - (i32.const 31) - ) - (block $compile_block.90 (result i32) - (block $compile_store.40 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $20) - ) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.42 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $20) - ) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $compile_store.44 - (local.set $34 - (i32.load offset=12 - (local.get $22) - ) - ) - (block $do_backpatches.43 - ) - ) - (block $compile_store.46 - (local.set $35 - (i32.or - (i32.shl - (i32.eq - (local.get $34) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.45 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $35) - (i32.const 31) - ) - (block $compile_block.82 (result i32) - (block $compile_store.49 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $22) - ) - ) - ) - (block $do_backpatches.48 - ) - ) - (block $compile_store.51 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $22) - ) - ) - ) - (block $do_backpatches.50 - ) - ) - (block $compile_store.53 - (local.set $37 - (i32.load offset=12 - (local.get $24) - ) - ) - (block $do_backpatches.52 - ) - ) - (block $compile_store.55 - (local.set $38 - (i32.or - (i32.shl - (i32.eq - (local.get $37) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.54 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $38) - (i32.const 31) - ) - (block $compile_block.73 (result i32) - (block $compile_store.58 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $24) - ) - ) - ) - (block $do_backpatches.57 - ) - ) - (block $compile_store.60 - (local.set $26 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $24) - ) - ) - ) - (block $do_backpatches.59 - ) - ) - (block $compile_store.62 - (local.set $40 - (i32.load offset=12 - (local.get $26) - ) - ) - (block $do_backpatches.61 - ) - ) - (block $cleanup.63 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $26) - ) - ) - ) - (block $compile_store.65 - (local.set $41 - (i32.or - (i32.shl - (i32.eq - (local.get $40) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.64 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $41) - (i32.const 31) - ) - (block $compile_block.71 (result i32) - (drop - (block $compile_set.67 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.68 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.69 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $23) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.70 (result i32) - (local.set $18 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $25) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.72 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.66 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $25) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.81 (result i32) - (block $compile_store.75 - (local.set $39 - (i32.or - (i32.shl - (i32.eq - (local.get $37) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.74 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $39) - (i32.const 31) - ) - (block $compile_block.79 (result i32) - (drop - (block $compile_set.76 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.77 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.78 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $23) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.80 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.56 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $24) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.89 (result i32) - (block $compile_store.84 - (local.set $36 - (i32.or - (i32.shl - (i32.eq - (local.get $34) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.83 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $36) - (i32.const 31) - ) - (block $compile_block.87 (result i32) - (drop - (block $compile_set.85 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.86 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.88 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.47 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.96 (result i32) - (block $compile_store.92 - (local.set $33 - (i32.or - (i32.shl - (i32.eq - (local.get $30) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.91 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $33) - (i32.const 31) - ) - (block $compile_block.94 (result i32) - (drop - (block $compile_set.93 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.95 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.97 - ) - ) - (block $cleanup.99 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.101_outer (result i32) - (block $switch.101_branch_0 (result i32) - (drop - (block $switch.101_branch_1 (result i32) - (drop - (block $switch.101_branch_2 (result i32) - (drop - (block $switch.101_branch_3 (result i32) - (drop - (block $switch.101_branch_4 (result i32) - (drop - (block $switch.101_branch_5 (result i32) - (drop - (block $switch.101_default (result i32) - (br_table $switch.101_branch_1 $switch.101_branch_2 $switch.101_branch_3 $switch.101_branch_4 $switch.101_branch_5 $switch.101_default $switch.101_default - (i32.const 0) - (i32.shr_s - (local.get $32) - (i32.const 1) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.116 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.115 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.114 - (block $compile_store.110 - (local.set $28 - (call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - ) - (block $do_backpatches.109 - ) - ) - (block $compile_store.112 - (local.set $29 - (call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (local.get $28) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - ) - (block $do_backpatches.111 - ) - ) - (block $cleanup.113 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - (return_call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (local.get $29) - (local.get $18) - ) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.108 - (block $compile_store.106 - (local.set $27 - (call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - ) - (block $do_backpatches.105 - ) - ) - (block $cleanup.107 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - (return_call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (local.get $27) - (local.get $14) - ) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.104 - (block $cleanup.103 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - (return_call $+_1153 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1153) - ) - (local.get $10) - (local.get $11) - ) - ) - ) - ) - ) - (br $switch.101_outer - (block $compile_block.102 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - ) - ) - ) - (block $cleanup.100 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 24) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1158) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot index 19bd2aa073..3c1e489061 100644 --- a/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot @@ -1,981 +1,591 @@ pattern matching › adt_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1149 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1149 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (block $compile_block.98 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (local.set $23 - (i32.load offset=12 - (local.get $9) - ) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $24 - (i32.or - (i32.shl - (i32.eq - (local.get $23) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.84 - (local.set $25 - (if (result i32) - (i32.shr_u - (local.get $24) - (i32.const 31) - ) - (block $compile_block.77 (result i32) - (block $compile_store.30 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $9) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.32 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $9) - ) - ) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (local.set $27 - (i32.load offset=12 - (local.get $17) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.36 - (local.set $28 - (i32.or - (i32.shl - (i32.eq - (local.get $27) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.35 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $28) - (i32.const 31) - ) - (block $compile_block.70 (result i32) - (block $compile_store.39 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $17) - ) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $compile_store.41 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $17) - ) - ) - ) - (block $do_backpatches.40 - ) - ) - (block $compile_store.43 - (local.set $30 - (i32.load offset=12 - (local.get $19) - ) - ) - (block $do_backpatches.42 - ) - ) - (block $compile_store.45 - (local.set $31 - (i32.or - (i32.shl - (i32.eq - (local.get $30) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.44 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $31) - (i32.const 31) - ) - (block $compile_block.62 (result i32) - (block $compile_store.48 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $19) - ) - ) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.50 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $19) - ) - ) - ) - (block $do_backpatches.49 - ) - ) - (block $compile_store.52 - (local.set $33 - (i32.load offset=12 - (local.get $21) - ) - ) - (block $do_backpatches.51 - ) - ) - (block $cleanup.53 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - (block $compile_store.55 - (local.set $34 - (i32.or - (i32.shl - (i32.eq - (local.get $33) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.54 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $34) - (i32.const 31) - ) - (block $compile_block.60 (result i32) - (drop - (block $compile_set.57 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.58 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.59 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.61 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.56 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.69 (result i32) - (block $compile_store.64 - (local.set $32 - (i32.or - (i32.shl - (i32.eq - (local.get $30) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.63 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $32) - (i32.const 31) - ) - (block $compile_block.67 (result i32) - (drop - (block $compile_set.65 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.66 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.68 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.46 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.76 (result i32) - (block $compile_store.72 - (local.set $29 - (i32.or - (i32.shl - (i32.eq - (local.get $27) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.71 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $29) - (i32.const 31) - ) - (block $compile_block.74 (result i32) - (drop - (block $compile_set.73 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.75 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.37 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.82 (result i32) - (block $compile_store.79 - (local.set $26 - (i32.or - (i32.shl - (i32.eq - (local.get $23) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.78 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $26) - (i32.const 31) - ) - (block $compile_block.80 (result i32) - (i32.const 1) - ) - (block $compile_block.81 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.83 - ) - ) - (block $cleanup.85 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.87_outer (result i32) - (block $switch.87_branch_0 (result i32) - (drop - (block $switch.87_branch_1 (result i32) - (drop - (block $switch.87_branch_2 (result i32) - (drop - (block $switch.87_branch_3 (result i32) - (drop - (block $switch.87_branch_4 (result i32) - (drop - (block $switch.87_branch_5 (result i32) - (drop - (block $switch.87_default (result i32) - (br_table $switch.87_branch_1 $switch.87_branch_2 $switch.87_branch_3 $switch.87_branch_4 $switch.87_branch_5 $switch.87_default $switch.87_default - (i32.const 0) - (i32.shr_s - (local.get $25) - (i32.const 1) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.97 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.96 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.95 - (block $compile_store.93 - (local.set $22 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - ) - (block $do_backpatches.92 - ) - ) - (block $cleanup.94 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - (return_call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $22) - (local.get $15) - ) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.91 - (block $cleanup.90 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - (return_call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $11) - (local.get $12) - ) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.89 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - ) - ) - ) - (br $switch.87_outer - (block $compile_block.88 (result i32) - (i32.const 1) - ) - ) - ) - ) - (block $cleanup.86 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 17) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1152) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot index 5ca2c3fa14..c347dfa26b 100644 --- a/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot @@ -1,242 +1,163 @@ pattern matching › low_level_constant_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1116 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.28 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (select - (i32.const -2) - (i32.const 2147483646) - (i64.eq - (i64.const 1) - (i64.const 0) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.17 - (local.set $8 - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.15 (result i32) - (block $compile_store.8 - (local.set $9 - (select - (i32.const -2) - (i32.const 2147483646) - (i64.eq - (i64.const 1) - (i64.const 1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.9 (result i32) - (i32.const 3) - ) - (block $compile_block.14 (result i32) - (block $compile_store.11 - (local.set $10 - (select - (i32.const -2) - (i32.const 2147483646) - (i64.eq - (i64.const 1) - (i64.const 2) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.12 (result i32) - (i32.const 5) - ) - (block $compile_block.13 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.25 - (local.set $11 - (block $switch.18_outer (result i32) - (block $switch.18_branch_0 (result i32) - (drop - (block $switch.18_branch_1 (result i32) - (drop - (block $switch.18_branch_2 (result i32) - (drop - (block $switch.18_branch_3 (result i32) - (drop - (block $switch.18_branch_4 (result i32) - (drop - (block $switch.18_default (result i32) - (br_table $switch.18_branch_1 $switch.18_branch_2 $switch.18_branch_3 $switch.18_branch_4 $switch.18_default $switch.18_default - (i32.const 0) - (i32.shr_s - (local.get $8) - (i32.const 1) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.23 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.22 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.21 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.20 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.19 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $12 - (call $print_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1116) - ) - (local.get $11) - (local.get $6) - ) - ) - (block $do_backpatches.26 - ) - ) - (i32.const 1) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) (ret_type Grain_bool)) + ((immediate_desc (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI64 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot b/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot index ccb644d83e..5fee537e1a 100644 --- a/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot @@ -1,204 +1,78 @@ pattern matching › record_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.17 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (drop - (block $compile_set.12 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.14_outer (result i32) - (block $switch.14_branch_0 (result i32) - (drop - (block $switch.14_branch_1 (result i32) - (drop - (block $switch.14_default (result i32) - (br_table $switch.14_branch_1 $switch.14_default $switch.14_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.14_outer - (block $compile_block.16 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.14_outer - (block $compile_block.15 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.13 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot index e305b50368..b73348687c 100644 --- a/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot @@ -1,177 +1,65 @@ pattern matching › constant_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.18 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (local.get $6) - (local.get $7) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.12 - (local.set $9 - (if (result i32) - (i32.shr_u - (local.get $8) - (i32.const 31) - ) - (block $compile_block.9 (result i32) - (i32.const 3) - ) - (block $compile_block.10 (result i32) - (i32.const 5) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $switch.13_outer (result i32) - (block $switch.13_branch_0 (result i32) - (drop - (block $switch.13_branch_1 (result i32) - (drop - (block $switch.13_branch_2 (result i32) - (drop - (block $switch.13_branch_3 (result i32) - (drop - (block $switch.13_default (result i32) - (br_table $switch.13_branch_1 $switch.13_branch_2 $switch.13_branch_3 $switch.13_default $switch.13_default - (i32.const 0) - (i32.shr_s - (local.get $9) - (i32.const 1) - ) - ) - ) - ) - (br $switch.13_outer - (block $compile_block.17 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.13_outer - (block $compile_block.16 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.13_outer - (block $compile_block.15 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.13_outer - (block $compile_block.14 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot b/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot index 18b26529ab..ecd1af735a 100644 --- a/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot @@ -1,402 +1,217 @@ pattern matching › guarded_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1125 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1125 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.35 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $13 - (call $==_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1125) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.28 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.25 (result i32) - (drop - (block $compile_set.22 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.23 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.24 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.26 (result i32) - (i32.const 3) - ) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $cleanup.29 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.31_outer (result i32) - (block $switch.31_branch_0 (result i32) - (drop - (block $switch.31_branch_1 (result i32) - (drop - (block $switch.31_branch_2 (result i32) - (drop - (block $switch.31_default (result i32) - (br_table $switch.31_branch_1 $switch.31_branch_2 $switch.31_default $switch.31_default - (i32.const 0) - (i32.shr_s - (local.get $14) - (i32.const 1) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.34 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.33 (result i32) - (i32.const 199) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.32 (result i32) - (i32.const 85) - ) - ) - ) - ) - (block $cleanup.30 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot b/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot index 49b0de7576..7eb5ca69fa 100644 --- a/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot @@ -1,242 +1,168 @@ pattern matching › low_level_constant_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1116 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.28 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (select - (i32.const -2) - (i32.const 2147483646) - (f32.eq - (f32.const 1) - (f32.const 0) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.17 - (local.set $8 - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.15 (result i32) - (block $compile_store.8 - (local.set $9 - (select - (i32.const -2) - (i32.const 2147483646) - (f32.eq - (f32.const 1) - (f32.const 1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.9 (result i32) - (i32.const 3) - ) - (block $compile_block.14 (result i32) - (block $compile_store.11 - (local.set $10 - (select - (i32.const -2) - (i32.const 2147483646) - (f32.eq - (f32.const 1) - (f32.const 2) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.12 (result i32) - (i32.const 5) - ) - (block $compile_block.13 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.25 - (local.set $11 - (block $switch.18_outer (result i32) - (block $switch.18_branch_0 (result i32) - (drop - (block $switch.18_branch_1 (result i32) - (drop - (block $switch.18_branch_2 (result i32) - (drop - (block $switch.18_branch_3 (result i32) - (drop - (block $switch.18_branch_4 (result i32) - (drop - (block $switch.18_default (result i32) - (br_table $switch.18_branch_1 $switch.18_branch_2 $switch.18_branch_3 $switch.18_branch_4 $switch.18_default $switch.18_default - (i32.const 0) - (i32.shr_s - (local.get $8) - (i32.const 1) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.23 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.22 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.21 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.20 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.19 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $12 - (call $print_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1116) - ) - (local.get $11) - (local.get $6) - ) - ) - (block $do_backpatches.26 - ) - ) - (i32.const 1) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstF32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4611686018427387904)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot b/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot index 685a2a8748..f3b9ac5821 100644 --- a/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot @@ -1,425 +1,236 @@ pattern matching › tuple_match_deep -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1131 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1131 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (block $compile_block.40 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $6) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $7) - ) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $7) - ) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.19 - ) - ) - (block $cleanup.21 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.23 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $13) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $13) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $cleanup.26 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - (drop - (block $compile_set.27 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.28 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.29 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.30 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.32_outer (result i32) - (block $switch.32_branch_0 (result i32) - (drop - (block $switch.32_branch_1 (result i32) - (drop - (block $switch.32_default (result i32) - (br_table $switch.32_branch_1 $switch.32_default $switch.32_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.39 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.38 - (block $compile_store.34 - (local.set $17 - (call $+_1131 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1131) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.36 - (local.set $18 - (call $+_1131 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1131) - ) - (local.get $17) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $cleanup.37 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (return_call $+_1131 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1131) - ) - (local.get $18) - (local.get $10) - ) - ) - ) - ) - ) - (block $cleanup.31 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1134) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot b/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot index 2ab39508f5..1e7e2f2413 100644 --- a/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot @@ -1,204 +1,78 @@ pattern matching › record_match_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.17 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (drop - (block $compile_set.12 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.14_outer (result i32) - (block $switch.14_branch_0 (result i32) - (drop - (block $switch.14_branch_1 (result i32) - (drop - (block $switch.14_default (result i32) - (br_table $switch.14_branch_1 $switch.14_default $switch.14_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.14_outer - (block $compile_block.16 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.14_outer - (block $compile_block.15 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.13 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot index 3731854f3d..fdd9a7eace 100644 --- a/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot @@ -1,462 +1,226 @@ pattern matching › constant_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (block $compile_block.53 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (local.get $6) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $7) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $cleanup.13 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.16 - (local.set $11 - (block $allocate_string.14 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7496034) - ) - (local.get $0) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $13 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (local.get $11) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.45 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.27 (result i32) - (block $compile_store.20 - (local.set $18 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 11) - ) - ) - (block $do_backpatches.19 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $18) - (i32.const 31) - ) - (block $compile_block.25 (result i32) - (block $compile_store.22 - (local.set $19 - (i32.or - (i32.shl - (i32.eq - (local.get $10) - (i32.const 2147483646) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.21 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $19) - (i32.const 31) - ) - (block $compile_block.23 (result i32) - (i32.const 1) - ) - (block $compile_block.24 (result i32) - (i32.const 7) - ) - ) - ) - (block $compile_block.26 (result i32) - (i32.const 7) - ) - ) - ) - (block $compile_block.43 (result i32) - (block $compile_store.30 - (local.set $12 - (block $allocate_string.28 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.32 - (local.set $15 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (local.get $12) - ) - ) - (block $do_backpatches.31 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $15) - (i32.const 31) - ) - (block $compile_block.41 (result i32) - (block $compile_store.34 - (local.set $16 - (i32.or - (i32.shl - (i32.eq - (local.get $10) - (i32.const 2147483646) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.33 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $16) - (i32.const 31) - ) - (block $compile_block.35 (result i32) - (i32.const 5) - ) - (block $compile_block.40 (result i32) - (block $compile_store.37 - (local.set $17 - (i32.or - (i32.shl - (i32.eq - (local.get $10) - (i32.const -2) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.36 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $17) - (i32.const 31) - ) - (block $compile_block.38 (result i32) - (i32.const 3) - ) - (block $compile_block.39 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - (block $compile_block.42 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $cleanup.46 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - (block $switch.47_outer (result i32) - (block $switch.47_branch_0 (result i32) - (drop - (block $switch.47_branch_1 (result i32) - (drop - (block $switch.47_branch_2 (result i32) - (drop - (block $switch.47_branch_3 (result i32) - (drop - (block $switch.47_branch_4 (result i32) - (drop - (block $switch.47_default (result i32) - (br_table $switch.47_branch_1 $switch.47_branch_2 $switch.47_branch_3 $switch.47_branch_4 $switch.47_default $switch.47_default - (i32.const 0) - (i32.shr_s - (local.get $14) - (i32.const 1) - ) - ) - ) - ) - (br $switch.47_outer - (block $compile_block.52 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.47_outer - (block $compile_block.51 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.47_outer - (block $compile_block.50 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.47_outer - (block $compile_block.49 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.47_outer - (block $compile_block.48 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1134) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot index 39d17adb63..a2c78a8a44 100644 --- a/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot @@ -1,481 +1,276 @@ pattern matching › alias_match_5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (block $compile_block.47 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $10 - (i32.load offset=12 - (local.get $6) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $11 - (i32.or - (i32.shl - (i32.eq - (local.get $10) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.38 - (local.set $12 - (if (result i32) - (i32.shr_u - (local.get $11) - (i32.const 31) - ) - (block $compile_block.13 (result i32) - (drop - (block $compile_set.12 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.36 (result i32) - (block $compile_store.15 - (local.set $13 - (i32.or - (i32.shl - (i32.eq - (local.get $10) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.14 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.34 (result i32) - (block $compile_store.17 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $14 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 7) - ) - ) - (block $do_backpatches.18 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $14) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (drop - (block $compile_set.21 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.33 (result i32) - (block $compile_store.24 - (local.set $15 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 9) - ) - ) - (block $do_backpatches.23 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $15) - (i32.const 31) - ) - (block $compile_block.26 (result i32) - (drop - (block $compile_set.25 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.32 (result i32) - (block $compile_store.28 - (local.set $16 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 11) - ) - ) - (block $do_backpatches.27 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $16) - (i32.const 31) - ) - (block $compile_block.30 (result i32) - (drop - (block $compile_set.29 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.31 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - ) - (block $cleanup.20 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.35 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - (block $do_backpatches.37 - ) - ) - (block $cleanup.39 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.41_outer (result i32) - (block $switch.41_branch_0 (result i32) - (drop - (block $switch.41_branch_1 (result i32) - (drop - (block $switch.41_branch_2 (result i32) - (drop - (block $switch.41_branch_3 (result i32) - (drop - (block $switch.41_default (result i32) - (br_table $switch.41_branch_1 $switch.41_branch_2 $switch.41_branch_3 $switch.41_default $switch.41_default - (i32.const 0) - (i32.shr_s - (local.get $12) - (i32.const 1) - ) - ) - ) - ) - (br $switch.41_outer - (block $compile_block.46 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.41_outer - (block $compile_block.45 (result i32) - (block $allocate_adt.44 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - ) - ) - ) - (br $switch.41_outer - (block $compile_block.43 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (br $switch.41_outer - (block $compile_block.42 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - ) - ) - ) - ) - (block $cleanup.40 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot index 3f9a96e102..db653cacd8 100644 --- a/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot @@ -1,311 +1,173 @@ pattern matching › record_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1126 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $compile_block.27 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.21_outer (result i32) - (block $switch.21_branch_0 (result i32) - (drop - (block $switch.21_branch_1 (result i32) - (drop - (block $switch.21_default (result i32) - (br_table $switch.21_branch_1 $switch.21_default $switch.21_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.21_outer - (block $compile_block.26 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.21_outer - (block $compile_block.25 - (block $compile_store.23 - (local.set $13 - (call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $cleanup.24 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (return_call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (local.get $13) - (local.get $9) - ) - ) - ) - ) - ) - (block $cleanup.20 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot b/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot index 7d4ae7b590..bb3d2d6985 100644 --- a/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot @@ -1,335 +1,101 @@ pattern matching › constant_match_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.27 (result i32) - (block $compile_store.5 - (local.set $6 - (block $allocate_number.3 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $1) - (block $allocate_number.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 1) - ) - (local.get $0) - ) - ) - (i32.store offset=12 - (local.get $1) - (block $allocate_number.2 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 3) - ) - (local.get $0) - ) - ) - (local.get $1) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (i32.const 11) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.20 - (local.set $9 - (if (result i32) - (i32.shr_u - (local.get $8) - (i32.const 31) - ) - (block $compile_block.8 (result i32) - (i32.const 1) - ) - (block $compile_block.18 (result i32) - (block $compile_store.13 - (local.set $7 - (block $allocate_number.11 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $1) - (block $allocate_number.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 1) - ) - (local.get $0) - ) - ) - (i32.store offset=12 - (local.get $1) - (block $allocate_number.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 5) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 3) - ) - (local.get $0) - ) - ) - (local.get $1) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $10 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $6) - ) - (local.get $7) - ) - ) - (block $do_backpatches.14 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.16 (result i32) - (i32.const 3) - ) - (block $compile_block.17 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - (block $do_backpatches.19 - ) - ) - (block $cleanup.21 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (block $switch.22_outer (result i32) - (block $switch.22_branch_0 (result i32) - (drop - (block $switch.22_branch_1 (result i32) - (drop - (block $switch.22_branch_2 (result i32) - (drop - (block $switch.22_branch_3 (result i32) - (drop - (block $switch.22_default (result i32) - (br_table $switch.22_branch_1 $switch.22_branch_2 $switch.22_branch_3 $switch.22_default $switch.22_default - (i32.const 0) - (i32.shr_s - (local.get $9) - (i32.const 1) - ) - ) - ) - ) - (br $switch.22_outer - (block $compile_block.26 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.22_outer - (block $compile_block.25 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.22_outer - (block $compile_block.24 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.22_outer - (block $compile_block.23 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (1)) + (denominator_flags ()) (denominator_limbs (3))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (1)) + (denominator_flags ()) (denominator_limbs (3))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot b/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot index b1799f2bd2..0fb80c77f6 100644 --- a/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot @@ -1,1346 +1,808 @@ pattern matching › tuple_match_deep6 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1157 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1157 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (local $41 i32) - (local $42 i32) - (local $43 i32) - (block $compile_block.123 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_tuple.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $18 - (i32.const 0) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $19 - (i32.const 0) - ) - (block $do_backpatches.32 - ) - ) - (block $compile_store.35 - (local.set $20 - (i32.const 0) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.37 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $10) - ) - ) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.39 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $10) - ) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $cleanup.40 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - (block $compile_store.42 - (local.set $32 - (i32.load offset=12 - (local.get $22) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $compile_store.44 - (local.set $33 - (i32.or - (i32.shl - (i32.eq - (local.get $32) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.43 - ) - ) - (block $compile_store.104 - (local.set $34 - (if (result i32) - (i32.shr_u - (local.get $33) - (i32.const 31) - ) - (block $compile_block.96 (result i32) - (block $compile_store.46 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $22) - ) - ) - ) - (block $do_backpatches.45 - ) - ) - (block $compile_store.48 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $22) - ) - ) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.50 - (local.set $36 - (i32.load offset=12 - (local.get $24) - ) - ) - (block $do_backpatches.49 - ) - ) - (block $compile_store.52 - (local.set $37 - (i32.or - (i32.shl - (i32.eq - (local.get $36) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.51 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $37) - (i32.const 31) - ) - (block $compile_block.88 (result i32) - (block $compile_store.55 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $24) - ) - ) - ) - (block $do_backpatches.54 - ) - ) - (block $compile_store.57 - (local.set $26 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $24) - ) - ) - ) - (block $do_backpatches.56 - ) - ) - (block $compile_store.59 - (local.set $39 - (i32.load offset=12 - (local.get $26) - ) - ) - (block $do_backpatches.58 - ) - ) - (block $compile_store.61 - (local.set $40 - (i32.or - (i32.shl - (i32.eq - (local.get $39) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.60 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $40) - (i32.const 31) - ) - (block $compile_block.79 (result i32) - (block $compile_store.64 - (local.set $27 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $26) - ) - ) - ) - (block $do_backpatches.63 - ) - ) - (block $compile_store.66 - (local.set $28 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $26) - ) - ) - ) - (block $do_backpatches.65 - ) - ) - (block $compile_store.68 - (local.set $42 - (i32.load offset=12 - (local.get $28) - ) - ) - (block $do_backpatches.67 - ) - ) - (block $cleanup.69 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $28) - ) - ) - ) - (block $compile_store.71 - (local.set $43 - (i32.or - (i32.shl - (i32.eq - (local.get $42) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.70 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $43) - (i32.const 31) - ) - (block $compile_block.77 (result i32) - (drop - (block $compile_set.73 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.74 (result i32) - (local.set $18 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $23) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.75 (result i32) - (local.set $19 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $25) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.76 (result i32) - (local.set $20 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $27) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.78 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.72 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $27) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.87 (result i32) - (block $compile_store.81 - (local.set $41 - (i32.or - (i32.shl - (i32.eq - (local.get $39) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.80 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $41) - (i32.const 31) - ) - (block $compile_block.85 (result i32) - (drop - (block $compile_set.82 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.83 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $23) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.84 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $25) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.86 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.62 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $25) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $26) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.95 (result i32) - (block $compile_store.90 - (local.set $38 - (i32.or - (i32.shl - (i32.eq - (local.get $36) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.89 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $38) - (i32.const 31) - ) - (block $compile_block.93 (result i32) - (drop - (block $compile_set.91 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.92 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $23) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.94 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.53 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $24) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.102 (result i32) - (block $compile_store.98 - (local.set $35 - (i32.or - (i32.shl - (i32.eq - (local.get $32) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.97 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $35) - (i32.const 31) - ) - (block $compile_block.100 (result i32) - (drop - (block $compile_set.99 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.101 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.103 - ) - ) - (block $cleanup.105 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.107_outer (result i32) - (block $switch.107_branch_0 (result i32) - (drop - (block $switch.107_branch_1 (result i32) - (drop - (block $switch.107_branch_2 (result i32) - (drop - (block $switch.107_branch_3 (result i32) - (drop - (block $switch.107_branch_4 (result i32) - (drop - (block $switch.107_branch_5 (result i32) - (drop - (block $switch.107_default (result i32) - (br_table $switch.107_branch_1 $switch.107_branch_2 $switch.107_branch_3 $switch.107_branch_4 $switch.107_branch_5 $switch.107_default $switch.107_default - (i32.const 0) - (i32.shr_s - (local.get $34) - (i32.const 1) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.122 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.121 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.120 - (block $compile_store.116 - (local.set $30 - (call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - ) - (block $do_backpatches.115 - ) - ) - (block $compile_store.118 - (local.set $31 - (call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (local.get $30) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - ) - (block $do_backpatches.117 - ) - ) - (block $cleanup.119 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (return_call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (local.get $31) - (local.get $20) - ) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.114 - (block $compile_store.112 - (local.set $29 - (call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - ) - (block $do_backpatches.111 - ) - ) - (block $cleanup.113 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - (return_call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (local.get $29) - (local.get $16) - ) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.110 - (block $cleanup.109 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - (return_call $+_1157 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1157) - ) - (local.get $12) - (local.get $13) - ) - ) - ) - ) - ) - (br $switch.107_outer - (block $compile_block.108 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - ) - ) - ) - (block $cleanup.106 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 26) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1162) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot b/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot index 2d56c895dc..52198872c2 100644 --- a/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot @@ -1,301 +1,127 @@ pattern matching › tuple_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $compile_block.28 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 1886351202) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $6) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $7) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $7) - ) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $cleanup.19 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (drop - (block $compile_set.20 (result i32) - (local.set $13 - (local.get $12) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.21 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.22 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.24_outer (result i32) - (block $switch.24_branch_0 (result i32) - (drop - (block $switch.24_branch_1 (result i32) - (drop - (block $switch.24_default (result i32) - (br_table $switch.24_branch_1 $switch.24_default $switch.24_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.24_outer - (block $compile_block.27 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.24_outer - (block $compile_block.26 (result i32) - (block $allocate_tuple.25 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - (i32.store offset=12 - (local.get $0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - (i32.store offset=16 - (local.get $0) - (local.get $13) - ) - (local.get $0) - ) - ) - ) - ) - ) - (block $cleanup.23 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boop))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot b/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot index 1bce284be1..640b3c89e9 100644 --- a/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot @@ -1,1217 +1,760 @@ pattern matching › tuple_match_deep3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1151 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1151 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (block $compile_block.114 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $7) - ) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $7) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $cleanup.31 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.33 - (local.set $29 - (i32.load offset=12 - (local.get $19) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $compile_store.35 - (local.set $30 - (i32.or - (i32.shl - (i32.eq - (local.get $29) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.95 - (local.set $31 - (if (result i32) - (i32.shr_u - (local.get $30) - (i32.const 31) - ) - (block $compile_block.87 (result i32) - (block $compile_store.37 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $19) - ) - ) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.39 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $19) - ) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $compile_store.41 - (local.set $33 - (i32.load offset=12 - (local.get $21) - ) - ) - (block $do_backpatches.40 - ) - ) - (block $compile_store.43 - (local.set $34 - (i32.or - (i32.shl - (i32.eq - (local.get $33) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.42 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $34) - (i32.const 31) - ) - (block $compile_block.79 (result i32) - (block $compile_store.46 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $21) - ) - ) - ) - (block $do_backpatches.45 - ) - ) - (block $compile_store.48 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $21) - ) - ) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.50 - (local.set $36 - (i32.load offset=12 - (local.get $23) - ) - ) - (block $do_backpatches.49 - ) - ) - (block $compile_store.52 - (local.set $37 - (i32.or - (i32.shl - (i32.eq - (local.get $36) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.51 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $37) - (i32.const 31) - ) - (block $compile_block.70 (result i32) - (block $compile_store.55 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $23) - ) - ) - ) - (block $do_backpatches.54 - ) - ) - (block $compile_store.57 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $23) - ) - ) - ) - (block $do_backpatches.56 - ) - ) - (block $compile_store.59 - (local.set $39 - (i32.load offset=12 - (local.get $25) - ) - ) - (block $do_backpatches.58 - ) - ) - (block $cleanup.60 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $25) - ) - ) - ) - (block $compile_store.62 - (local.set $40 - (i32.or - (i32.shl - (i32.eq - (local.get $39) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.61 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $40) - (i32.const 31) - ) - (block $compile_block.68 (result i32) - (drop - (block $compile_set.64 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.65 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.66 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.67 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.69 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.63 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $24) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.78 (result i32) - (block $compile_store.72 - (local.set $38 - (i32.or - (i32.shl - (i32.eq - (local.get $36) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.71 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $38) - (i32.const 31) - ) - (block $compile_block.76 (result i32) - (drop - (block $compile_set.73 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.74 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.75 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.77 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.53 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.86 (result i32) - (block $compile_store.81 - (local.set $35 - (i32.or - (i32.shl - (i32.eq - (local.get $33) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.80 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $35) - (i32.const 31) - ) - (block $compile_block.84 (result i32) - (drop - (block $compile_set.82 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.83 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.85 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.44 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.93 (result i32) - (block $compile_store.89 - (local.set $32 - (i32.or - (i32.shl - (i32.eq - (local.get $29) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.88 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $32) - (i32.const 31) - ) - (block $compile_block.91 (result i32) - (drop - (block $compile_set.90 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.92 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.94 - ) - ) - (block $cleanup.96 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.98_outer (result i32) - (block $switch.98_branch_0 (result i32) - (drop - (block $switch.98_branch_1 (result i32) - (drop - (block $switch.98_branch_2 (result i32) - (drop - (block $switch.98_branch_3 (result i32) - (drop - (block $switch.98_branch_4 (result i32) - (drop - (block $switch.98_branch_5 (result i32) - (drop - (block $switch.98_default (result i32) - (br_table $switch.98_branch_1 $switch.98_branch_2 $switch.98_branch_3 $switch.98_branch_4 $switch.98_branch_5 $switch.98_default $switch.98_default - (i32.const 0) - (i32.shr_s - (local.get $31) - (i32.const 1) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.113 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.112 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.111 - (block $compile_store.107 - (local.set $27 - (call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - ) - (block $do_backpatches.106 - ) - ) - (block $compile_store.109 - (local.set $28 - (call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $27) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - ) - (block $do_backpatches.108 - ) - ) - (block $cleanup.110 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - (return_call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $28) - (local.get $17) - ) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.105 - (block $compile_store.103 - (local.set $26 - (call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - ) - (block $do_backpatches.102 - ) - ) - (block $cleanup.104 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - (return_call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $26) - (local.get $13) - ) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.101 - (block $cleanup.100 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - (return_call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $9) - (local.get $10) - ) - ) - ) - ) - ) - (br $switch.98_outer - (block $compile_block.99 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.97 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 23) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1156) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot b/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot index aaf65d1a7e..bbaee79950 100644 --- a/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot @@ -1,79 +1,39 @@ pattern matching › alias_match_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.7 (result i32) - (block $compile_store.2 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (drop - (block $compile_set.3 (result i32) - (local.set $6 - (i32.const -2) - ) - (i32.const 1879048190) - ) - ) - (block $switch.4_outer (result i32) - (block $switch.4_branch_0 (result i32) - (drop - (block $switch.4_branch_1 (result i32) - (drop - (block $switch.4_default (result i32) - (br_table $switch.4_branch_1 $switch.4_default $switch.4_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.4_outer - (block $compile_block.6 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.4_outer - (block $compile_block.5 (result i32) - (local.get $6) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1115) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot index dc72edb084..4ce15ec144 100644 --- a/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot @@ -1,106 +1,64 @@ pattern matching › alias_match_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.12 (result i32) - (block $compile_store.2 - (local.set $6 - (i32.const 0) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.4 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (drop - (block $compile_set.5 (result i32) - (local.set $7 - (i32.const -2) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.6 (result i32) - (local.set $6 - (i32.const -2) - ) - (i32.const 1879048190) - ) - ) - (block $switch.7_outer (result i32) - (block $switch.7_branch_0 (result i32) - (drop - (block $switch.7_branch_1 (result i32) - (drop - (block $switch.7_default (result i32) - (br_table $switch.7_branch_1 $switch.7_default $switch.7_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.7_outer - (block $compile_block.11 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.7_outer - (block $compile_block.10 (result i32) - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.8 (result i32) - (local.get $6) - ) - (block $compile_block.9 (result i32) - (local.get $7) - ) - ) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot b/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot index c7631c5004..808474ed2c 100644 --- a/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot @@ -1,852 +1,543 @@ pattern matching › adt_match_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1143 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1143 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (block $compile_block.89 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $20 - (i32.load offset=12 - (local.get $6) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $21 - (i32.or - (i32.shl - (i32.eq - (local.get $20) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.75 - (local.set $22 - (if (result i32) - (i32.shr_u - (local.get $21) - (i32.const 31) - ) - (block $compile_block.68 (result i32) - (block $compile_store.21 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $6) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $24 - (i32.load offset=12 - (local.get $14) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $25 - (i32.or - (i32.shl - (i32.eq - (local.get $24) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.26 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $25) - (i32.const 31) - ) - (block $compile_block.61 (result i32) - (block $compile_store.30 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $14) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.32 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $14) - ) - ) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (local.set $27 - (i32.load offset=12 - (local.get $16) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.36 - (local.set $28 - (i32.or - (i32.shl - (i32.eq - (local.get $27) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.35 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $28) - (i32.const 31) - ) - (block $compile_block.53 (result i32) - (block $compile_store.39 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $16) - ) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $compile_store.41 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $16) - ) - ) - ) - (block $do_backpatches.40 - ) - ) - (block $compile_store.43 - (local.set $30 - (i32.load offset=12 - (local.get $18) - ) - ) - (block $do_backpatches.42 - ) - ) - (block $cleanup.44 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - (block $compile_store.46 - (local.set $31 - (i32.or - (i32.shl - (i32.eq - (local.get $30) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.45 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $31) - (i32.const 31) - ) - (block $compile_block.51 (result i32) - (drop - (block $compile_set.48 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.49 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.50 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.52 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.47 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.60 (result i32) - (block $compile_store.55 - (local.set $29 - (i32.or - (i32.shl - (i32.eq - (local.get $27) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.54 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $29) - (i32.const 31) - ) - (block $compile_block.58 (result i32) - (drop - (block $compile_set.56 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.57 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.59 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.37 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.67 (result i32) - (block $compile_store.63 - (local.set $26 - (i32.or - (i32.shl - (i32.eq - (local.get $24) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.62 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $26) - (i32.const 31) - ) - (block $compile_block.65 (result i32) - (drop - (block $compile_set.64 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.66 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.28 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.73 (result i32) - (block $compile_store.70 - (local.set $23 - (i32.or - (i32.shl - (i32.eq - (local.get $20) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.69 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $23) - (i32.const 31) - ) - (block $compile_block.71 (result i32) - (i32.const 1) - ) - (block $compile_block.72 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.74 - ) - ) - (block $cleanup.76 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.78_outer (result i32) - (block $switch.78_branch_0 (result i32) - (drop - (block $switch.78_branch_1 (result i32) - (drop - (block $switch.78_branch_2 (result i32) - (drop - (block $switch.78_branch_3 (result i32) - (drop - (block $switch.78_branch_4 (result i32) - (drop - (block $switch.78_branch_5 (result i32) - (drop - (block $switch.78_default (result i32) - (br_table $switch.78_branch_1 $switch.78_branch_2 $switch.78_branch_3 $switch.78_branch_4 $switch.78_branch_5 $switch.78_default $switch.78_default - (i32.const 0) - (i32.shr_s - (local.get $22) - (i32.const 1) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.88 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.87 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.86 - (block $compile_store.84 - (local.set $19 - (call $+_1143 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1143) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - ) - (block $do_backpatches.83 - ) - ) - (block $cleanup.85 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (return_call $+_1143 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1143) - ) - (local.get $19) - (local.get $12) - ) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.82 - (block $cleanup.81 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (return_call $+_1143 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1143) - ) - (local.get $8) - (local.get $9) - ) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.80 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - ) - ) - ) - ) - (br $switch.78_outer - (block $compile_block.79 (result i32) - (i32.const 1) - ) - ) - ) - ) - (block $cleanup.77 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1143) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MCallKnown (func +_1143) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1143) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 14) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1146) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot b/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot index 6572cce0aa..f11f48d595 100644 --- a/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot @@ -1,791 +1,446 @@ pattern matching › tuple_match_deep2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1149 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1149 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (block $compile_block.79 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 15) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_tuple.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_tuple.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_tuple.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $10) - ) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $10) - ) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $cleanup.34 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - (block $compile_store.36 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $19) - ) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $compile_store.38 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $19) - ) - ) - ) - (block $do_backpatches.37 - ) - ) - (block $cleanup.39 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (block $compile_store.41 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $21) - ) - ) - ) - (block $do_backpatches.40 - ) - ) - (block $compile_store.43 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $21) - ) - ) - ) - (block $do_backpatches.42 - ) - ) - (block $cleanup.44 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - (block $compile_store.46 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $23) - ) - ) - ) - (block $do_backpatches.45 - ) - ) - (block $compile_store.48 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $23) - ) - ) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.50 - (local.set $26 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $23) - ) - ) - ) - (block $do_backpatches.49 - ) - ) - (block $cleanup.51 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - ) - (block $compile_store.53 - (local.set $27 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $26) - ) - ) - ) - (block $do_backpatches.52 - ) - ) - (block $compile_store.55 - (local.set $28 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $26) - ) - ) - ) - (block $do_backpatches.54 - ) - ) - (block $cleanup.56 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $26) - ) - ) - ) - (drop - (block $compile_set.57 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.58 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.59 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.60 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.61 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $25) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.62 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $28) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.63 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $27) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.65_outer (result i32) - (block $switch.65_branch_0 (result i32) - (drop - (block $switch.65_branch_1 (result i32) - (drop - (block $switch.65_default (result i32) - (br_table $switch.65_branch_1 $switch.65_default $switch.65_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.65_outer - (block $compile_block.78 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.65_outer - (block $compile_block.77 - (block $compile_store.67 - (local.set $29 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - ) - (block $do_backpatches.66 - ) - ) - (block $compile_store.69 - (local.set $30 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $29) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - ) - (block $do_backpatches.68 - ) - ) - (block $compile_store.71 - (local.set $31 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $30) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - ) - (block $do_backpatches.70 - ) - ) - (block $compile_store.73 - (local.set $32 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $31) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - ) - (block $do_backpatches.72 - ) - ) - (block $compile_store.75 - (local.set $33 - (call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - ) - (block $do_backpatches.74 - ) - ) - (block $cleanup.76 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - (return_call $+_1149 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1149) - ) - (local.get $33) - (local.get $17) - ) - ) - ) - ) - ) - (block $cleanup.64 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 26 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 27 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 26 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 27 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 28) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1155) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot b/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot index 46e6520039..a62c665e71 100644 --- a/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot @@ -1,225 +1,93 @@ pattern matching › record_match_deep -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.20 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 610197211) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.13 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $9) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $cleanup.14 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - (drop - (block $compile_set.15 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.17_outer (result i32) - (block $switch.17_branch_0 (result i32) - (drop - (block $switch.17_branch_1 (result i32) - (drop - (block $switch.17_default (result i32) - (br_table $switch.17_branch_1 $switch.17_default $switch.17_default - (i32.const 0) - (i32.shr_s - (i32.const 1) - (i32.const 1) - ) - ) - ) - ) - (br $switch.17_outer - (block $compile_block.19 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.17_outer - (block $compile_block.18 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (block $cleanup.16 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 606 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot b/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot index fd6241d725..40e5c01e47 100644 --- a/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot @@ -1,242 +1,168 @@ pattern matching › low_level_constant_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1116 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.28 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (select - (i32.const -2) - (i32.const 2147483646) - (f64.eq - (f64.const 1) - (f64.const 0) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.17 - (local.set $8 - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.15 (result i32) - (block $compile_store.8 - (local.set $9 - (select - (i32.const -2) - (i32.const 2147483646) - (f64.eq - (f64.const 1) - (f64.const 1) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.9 (result i32) - (i32.const 3) - ) - (block $compile_block.14 (result i32) - (block $compile_store.11 - (local.set $10 - (select - (i32.const -2) - (i32.const 2147483646) - (f64.eq - (f64.const 1) - (f64.const 2) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.12 (result i32) - (i32.const 5) - ) - (block $compile_block.13 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.25 - (local.set $11 - (block $switch.18_outer (result i32) - (block $switch.18_branch_0 (result i32) - (drop - (block $switch.18_branch_1 (result i32) - (drop - (block $switch.18_branch_2 (result i32) - (drop - (block $switch.18_branch_3 (result i32) - (drop - (block $switch.18_branch_4 (result i32) - (drop - (block $switch.18_default (result i32) - (br_table $switch.18_branch_1 $switch.18_branch_2 $switch.18_branch_3 $switch.18_branch_4 $switch.18_default $switch.18_default - (i32.const 0) - (i32.shr_s - (local.get $8) - (i32.const 1) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.23 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.22 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.21 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.20 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.19 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $12 - (call $print_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1116) - ) - (local.get $11) - (local.get $6) - ) - ) - (block $do_backpatches.26 - ) - ) - (i32.const 1) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstF64 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4611686018427387904)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot b/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot index 5a15c3c938..5292523a28 100644 --- a/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot @@ -1,431 +1,247 @@ pattern matching › guarded_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1126 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (block $compile_block.39 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 17) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $13 - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.25 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 7) - ) - ) - (block $compile_block.23 (result i32) - (local.get $13) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.32 - (local.set $15 - (if (result i32) - (i32.shr_u - (local.get $14) - (i32.const 31) - ) - (block $compile_block.29 (result i32) - (drop - (block $compile_set.26 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.27 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.28 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.30 (result i32) - (i32.const 3) - ) - ) - ) - (block $do_backpatches.31 - ) - ) - (block $cleanup.33 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.35_outer (result i32) - (block $switch.35_branch_0 (result i32) - (drop - (block $switch.35_branch_1 (result i32) - (drop - (block $switch.35_branch_2 (result i32) - (drop - (block $switch.35_default (result i32) - (br_table $switch.35_branch_1 $switch.35_branch_2 $switch.35_default $switch.35_default - (i32.const 0) - (i32.shr_s - (local.get $15) - (i32.const 1) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.38 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.37 (result i32) - (i32.const 199) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.36 (result i32) - (i32.const 85) - ) - ) - ) - ) - (block $cleanup.34 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1132) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot index 4ee68d69f8..ff105cd715 100644 --- a/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot @@ -1,402 +1,217 @@ pattern matching › guarded_match_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1125 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1125 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.35 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $13 - (call $==_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1125) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 3) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.28 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.25 (result i32) - (drop - (block $compile_set.22 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.23 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.24 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.26 (result i32) - (i32.const 3) - ) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $cleanup.29 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.31_outer (result i32) - (block $switch.31_branch_0 (result i32) - (drop - (block $switch.31_branch_1 (result i32) - (drop - (block $switch.31_branch_2 (result i32) - (drop - (block $switch.31_default (result i32) - (br_table $switch.31_branch_1 $switch.31_branch_2 $switch.31_default $switch.31_default - (i32.const 0) - (i32.shr_s - (local.get $14) - (i32.const 1) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.34 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.33 (result i32) - (i32.const 199) - ) - ) - ) - ) - (br $switch.31_outer - (block $compile_block.32 (result i32) - (i32.const 85) - ) - ) - ) - ) - (block $cleanup.30 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot b/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot index 1bfcf1ba1a..5b47d0fc4d 100644 --- a/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot @@ -1,895 +1,559 @@ pattern matching › adt_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1145 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1145 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (block $compile_block.92 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $21 - (i32.load offset=12 - (local.get $7) - ) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $22 - (i32.or - (i32.shl - (i32.eq - (local.get $21) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.78 - (local.set $23 - (if (result i32) - (i32.shr_u - (local.get $22) - (i32.const 31) - ) - (block $compile_block.71 (result i32) - (block $compile_store.24 - (local.set $14 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $7) - ) - ) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $7) - ) - ) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $25 - (i32.load offset=12 - (local.get $15) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $26 - (i32.or - (i32.shl - (i32.eq - (local.get $25) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.29 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $26) - (i32.const 31) - ) - (block $compile_block.64 (result i32) - (block $compile_store.33 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $15) - ) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $compile_store.35 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $15) - ) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.37 - (local.set $28 - (i32.load offset=12 - (local.get $17) - ) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.39 - (local.set $29 - (i32.or - (i32.shl - (i32.eq - (local.get $28) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.38 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $29) - (i32.const 31) - ) - (block $compile_block.56 (result i32) - (block $compile_store.42 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $17) - ) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $compile_store.44 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $17) - ) - ) - ) - (block $do_backpatches.43 - ) - ) - (block $compile_store.46 - (local.set $31 - (i32.load offset=12 - (local.get $19) - ) - ) - (block $do_backpatches.45 - ) - ) - (block $cleanup.47 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (block $compile_store.49 - (local.set $32 - (i32.or - (i32.shl - (i32.eq - (local.get $31) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.48 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $32) - (i32.const 31) - ) - (block $compile_block.54 (result i32) - (drop - (block $compile_set.51 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.52 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.53 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.55 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.50 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.63 (result i32) - (block $compile_store.58 - (local.set $30 - (i32.or - (i32.shl - (i32.eq - (local.get $28) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.57 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $30) - (i32.const 31) - ) - (block $compile_block.61 (result i32) - (drop - (block $compile_set.59 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.60 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.62 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.40 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.70 (result i32) - (block $compile_store.66 - (local.set $27 - (i32.or - (i32.shl - (i32.eq - (local.get $25) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.65 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $27) - (i32.const 31) - ) - (block $compile_block.68 (result i32) - (drop - (block $compile_set.67 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.69 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.31 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.76 (result i32) - (block $compile_store.73 - (local.set $24 - (i32.or - (i32.shl - (i32.eq - (local.get $21) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.72 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $24) - (i32.const 31) - ) - (block $compile_block.74 (result i32) - (i32.const 1) - ) - (block $compile_block.75 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.77 - ) - ) - (block $cleanup.79 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.81_outer (result i32) - (block $switch.81_branch_0 (result i32) - (drop - (block $switch.81_branch_1 (result i32) - (drop - (block $switch.81_branch_2 (result i32) - (drop - (block $switch.81_branch_3 (result i32) - (drop - (block $switch.81_branch_4 (result i32) - (drop - (block $switch.81_branch_5 (result i32) - (drop - (block $switch.81_default (result i32) - (br_table $switch.81_branch_1 $switch.81_branch_2 $switch.81_branch_3 $switch.81_branch_4 $switch.81_branch_5 $switch.81_default $switch.81_default - (i32.const 0) - (i32.shr_s - (local.get $23) - (i32.const 1) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.91 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.90 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.89 - (block $compile_store.87 - (local.set $20 - (call $+_1145 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1145) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - ) - (block $do_backpatches.86 - ) - ) - (block $cleanup.88 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (return_call $+_1145 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1145) - ) - (local.get $20) - (local.get $13) - ) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.85 - (block $cleanup.84 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - (return_call $+_1145 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1145) - ) - (local.get $9) - (local.get $10) - ) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.83 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - ) - ) - ) - (br $switch.81_outer - (block $compile_block.82 (result i32) - (i32.const 1) - ) - ) - ) - ) - (block $cleanup.80 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 8 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 8 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1145) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MCallKnown (func +_1145) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1145) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 15) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1148) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot b/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot index 55e79a2aec..f277086160 100644 --- a/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot @@ -1,431 +1,247 @@ pattern matching › guarded_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1126 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (block $compile_block.39 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $13 - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 5) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.25 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 7) - ) - ) - (block $compile_block.23 (result i32) - (local.get $13) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.32 - (local.set $15 - (if (result i32) - (i32.shr_u - (local.get $14) - (i32.const 31) - ) - (block $compile_block.29 (result i32) - (drop - (block $compile_set.26 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.27 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.28 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.30 (result i32) - (i32.const 3) - ) - ) - ) - (block $do_backpatches.31 - ) - ) - (block $cleanup.33 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.35_outer (result i32) - (block $switch.35_branch_0 (result i32) - (drop - (block $switch.35_branch_1 (result i32) - (drop - (block $switch.35_branch_2 (result i32) - (drop - (block $switch.35_default (result i32) - (br_table $switch.35_branch_1 $switch.35_branch_2 $switch.35_default $switch.35_default - (i32.const 0) - (i32.shr_s - (local.get $15) - (i32.const 1) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.38 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.37 (result i32) - (i32.const 199) - ) - ) - ) - ) - (br $switch.35_outer - (block $compile_block.36 (result i32) - (i32.const 85) - ) - ) - ) - ) - (block $cleanup.34 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1132) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot index 5bd625281e..ccce6e3c90 100644 --- a/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot @@ -1,248 +1,155 @@ pattern matching › low_level_constant_match_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1116 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1116 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.28 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.or - (i32.shl - (i32.eq - (i32.const 1) - (i32.const 0) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.17 - (local.set $8 - (if (result i32) - (i32.shr_u - (local.get $7) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.15 (result i32) - (block $compile_store.8 - (local.set $9 - (i32.or - (i32.shl - (i32.eq - (i32.const 1) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.7 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.9 (result i32) - (i32.const 3) - ) - (block $compile_block.14 (result i32) - (block $compile_store.11 - (local.set $10 - (i32.or - (i32.shl - (i32.eq - (i32.const 1) - (i32.const 2) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.10 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.12 (result i32) - (i32.const 5) - ) - (block $compile_block.13 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.25 - (local.set $11 - (block $switch.18_outer (result i32) - (block $switch.18_branch_0 (result i32) - (drop - (block $switch.18_branch_1 (result i32) - (drop - (block $switch.18_branch_2 (result i32) - (drop - (block $switch.18_branch_3 (result i32) - (drop - (block $switch.18_branch_4 (result i32) - (drop - (block $switch.18_default (result i32) - (br_table $switch.18_branch_1 $switch.18_branch_2 $switch.18_branch_3 $switch.18_branch_4 $switch.18_default $switch.18_default - (i32.const 0) - (i32.shr_s - (local.get $8) - (i32.const 1) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.23 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.22 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.21 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.20 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.18_outer - (block $compile_block.19 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $12 - (call $print_1116 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1116) - ) - (local.get $11) - (local.get $6) - ) - ) - (block $do_backpatches.26 - ) - ) - (i32.const 1) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot b/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot index 84517d7d64..3843458f85 100644 --- a/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot @@ -1,938 +1,575 @@ pattern matching › adt_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1147 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1147 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (block $compile_block.95 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $22 - (i32.load offset=12 - (local.get $8) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $23 - (i32.or - (i32.shl - (i32.eq - (local.get $22) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.81 - (local.set $24 - (if (result i32) - (i32.shr_u - (local.get $23) - (i32.const 31) - ) - (block $compile_block.74 (result i32) - (block $compile_store.27 - (local.set $15 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $8) - ) - ) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $16 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $8) - ) - ) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $26 - (i32.load offset=12 - (local.get $16) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.33 - (local.set $27 - (i32.or - (i32.shl - (i32.eq - (local.get $26) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.32 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $27) - (i32.const 31) - ) - (block $compile_block.67 (result i32) - (block $compile_store.36 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $16) - ) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $compile_store.38 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $16) - ) - ) - ) - (block $do_backpatches.37 - ) - ) - (block $compile_store.40 - (local.set $29 - (i32.load offset=12 - (local.get $18) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.42 - (local.set $30 - (i32.or - (i32.shl - (i32.eq - (local.get $29) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.41 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $30) - (i32.const 31) - ) - (block $compile_block.59 (result i32) - (block $compile_store.45 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $18) - ) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $compile_store.47 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $18) - ) - ) - ) - (block $do_backpatches.46 - ) - ) - (block $compile_store.49 - (local.set $32 - (i32.load offset=12 - (local.get $20) - ) - ) - (block $do_backpatches.48 - ) - ) - (block $cleanup.50 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - (block $compile_store.52 - (local.set $33 - (i32.or - (i32.shl - (i32.eq - (local.get $32) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.51 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $33) - (i32.const 31) - ) - (block $compile_block.57 (result i32) - (drop - (block $compile_set.54 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.55 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.56 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.58 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.53 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.66 (result i32) - (block $compile_store.61 - (local.set $31 - (i32.or - (i32.shl - (i32.eq - (local.get $29) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.60 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $31) - (i32.const 31) - ) - (block $compile_block.64 (result i32) - (drop - (block $compile_set.62 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.63 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.65 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.43 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.73 (result i32) - (block $compile_store.69 - (local.set $28 - (i32.or - (i32.shl - (i32.eq - (local.get $26) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.68 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $28) - (i32.const 31) - ) - (block $compile_block.71 (result i32) - (drop - (block $compile_set.70 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.72 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.34 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.79 (result i32) - (block $compile_store.76 - (local.set $25 - (i32.or - (i32.shl - (i32.eq - (local.get $22) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.75 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $25) - (i32.const 31) - ) - (block $compile_block.77 (result i32) - (i32.const 1) - ) - (block $compile_block.78 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.80 - ) - ) - (block $cleanup.82 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.84_outer (result i32) - (block $switch.84_branch_0 (result i32) - (drop - (block $switch.84_branch_1 (result i32) - (drop - (block $switch.84_branch_2 (result i32) - (drop - (block $switch.84_branch_3 (result i32) - (drop - (block $switch.84_branch_4 (result i32) - (drop - (block $switch.84_branch_5 (result i32) - (drop - (block $switch.84_default (result i32) - (br_table $switch.84_branch_1 $switch.84_branch_2 $switch.84_branch_3 $switch.84_branch_4 $switch.84_branch_5 $switch.84_default $switch.84_default - (i32.const 0) - (i32.shr_s - (local.get $24) - (i32.const 1) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.94 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.93 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.92 - (block $compile_store.90 - (local.set $21 - (call $+_1147 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1147) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - ) - ) - (block $do_backpatches.89 - ) - ) - (block $cleanup.91 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - (return_call $+_1147 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1147) - ) - (local.get $21) - (local.get $14) - ) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.88 - (block $cleanup.87 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - (return_call $+_1147 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1147) - ) - (local.get $10) - (local.get $11) - ) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.86 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - ) - ) - ) - (br $switch.84_outer - (block $compile_block.85 (result i32) - (i32.const 1) - ) - ) - ) - ) - (block $cleanup.83 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1147) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MCallKnown (func +_1147) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1147) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 16) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1150) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot b/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot index 7c85f281a0..b4ba4736d5 100644 --- a/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot @@ -1,364 +1,200 @@ pattern matching › alias_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.38 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $9 - (i32.load offset=12 - (local.get $6) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $10 - (i32.or - (i32.shl - (i32.eq - (local.get $9) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.30 - (local.set $11 - (if (result i32) - (i32.shr_u - (local.get $10) - (i32.const 31) - ) - (block $compile_block.10 (result i32) - (i32.const 3) - ) - (block $compile_block.28 (result i32) - (block $compile_store.12 - (local.set $12 - (i32.or - (i32.shl - (i32.eq - (local.get $9) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.11 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $12) - (i32.const 31) - ) - (block $compile_block.26 (result i32) - (block $compile_store.14 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $13 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (i32.const 7) - ) - ) - (block $do_backpatches.15 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.19 (result i32) - (drop - (block $compile_set.18 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.25 (result i32) - (block $compile_store.21 - (local.set $14 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (i32.const 9) - ) - ) - (block $do_backpatches.20 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $14) - (i32.const 31) - ) - (block $compile_block.23 (result i32) - (drop - (block $compile_set.22 (result i32) - (local.set $7 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.24 (result i32) - (i32.const 3) - ) - ) - ) - ) - (block $cleanup.17 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.27 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $cleanup.31 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.33_outer (result i32) - (block $switch.33_branch_0 (result i32) - (drop - (block $switch.33_branch_1 (result i32) - (drop - (block $switch.33_branch_2 (result i32) - (drop - (block $switch.33_branch_3 (result i32) - (drop - (block $switch.33_default (result i32) - (br_table $switch.33_branch_1 $switch.33_branch_2 $switch.33_branch_3 $switch.33_default $switch.33_default - (i32.const 0) - (i32.shr_s - (local.get $11) - (i32.const 1) - ) - ) - ) - ) - (br $switch.33_outer - (block $compile_block.37 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.33_outer - (block $compile_block.36 (result i32) - (i32.const 13) - ) - ) - ) - ) - (br $switch.33_outer - (block $compile_block.35 (result i32) - (i32.const 11) - ) - ) - ) - ) - (br $switch.33_outer - (block $compile_block.34 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - ) - ) - ) - ) - (block $cleanup.32 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 2 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1129) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot b/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot index 95070d1379..7c7eb0ffba 100644 --- a/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot @@ -1,1024 +1,607 @@ pattern matching › adt_match_5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1151 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1151 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (block $compile_block.101 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 15) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.18 - ) - ) - (block $compile_store.21 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.23 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $24 - (i32.load offset=12 - (local.get $10) - ) - ) - (block $do_backpatches.28 - ) - ) - (block $compile_store.31 - (local.set $25 - (i32.or - (i32.shl - (i32.eq - (local.get $24) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.30 - ) - ) - (block $compile_store.87 - (local.set $26 - (if (result i32) - (i32.shr_u - (local.get $25) - (i32.const 31) - ) - (block $compile_block.80 (result i32) - (block $compile_store.33 - (local.set $17 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $10) - ) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $compile_store.35 - (local.set $18 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $10) - ) - ) - ) - (block $do_backpatches.34 - ) - ) - (block $compile_store.37 - (local.set $28 - (i32.load offset=12 - (local.get $18) - ) - ) - (block $do_backpatches.36 - ) - ) - (block $compile_store.39 - (local.set $29 - (i32.or - (i32.shl - (i32.eq - (local.get $28) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.38 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $29) - (i32.const 31) - ) - (block $compile_block.73 (result i32) - (block $compile_store.42 - (local.set $19 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $18) - ) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $compile_store.44 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $18) - ) - ) - ) - (block $do_backpatches.43 - ) - ) - (block $compile_store.46 - (local.set $31 - (i32.load offset=12 - (local.get $20) - ) - ) - (block $do_backpatches.45 - ) - ) - (block $compile_store.48 - (local.set $32 - (i32.or - (i32.shl - (i32.eq - (local.get $31) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.47 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $32) - (i32.const 31) - ) - (block $compile_block.65 (result i32) - (block $compile_store.51 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $20) - ) - ) - ) - (block $do_backpatches.50 - ) - ) - (block $compile_store.53 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $20) - ) - ) - ) - (block $do_backpatches.52 - ) - ) - (block $compile_store.55 - (local.set $34 - (i32.load offset=12 - (local.get $22) - ) - ) - (block $do_backpatches.54 - ) - ) - (block $cleanup.56 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - ) - (block $compile_store.58 - (local.set $35 - (i32.or - (i32.shl - (i32.eq - (local.get $34) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.57 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $35) - (i32.const 31) - ) - (block $compile_block.63 (result i32) - (drop - (block $compile_set.60 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.61 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.62 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $21) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.64 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.59 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.72 (result i32) - (block $compile_store.67 - (local.set $33 - (i32.or - (i32.shl - (i32.eq - (local.get $31) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.66 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $33) - (i32.const 31) - ) - (block $compile_block.70 (result i32) - (drop - (block $compile_set.68 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.69 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.71 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.49 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.79 (result i32) - (block $compile_store.75 - (local.set $30 - (i32.or - (i32.shl - (i32.eq - (local.get $28) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.74 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $30) - (i32.const 31) - ) - (block $compile_block.77 (result i32) - (drop - (block $compile_set.76 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.78 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.40 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.85 (result i32) - (block $compile_store.82 - (local.set $27 - (i32.or - (i32.shl - (i32.eq - (local.get $24) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.81 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $27) - (i32.const 31) - ) - (block $compile_block.83 (result i32) - (i32.const 1) - ) - (block $compile_block.84 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.86 - ) - ) - (block $cleanup.88 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.90_outer (result i32) - (block $switch.90_branch_0 (result i32) - (drop - (block $switch.90_branch_1 (result i32) - (drop - (block $switch.90_branch_2 (result i32) - (drop - (block $switch.90_branch_3 (result i32) - (drop - (block $switch.90_branch_4 (result i32) - (drop - (block $switch.90_branch_5 (result i32) - (drop - (block $switch.90_default (result i32) - (br_table $switch.90_branch_1 $switch.90_branch_2 $switch.90_branch_3 $switch.90_branch_4 $switch.90_branch_5 $switch.90_default $switch.90_default - (i32.const 0) - (i32.shr_s - (local.get $26) - (i32.const 1) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.100 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.99 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.98 - (block $compile_store.96 - (local.set $23 - (call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - ) - ) - (block $do_backpatches.95 - ) - ) - (block $cleanup.97 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - (return_call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $23) - (local.get $16) - ) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.94 - (block $cleanup.93 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - (return_call $+_1151 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1151) - ) - (local.get $12) - (local.get $13) - ) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.92 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - ) - ) - ) - (br $switch.90_outer - (block $compile_block.91 (result i32) - (i32.const 1) - ) - ) - ) - ) - (block $cleanup.89 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 18) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1154) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot b/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot index 36b12463de..2e078d4622 100644 --- a/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot @@ -1,127 +1,68 @@ pattern matching › or_match_4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.14 (result i32) - (block $compile_store.2 - (local.set $6 - (i32.or - (i32.shl - (i32.eq - (i32.const -2) - (i32.const 2147483646) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.10 - (local.set $7 - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 1) - ) - (block $compile_block.8 (result i32) - (block $compile_store.5 - (local.set $8 - (i32.or - (i32.shl - (i32.eq - (i32.const -2) - (i32.const -2) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.4 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $8) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.7 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $switch.11_outer (result i32) - (block $switch.11_branch_0 (result i32) - (drop - (block $switch.11_branch_1 (result i32) - (drop - (block $switch.11_default (result i32) - (br_table $switch.11_branch_1 $switch.11_default $switch.11_default - (i32.const 0) - (i32.shr_s - (local.get $7) - (i32.const 1) - ) - ) - ) - ) - (br $switch.11_outer - (block $compile_block.13 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.11_outer - (block $compile_block.12 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot index 8d2cd1933f..6bffceb371 100644 --- a/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot @@ -1,1303 +1,792 @@ pattern matching › tuple_match_deep5 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1155 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1155 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (local $41 i32) - (local $42 i32) - (block $compile_block.120 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_tuple.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $10 - (i32.const 0) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $11 - (i32.const 0) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $18 - (i32.const 0) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.32 - (local.set $19 - (i32.const 0) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (local.set $20 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $9) - ) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.36 - (local.set $21 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $9) - ) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $cleanup.37 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - (block $compile_store.39 - (local.set $31 - (i32.load offset=12 - (local.get $21) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $compile_store.41 - (local.set $32 - (i32.or - (i32.shl - (i32.eq - (local.get $31) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.40 - ) - ) - (block $compile_store.101 - (local.set $33 - (if (result i32) - (i32.shr_u - (local.get $32) - (i32.const 31) - ) - (block $compile_block.93 (result i32) - (block $compile_store.43 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $21) - ) - ) - ) - (block $do_backpatches.42 - ) - ) - (block $compile_store.45 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $21) - ) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $compile_store.47 - (local.set $35 - (i32.load offset=12 - (local.get $23) - ) - ) - (block $do_backpatches.46 - ) - ) - (block $compile_store.49 - (local.set $36 - (i32.or - (i32.shl - (i32.eq - (local.get $35) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.48 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $36) - (i32.const 31) - ) - (block $compile_block.85 (result i32) - (block $compile_store.52 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $23) - ) - ) - ) - (block $do_backpatches.51 - ) - ) - (block $compile_store.54 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $23) - ) - ) - ) - (block $do_backpatches.53 - ) - ) - (block $compile_store.56 - (local.set $38 - (i32.load offset=12 - (local.get $25) - ) - ) - (block $do_backpatches.55 - ) - ) - (block $compile_store.58 - (local.set $39 - (i32.or - (i32.shl - (i32.eq - (local.get $38) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.57 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $39) - (i32.const 31) - ) - (block $compile_block.76 (result i32) - (block $compile_store.61 - (local.set $26 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $25) - ) - ) - ) - (block $do_backpatches.60 - ) - ) - (block $compile_store.63 - (local.set $27 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $25) - ) - ) - ) - (block $do_backpatches.62 - ) - ) - (block $compile_store.65 - (local.set $41 - (i32.load offset=12 - (local.get $27) - ) - ) - (block $do_backpatches.64 - ) - ) - (block $cleanup.66 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $27) - ) - ) - ) - (block $compile_store.68 - (local.set $42 - (i32.or - (i32.shl - (i32.eq - (local.get $41) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.67 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $42) - (i32.const 31) - ) - (block $compile_block.74 (result i32) - (drop - (block $compile_set.70 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.71 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.72 (result i32) - (local.set $18 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.73 (result i32) - (local.set $19 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $26) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.75 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.69 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $26) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.84 (result i32) - (block $compile_store.78 - (local.set $40 - (i32.or - (i32.shl - (i32.eq - (local.get $38) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.77 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $40) - (i32.const 31) - ) - (block $compile_block.82 (result i32) - (drop - (block $compile_set.79 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.80 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.81 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.83 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.59 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $24) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $25) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.92 (result i32) - (block $compile_store.87 - (local.set $37 - (i32.or - (i32.shl - (i32.eq - (local.get $35) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.86 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $37) - (i32.const 31) - ) - (block $compile_block.90 (result i32) - (drop - (block $compile_set.88 (result i32) - (local.set $11 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.89 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.91 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.50 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.99 (result i32) - (block $compile_store.95 - (local.set $34 - (i32.or - (i32.shl - (i32.eq - (local.get $31) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.94 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $34) - (i32.const 31) - ) - (block $compile_block.97 (result i32) - (drop - (block $compile_set.96 (result i32) - (local.set $10 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.98 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.100 - ) - ) - (block $cleanup.102 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.104_outer (result i32) - (block $switch.104_branch_0 (result i32) - (drop - (block $switch.104_branch_1 (result i32) - (drop - (block $switch.104_branch_2 (result i32) - (drop - (block $switch.104_branch_3 (result i32) - (drop - (block $switch.104_branch_4 (result i32) - (drop - (block $switch.104_branch_5 (result i32) - (drop - (block $switch.104_default (result i32) - (br_table $switch.104_branch_1 $switch.104_branch_2 $switch.104_branch_3 $switch.104_branch_4 $switch.104_branch_5 $switch.104_default $switch.104_default - (i32.const 0) - (i32.shr_s - (local.get $33) - (i32.const 1) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.119 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.118 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.117 - (block $compile_store.113 - (local.set $29 - (call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $17) - ) - ) - ) - (block $do_backpatches.112 - ) - ) - (block $compile_store.115 - (local.set $30 - (call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (local.get $29) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - ) - ) - (block $do_backpatches.114 - ) - ) - (block $cleanup.116 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - (return_call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (local.get $30) - (local.get $19) - ) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.111 - (block $compile_store.109 - (local.set $28 - (call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $14) - ) - ) - ) - (block $do_backpatches.108 - ) - ) - (block $cleanup.110 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (return_call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (local.get $28) - (local.get $15) - ) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.107 - (block $cleanup.106 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - (return_call $+_1155 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1155) - ) - (local.get $11) - (local.get $12) - ) - ) - ) - ) - ) - (br $switch.104_outer - (block $compile_block.105 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - ) - ) - ) - ) - (block $cleanup.103 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 25) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1160) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot b/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot index 5904371f3e..c08ac43ead 100644 --- a/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot @@ -1,473 +1,267 @@ pattern matching › constant_match_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1126 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (block $compile_block.49 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (local.get $6) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $9 - (i32.const 0) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $7) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $7) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $cleanup.15 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.18 - (local.set $12 - (block $allocate_string.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $13 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (local.get $10) - (local.get $12) - ) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.40 - (local.set $14 - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.37 (result i32) - (drop - (block $compile_set.21 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.23 - (local.set $15 - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (i32.const 15) - ) - ) - (block $do_backpatches.22 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $15) - (i32.const 31) - ) - (block $compile_block.25 (result i32) - (drop - (block $compile_set.24 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.36 (result i32) - (block $compile_store.27 - (local.set $16 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - (i32.const 19) - ) - ) - (block $do_backpatches.26 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $16) - (i32.const 31) - ) - (block $compile_block.28 (result i32) - (i32.const 3) - ) - (block $compile_block.35 (result i32) - (drop - (block $compile_set.29 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.31 - (local.set $17 - (call $==_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (i32.const 11) - ) - ) - (block $do_backpatches.30 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $17) - (i32.const 31) - ) - (block $compile_block.33 (result i32) - (drop - (block $compile_set.32 (result i32) - (local.set $9 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.34 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - ) - (block $compile_block.38 (result i32) - (i32.const 7) - ) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $cleanup.41 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.43_outer (result i32) - (block $switch.43_branch_0 (result i32) - (drop - (block $switch.43_branch_1 (result i32) - (drop - (block $switch.43_branch_2 (result i32) - (drop - (block $switch.43_branch_3 (result i32) - (drop - (block $switch.43_branch_4 (result i32) - (drop - (block $switch.43_default (result i32) - (br_table $switch.43_branch_1 $switch.43_branch_2 $switch.43_branch_3 $switch.43_branch_4 $switch.43_default $switch.43_default - (i32.const 0) - (i32.shr_s - (local.get $14) - (i32.const 1) - ) - ) - ) - ) - (br $switch.43_outer - (block $compile_block.48 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.43_outer - (block $compile_block.47 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.43_outer - (block $compile_block.46 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.43_outer - (block $compile_block.45 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.43_outer - (block $compile_block.44 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (block $cleanup.42 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 5) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1135) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot index 2a8dc8d2f8..a1dae6bae5 100644 --- a/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot @@ -1,1389 +1,824 @@ pattern matching › tuple_match_deep7 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1159 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1159 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (local $41 i32) - (local $42 i32) - (local $43 i32) - (local $44 i32) - (block $compile_block.126 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 15) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_tuple.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $12 - (i32.const 0) - ) - (block $do_backpatches.19 - ) - ) - (block $compile_store.22 - (local.set $13 - (i32.const 0) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (local.set $14 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (local.set $15 - (i32.const 0) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $16 - (i32.const 0) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $17 - (i32.const 0) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.32 - (local.set $18 - (i32.const 0) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (local.set $19 - (i32.const 0) - ) - (block $do_backpatches.33 - ) - ) - (block $compile_store.36 - (local.set $20 - (i32.const 0) - ) - (block $do_backpatches.35 - ) - ) - (block $compile_store.38 - (local.set $21 - (i32.const 0) - ) - (block $do_backpatches.37 - ) - ) - (block $compile_store.40 - (local.set $22 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $11) - ) - ) - ) - (block $do_backpatches.39 - ) - ) - (block $compile_store.42 - (local.set $23 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $11) - ) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $cleanup.43 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (block $compile_store.45 - (local.set $33 - (i32.load offset=12 - (local.get $23) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $compile_store.47 - (local.set $34 - (i32.or - (i32.shl - (i32.eq - (local.get $33) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.46 - ) - ) - (block $compile_store.107 - (local.set $35 - (if (result i32) - (i32.shr_u - (local.get $34) - (i32.const 31) - ) - (block $compile_block.99 (result i32) - (block $compile_store.49 - (local.set $24 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $23) - ) - ) - ) - (block $do_backpatches.48 - ) - ) - (block $compile_store.51 - (local.set $25 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $23) - ) - ) - ) - (block $do_backpatches.50 - ) - ) - (block $compile_store.53 - (local.set $37 - (i32.load offset=12 - (local.get $25) - ) - ) - (block $do_backpatches.52 - ) - ) - (block $compile_store.55 - (local.set $38 - (i32.or - (i32.shl - (i32.eq - (local.get $37) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.54 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $38) - (i32.const 31) - ) - (block $compile_block.91 (result i32) - (block $compile_store.58 - (local.set $26 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $25) - ) - ) - ) - (block $do_backpatches.57 - ) - ) - (block $compile_store.60 - (local.set $27 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $25) - ) - ) - ) - (block $do_backpatches.59 - ) - ) - (block $compile_store.62 - (local.set $40 - (i32.load offset=12 - (local.get $27) - ) - ) - (block $do_backpatches.61 - ) - ) - (block $compile_store.64 - (local.set $41 - (i32.or - (i32.shl - (i32.eq - (local.get $40) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.63 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $41) - (i32.const 31) - ) - (block $compile_block.82 (result i32) - (block $compile_store.67 - (local.set $28 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $27) - ) - ) - ) - (block $do_backpatches.66 - ) - ) - (block $compile_store.69 - (local.set $29 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $27) - ) - ) - ) - (block $do_backpatches.68 - ) - ) - (block $compile_store.71 - (local.set $43 - (i32.load offset=12 - (local.get $29) - ) - ) - (block $do_backpatches.70 - ) - ) - (block $cleanup.72 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $29) - ) - ) - ) - (block $compile_store.74 - (local.set $44 - (i32.or - (i32.shl - (i32.eq - (local.get $43) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.73 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $44) - (i32.const 31) - ) - (block $compile_block.80 (result i32) - (drop - (block $compile_set.76 (result i32) - (local.set $18 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.77 (result i32) - (local.set $19 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.78 (result i32) - (local.set $20 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $26) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.79 (result i32) - (local.set $21 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $28) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 7) - ) - (block $compile_block.81 (result i32) - (i32.const 9) - ) - ) - (block $cleanup.75 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $28) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.90 (result i32) - (block $compile_store.84 - (local.set $42 - (i32.or - (i32.shl - (i32.eq - (local.get $40) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.83 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $42) - (i32.const 31) - ) - (block $compile_block.88 (result i32) - (drop - (block $compile_set.85 (result i32) - (local.set $15 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.86 (result i32) - (local.set $16 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.87 (result i32) - (local.set $17 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $26) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 5) - ) - (block $compile_block.89 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.65 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $26) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $27) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.98 (result i32) - (block $compile_store.93 - (local.set $39 - (i32.or - (i32.shl - (i32.eq - (local.get $37) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.92 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $39) - (i32.const 31) - ) - (block $compile_block.96 (result i32) - (drop - (block $compile_set.94 (result i32) - (local.set $13 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.95 (result i32) - (local.set $14 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $24) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 3) - ) - (block $compile_block.97 (result i32) - (i32.const 9) - ) - ) - ) - ) - (block $cleanup.56 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $24) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $25) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.105 (result i32) - (block $compile_store.101 - (local.set $36 - (i32.or - (i32.shl - (i32.eq - (local.get $33) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.100 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $36) - (i32.const 31) - ) - (block $compile_block.103 (result i32) - (drop - (block $compile_set.102 (result i32) - (local.set $12 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $22) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.104 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.106 - ) - ) - (block $cleanup.108 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $22) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $23) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.110_outer (result i32) - (block $switch.110_branch_0 (result i32) - (drop - (block $switch.110_branch_1 (result i32) - (drop - (block $switch.110_branch_2 (result i32) - (drop - (block $switch.110_branch_3 (result i32) - (drop - (block $switch.110_branch_4 (result i32) - (drop - (block $switch.110_branch_5 (result i32) - (drop - (block $switch.110_default (result i32) - (br_table $switch.110_branch_1 $switch.110_branch_2 $switch.110_branch_3 $switch.110_branch_4 $switch.110_branch_5 $switch.110_default $switch.110_default - (i32.const 0) - (i32.shr_s - (local.get $35) - (i32.const 1) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.125 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.124 (result i32) - (i32.const 1999) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.123 - (block $compile_store.119 - (local.set $31 - (call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $18) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $19) - ) - ) - ) - (block $do_backpatches.118 - ) - ) - (block $compile_store.121 - (local.set $32 - (call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (local.get $31) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $20) - ) - ) - ) - (block $do_backpatches.120 - ) - ) - (block $cleanup.122 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - ) - (return_call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (local.get $32) - (local.get $21) - ) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.117 - (block $compile_store.115 - (local.set $30 - (call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $15) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $16) - ) - ) - ) - (block $do_backpatches.114 - ) - ) - (block $cleanup.116 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - (return_call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (local.get $30) - (local.get $17) - ) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.113 - (block $cleanup.112 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - ) - (return_call $+_1159 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1159) - ) - (local.get $13) - (local.get $14) - ) - ) - ) - ) - ) - (br $switch.110_outer - (block $compile_block.111 (result i32) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - ) - ) - ) - ) - (block $cleanup.109 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $14) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $15) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $16) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $17) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $18) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $19) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $20) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $21) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 15 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 22 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 3))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 26 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 26 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 27) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1164) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot index efc203dd12..01893af2ed 100644 --- a/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot @@ -1,579 +1,339 @@ pattern matching › or_match_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (block $compile_block.65 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $14 - (i32.load offset=12 - (local.get $7) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $compile_store.12 - (local.set $15 - (i32.or - (i32.shl - (i32.eq - (local.get $14) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.58 - (local.set $16 - (if (result i32) - (i32.shr_u - (local.get $15) - (i32.const 31) - ) - (block $compile_block.55 (result i32) - (block $compile_store.14 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $7) - ) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $compile_store.16 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $7) - ) - ) - ) - (block $do_backpatches.15 - ) - ) - (block $compile_store.18 - (local.set $17 - (i32.load offset=12 - (local.get $10) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.20 - (local.set $18 - (i32.or - (i32.shl - (i32.eq - (local.get $17) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.19 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $18) - (i32.const 31) - ) - (block $compile_block.48 (result i32) - (block $compile_store.23 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $10) - ) - ) - ) - (block $do_backpatches.22 - ) - ) - (block $compile_store.25 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $10) - ) - ) - ) - (block $do_backpatches.24 - ) - ) - (block $compile_store.27 - (local.set $20 - (i32.load offset=12 - (local.get $12) - ) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.29 - (local.set $21 - (i32.or - (i32.shl - (i32.eq - (local.get $20) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.28 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $21) - (i32.const 31) - ) - (block $compile_block.41 (result i32) - (block $compile_store.32 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $12) - ) - ) - ) - (block $do_backpatches.31 - ) - ) - (block $compile_store.34 - (local.set $23 - (i32.load offset=12 - (local.get $13) - ) - ) - (block $do_backpatches.33 - ) - ) - (block $cleanup.35 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $13) - ) - ) - ) - (block $compile_store.37 - (local.set $24 - (i32.or - (i32.shl - (i32.eq - (local.get $23) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.36 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $24) - (i32.const 31) - ) - (block $compile_block.39 (result i32) - (drop - (block $compile_set.38 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $11) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.40 (result i32) - (i32.const 3) - ) - ) - ) - (block $compile_block.47 (result i32) - (block $compile_store.43 - (local.set $22 - (i32.or - (i32.shl - (i32.eq - (local.get $20) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.42 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $22) - (i32.const 31) - ) - (block $compile_block.45 (result i32) - (drop - (block $compile_set.44 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.46 (result i32) - (i32.const 3) - ) - ) - ) - ) - (block $cleanup.30 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $12) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.54 (result i32) - (block $compile_store.50 - (local.set $19 - (i32.or - (i32.shl - (i32.eq - (local.get $17) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.49 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $19) - (i32.const 31) - ) - (block $compile_block.52 (result i32) - (drop - (block $compile_set.51 (result i32) - (local.set $8 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - (block $compile_block.53 (result i32) - (i32.const 3) - ) - ) - ) - ) - (block $cleanup.21 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $10) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.56 (result i32) - (i32.const 3) - ) - ) - ) - (block $do_backpatches.57 - ) - ) - (block $cleanup.59 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (block $switch.61_outer (result i32) - (block $switch.61_branch_0 (result i32) - (drop - (block $switch.61_branch_1 (result i32) - (drop - (block $switch.61_branch_2 (result i32) - (drop - (block $switch.61_default (result i32) - (br_table $switch.61_branch_1 $switch.61_branch_2 $switch.61_default $switch.61_default - (i32.const 0) - (i32.shr_s - (local.get $16) - (i32.const 1) - ) - ) - ) - ) - (br $switch.61_outer - (block $compile_block.64 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.61_outer - (block $compile_block.63 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.61_outer - (block $compile_block.62 (result i32) - (i32.const -2) - ) - ) - ) - ) - (block $cleanup.60 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 5 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 0))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 0))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 11) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1140) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot index a84858cc74..f01296df55 100644 --- a/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot @@ -1,127 +1,68 @@ pattern matching › or_match_1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.14 (result i32) - (block $compile_store.2 - (local.set $6 - (i32.or - (i32.shl - (i32.eq - (i32.const -2) - (i32.const 2147483646) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.1 - ) - ) - (block $compile_store.10 - (local.set $7 - (if (result i32) - (i32.shr_u - (local.get $6) - (i32.const 31) - ) - (block $compile_block.3 (result i32) - (i32.const 1) - ) - (block $compile_block.8 (result i32) - (block $compile_store.5 - (local.set $8 - (i32.or - (i32.shl - (i32.eq - (i32.const -2) - (i32.const -2) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.4 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $8) - (i32.const 31) - ) - (block $compile_block.6 (result i32) - (i32.const 1) - ) - (block $compile_block.7 - (unreachable) - ) - ) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $switch.11_outer (result i32) - (block $switch.11_branch_0 (result i32) - (drop - (block $switch.11_branch_1 (result i32) - (drop - (block $switch.11_default (result i32) - (br_table $switch.11_branch_1 $switch.11_default $switch.11_default - (i32.const 0) - (i32.shr_s - (local.get $7) - (i32.const 1) - ) - ) - ) - ) - (br $switch.11_outer - (block $compile_block.13 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.11_outer - (block $compile_block.12 (result i32) - (i32.const 7) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot index d8eaa83cbf..906a675849 100644 --- a/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot @@ -1,325 +1,191 @@ pattern matching › or_match_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"GRAIN$EXPORT$equal\" (global $GRAIN$EXPORT$equal_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/equal.gr\" \"equal\" (func $equal_0 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (block $compile_block.37 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $8 - (i32.load offset=12 - (local.get $6) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $9 - (i32.or - (i32.shl - (i32.eq - (local.get $8) - (i32.const 3) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.30 - (local.set $10 - (if (result i32) - (i32.shr_u - (local.get $9) - (i32.const 31) - ) - (block $compile_block.8 (result i32) - (i32.const 3) - ) - (block $compile_block.28 (result i32) - (block $compile_store.10 - (local.set $11 - (i32.or - (i32.shl - (i32.eq - (local.get $8) - (i32.const 1) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - ) - (block $do_backpatches.9 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $11) - (i32.const 31) - ) - (block $compile_block.26 (result i32) - (block $compile_store.12 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.14 - (local.set $12 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 7) - ) - ) - (block $do_backpatches.13 - ) - ) - (tuple.extract 0 - (tuple.make - (if (result i32) - (i32.shr_u - (local.get $12) - (i32.const 31) - ) - (block $compile_block.16 (result i32) - (i32.const 1) - ) - (block $compile_block.25 (result i32) - (block $compile_store.18 - (local.set $13 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 9) - ) - ) - (block $do_backpatches.17 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $13) - (i32.const 31) - ) - (block $compile_block.19 (result i32) - (i32.const 1) - ) - (block $compile_block.24 (result i32) - (block $compile_store.21 - (local.set $14 - (call $equal_0 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $GRAIN$EXPORT$equal_0) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (i32.const 11) - ) - ) - (block $do_backpatches.20 - ) - ) - (if (result i32) - (i32.shr_u - (local.get $14) - (i32.const 31) - ) - (block $compile_block.22 (result i32) - (i32.const 3) - ) - (block $compile_block.23 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - ) - (block $cleanup.15 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - (block $compile_block.27 (result i32) - (i32.const 5) - ) - ) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $cleanup.31 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (block $switch.32_outer (result i32) - (block $switch.32_branch_0 (result i32) - (drop - (block $switch.32_branch_1 (result i32) - (drop - (block $switch.32_branch_2 (result i32) - (drop - (block $switch.32_branch_3 (result i32) - (drop - (block $switch.32_default (result i32) - (br_table $switch.32_branch_1 $switch.32_branch_2 $switch.32_branch_3 $switch.32_default $switch.32_default - (i32.const 0) - (i32.shr_s - (local.get $10) - (i32.const 1) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.36 (result i32) - (unreachable) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.35 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.34 (result i32) - (i32.const -2) - ) - ) - ) - ) - (br $switch.32_outer - (block $compile_block.33 (result i32) - (i32.const 2147483646) - ) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot b/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot index abec48340f..96f45ca767 100644 --- a/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot +++ b/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot @@ -1,36 +1,18 @@ provides › provide7 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1122 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1122) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((stamp 1122) (name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.10f4f118.0.snapshot b/compiler/test/__snapshots__/provides.10f4f118.0.snapshot index 15e820e4fa..52660b1da3 100644 --- a/compiler/test/__snapshots__/provides.10f4f118.0.snapshot +++ b/compiler/test/__snapshots__/provides.10f4f118.0.snapshot @@ -1,50 +1,36 @@ provides › provide9 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$z\" (global $z_1123 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1122 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $y_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $z_1123) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((stamp 1123) (name z))) (mimp_mod provideAll.gr) (mimp_name z) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind z_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot index ce34cf02ec..cdbb52a1bc 100644 --- a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot +++ b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot @@ -1,45 +1,24 @@ provides › multiple_provides_8 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"GRAIN$EXPORT$bar\" (global $foo_1113)) - (export \"GRAIN$EXPORT$foo\" (global $foo_1113)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.3 (result i32) - (block $compile_store.2 - (global.set $foo_1113 - (i32.const 3) - ) - (block $do_backpatches.1 - ) - ) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1435 -) +((functions ()) (imports ()) + (exports + ((WasmGlobalExport (ex_global_name bar) (ex_global_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1113) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot index 2da57f3f21..e985f358fd 100644 --- a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot +++ b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot @@ -1,213 +1,110 @@ provides › provide_start_function -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1115 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1115 (param i32 i32 i32) (result i32))) - (global $_start_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_start\" (func $_start_1113)) - (export \"GRAIN$EXPORT$_start\" (global $_start_1113)) - (export \"_gmain\" (func $_gmain)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_start_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (local $7 i32) - (local $8 i32) - (block $compile_block.8 - (block $compile_store.3 - (local.set $7 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $1) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $1) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $1) - (i32.const 0) - ) - (local.get $1) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $8 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $1 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $1) - (i32.const 11) - ) - (i64.store offset=8 - (local.get $1) - (i64.const 7453010382200861811) - ) - (i64.store offset=16 - (local.get $1) - (i64.const 7370016) - ) - (local.get $1) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $cleanup.7 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - ) - (return_call $print_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1115) - ) - (local.get $8) - (local.get $7) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.17 (result i32) - (block $compile_store.11 - (local.set $6 - (block $allocate_adt.9 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.14 - (local.set $7 - (block $allocate_string.12 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 1953066601) - ) - (local.get $0) - ) - ) - (block $do_backpatches.13 - ) - ) - (drop - (call $print_1115 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1115) - ) - (local.get $7) - (local.get $6) - ) - ) - (block $compile_store.16 - (global.set $_start_1113 - (i32.const 0) - ) - (block $do_backpatches.15 - ) - ) - (i32.const 1879048190) - ) - ) - ;; custom section \"cmi\", size 1021 -) +((functions + (((id ((stamp 1113) (name _start))) (name (_start)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"starting up\"))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name _start) + (ex_function_internal_name _start_1113)) + (WasmGlobalExport (ex_global_name _start) + (ex_global_internal_name _start_1113)))) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString init))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind _start_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1113) (name _start)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot b/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot index 10189488d5..90bc3f9b83 100644 --- a/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot +++ b/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot @@ -1,186 +1,91 @@ provides › provide12 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$print\" (global $print_1203 (mut i32))) - (import \"GRAIN$MODULE$providedType.gr\" \"GRAIN$EXPORT$apply\" (global $apply_1201 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"print\" (func $print_1203 (param i32 i32 i32) (result i32))) - (import \"GRAIN$MODULE$providedType.gr\" \"apply\" (func $apply_1201 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 1)) - (memory $0 0) - (elem $elem (global.get $relocBase_0) $lam_lambda_1202) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $lam_lambda_1202 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 f32) - (local $7 f64) - (local $8 i32) - (local $9 i32) - (block $closure_elements.17 - (block $compile_block.16 - (block $compile_store.11 - (local.set $8 - (block $allocate_adt.9 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $2) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $2) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $2) - (i32.const 0) - ) - (local.get $2) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.14 - (local.set $9 - (block $allocate_string.12 (result i32) - (i32.store - (local.tee $2 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $2) - (i32.const 2) - ) - (i64.store offset=8 - (local.get $2) - (i64.const 27503) - ) - (local.get $2) - ) - ) - (block $do_backpatches.13 - ) - ) - (block $cleanup.15 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $1) - ) - ) - ) - (return_call $print_1203 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $print_1203) - ) - (local.get $9) - (local.get $8) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.21 - (block $compile_store.20 - (local.set $6 - (block $allocate_closure.18 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 6) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.add - (global.get $relocBase_0) - (i32.const 0) - ) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.19 - (local.set $0 - (local.get $6) - ) - ) - ) - (return_call $apply_1201 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $apply_1201) - ) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 423 -) +((functions + (((id ((stamp 1202) (name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type ((Unmanaged WasmI32))) (closure (0)) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString ok))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1203) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1203 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) + (mimp_name apply) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) + (mimp_name apply) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1207) + (arity 2) (variables ()))))))))))) + ((instr_desc + (MReturnCallKnown (func apply_1201) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind apply_1201 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1202)) + (global_function_table_offset ((stamp 1207) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot b/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot index bb49a490ea..1072c16e27 100644 --- a/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot +++ b/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot @@ -1,68 +1,61 @@ provides › provide8 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$y\" (global $y_1125 (mut i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"GRAIN$EXPORT$x\" (global $x_1123 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1122 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$provideAll.gr\" \"y\" (func $y_1125 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1122 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.3 - (block $compile_store.2 - (local.set $6 - (call $y_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1125) - ) - (i32.const 9) - ) - ) - (block $do_backpatches.1 - ) - ) - (return_call $+_1122 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1122) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $x_1123) - ) - (local.get $6) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 421 -) +((functions ()) + (imports + (((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1123) (name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func y_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1127) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot index 69c76d9996..fe2aff9aac 100644 --- a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot +++ b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot @@ -1,73 +1,41 @@ provides › let_rec_provide -(module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"foo\" (func $foo_1113)) - (export \"GRAIN$EXPORT$foo\" (global $foo_1113)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $foo_1113 (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f32) - (local $6 f64) - (block $compile_block.2 (result i32) - (tuple.extract 0 - (tuple.make - (i32.const 11) - (block $cleanup.1 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $0) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.5 (result i32) - (block $compile_store.4 - (global.set $foo_1113 - (i32.const 0) - ) - (block $do_backpatches.3 - ) - ) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1005 -) +((functions + (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) + (exports + ((WasmFunctionExport (ex_function_name foo) + (ex_function_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1113) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.f378d570.0.snapshot b/compiler/test/__snapshots__/provides.f378d570.0.snapshot index 13ab88e83f..a4baa325b9 100644 --- a/compiler/test/__snapshots__/provides.f378d570.0.snapshot +++ b/compiler/test/__snapshots__/provides.f378d570.0.snapshot @@ -1,36 +1,18 @@ provides › provide4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$onlyXProvided.gr\" \"GRAIN$EXPORT$x\" (global $x_1116 (mut i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (global.get $x_1116) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 424 -) +((functions ()) + (imports + (((mimp_id ((stamp 1116) (name x))) (mimp_mod onlyXProvided.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.012b017b.0.snapshot b/compiler/test/__snapshots__/records.012b017b.0.snapshot index 789b61a653..a41dcea523 100644 --- a/compiler/test/__snapshots__/records.012b017b.0.snapshot +++ b/compiler/test/__snapshots__/records.012b017b.0.snapshot @@ -1,35 +1,13 @@ records › record_spread_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 1879048190) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 562 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1122) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.02742729.0.snapshot b/compiler/test/__snapshots__/records.02742729.0.snapshot index 55c1d7fc9f..55e3515215 100644 --- a/compiler/test/__snapshots__/records.02742729.0.snapshot +++ b/compiler/test/__snapshots__/records.02742729.0.snapshot @@ -1,125 +1,67 @@ records › record_get_multiple -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1118 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1118 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.9 - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 19) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.6 - ) - ) - (block $cleanup.8 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (return_call $+_1118 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1118) - ) - (local.get $7) - (local.get $8) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 562 -) +((functions ()) + (imports + (((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.02af5946.0.snapshot b/compiler/test/__snapshots__/records.02af5946.0.snapshot index e3087d5ed5..43d718a369 100644 --- a/compiler/test/__snapshots__/records.02af5946.0.snapshot +++ b/compiler/test/__snapshots__/records.02af5946.0.snapshot @@ -1,65 +1,19 @@ records › record_definition_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1272 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.2dc39420.0.snapshot b/compiler/test/__snapshots__/records.2dc39420.0.snapshot index 2e4b2a5e8c..aa6a9f9884 100644 --- a/compiler/test/__snapshots__/records.2dc39420.0.snapshot +++ b/compiler/test/__snapshots__/records.2dc39420.0.snapshot @@ -1,65 +1,19 @@ records › record_pun -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1208 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot index beda98bf05..0edcf705e1 100644 --- a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot +++ b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot @@ -1,160 +1,62 @@ records › record_destruct_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.13 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (global.set $foo_1114 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (drop - (block $compile_set.12 (result i32) - (global.set $foo_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $foo_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $foo_1114) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1114) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.54f5977c.0.snapshot b/compiler/test/__snapshots__/records.54f5977c.0.snapshot index 8c1a0c3d55..6e45e65d7d 100644 --- a/compiler/test/__snapshots__/records.54f5977c.0.snapshot +++ b/compiler/test/__snapshots__/records.54f5977c.0.snapshot @@ -1,247 +1,154 @@ records › record_destruct_4 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1126 (param i32 i32 i32) (result i32))) - (global $bar_1115 (mut i32) (i32.const 0)) - (global $foo_1114 (mut i32) (i32.const 0)) - (global $baz_1116 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.22 - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (global.set $foo_1114 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (global.set $bar_1115 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (global.set $baz_1116 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (global.set $baz_1116 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $baz_1116) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (global.set $bar_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $bar_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $foo_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $foo_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $10 - (call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1114) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $bar_1115) - ) - ) - ) - (block $do_backpatches.20 - ) - ) - (return_call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (local.get $10) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $baz_1116) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1115) (name bar)) true Managed ()) + (((stamp 1114) (name foo)) true Managed ()) + (((stamp 1116) (name baz)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.5f340064.0.snapshot b/compiler/test/__snapshots__/records.5f340064.0.snapshot index 0d2e67f599..2afd99faa7 100644 --- a/compiler/test/__snapshots__/records.5f340064.0.snapshot +++ b/compiler/test/__snapshots__/records.5f340064.0.snapshot @@ -1,65 +1,19 @@ records › record_value_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1252 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.60c0a141.0.snapshot b/compiler/test/__snapshots__/records.60c0a141.0.snapshot index 7c405aa26b..fd68454ca5 100644 --- a/compiler/test/__snapshots__/records.60c0a141.0.snapshot +++ b/compiler/test/__snapshots__/records.60c0a141.0.snapshot @@ -1,316 +1,113 @@ records › record_recursive_data_definition -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (block $compile_block.24 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 610197211) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_record.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $12 - (block $record_set.16 (result i32) - (i32.store offset=16 - (local.get $7) - (tuple.extract 0 - (tuple.make - (local.get $10) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.21 - (local.set $11 - (block $allocate_adt.19 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 501102191) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=20 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.20 - ) - ) - (tuple.extract 0 - (tuple.make - (block $record_set.23 (result i32) - (i32.store offset=16 - (local.get $9) - (tuple.extract 0 - (tuple.make - (local.get $11) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (i32.load offset=16 - (local.get $9) - ) - ) - ) - ) - ) - (i32.const 1879048190) - ) - (block $cleanup.22 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $9) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 606 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MRecordOp + (MRecordSet 0 + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp + (MRecordSet 0 + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.60c7acc4.0.snapshot b/compiler/test/__snapshots__/records.60c7acc4.0.snapshot index 2652845e5b..c42524f498 100644 --- a/compiler/test/__snapshots__/records.60c7acc4.0.snapshot +++ b/compiler/test/__snapshots__/records.60c7acc4.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_mixed_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1702 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.63a951b8.0.snapshot b/compiler/test/__snapshots__/records.63a951b8.0.snapshot index b55a5d8210..641f2c1f96 100644 --- a/compiler/test/__snapshots__/records.63a951b8.0.snapshot +++ b/compiler/test/__snapshots__/records.63a951b8.0.snapshot @@ -1,160 +1,62 @@ records › record_destruct_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $bar_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.13 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (global.set $bar_1114 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (drop - (block $compile_set.12 (result i32) - (global.set $bar_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $bar_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $bar_1114) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind bar_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind bar_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1114) (name bar)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.89d08e01.0.snapshot b/compiler/test/__snapshots__/records.89d08e01.0.snapshot index 6d79ebb27f..2da4610018 100644 --- a/compiler/test/__snapshots__/records.89d08e01.0.snapshot +++ b/compiler/test/__snapshots__/records.89d08e01.0.snapshot @@ -1,65 +1,19 @@ records › record_pun_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1244 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.98824516.0.snapshot b/compiler/test/__snapshots__/records.98824516.0.snapshot index b5995c0442..7cffabb691 100644 --- a/compiler/test/__snapshots__/records.98824516.0.snapshot +++ b/compiler/test/__snapshots__/records.98824516.0.snapshot @@ -1,181 +1,77 @@ records › record_destruct_deep -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $foo_1115 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.16 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 610197211) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (global.set $foo_1115 - (i32.const 0) - ) - (block $do_backpatches.7 - ) - ) - (block $compile_store.10 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.9 - ) - ) - (block $cleanup.11 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (block $compile_store.13 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $8) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $cleanup.14 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (drop - (block $compile_set.15 (result i32) - (global.set $foo_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $foo_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $foo_1115) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 606 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ((((stamp 1115) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot index 5fd798c84c..cd12ed6375 100644 --- a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot +++ b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot @@ -1,189 +1,109 @@ records › record_destruct_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1125 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1125 (param i32 i32 i32) (result i32))) - (global $bar_1115 (mut i32) (i32.const 0)) - (global $foo_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.15 - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (global.set $foo_1114 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (global.set $bar_1115 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $cleanup.12 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.13 (result i32) - (global.set $bar_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $bar_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.14 (result i32) - (global.set $foo_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $foo_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (return_call $+_1125 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1125) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1114) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $bar_1115) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1115) (name bar)) true Managed ()) + (((stamp 1114) (name foo)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1126) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.a702778a.0.snapshot b/compiler/test/__snapshots__/records.a702778a.0.snapshot index 2da4a3d91b..ecbb85b4d2 100644 --- a/compiler/test/__snapshots__/records.a702778a.0.snapshot +++ b/compiler/test/__snapshots__/records.a702778a.0.snapshot @@ -1,155 +1,57 @@ records › record_get_multilevel -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 19) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1956346849) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2229) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.8 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $7) - ) - ) - ) - (block $do_backpatches.7 - ) - ) - (block $cleanup.9 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - ) - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $8) - ) - ) - (block $cleanup.10 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 682 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 978173424))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((baz) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1122) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.a9c472b1.0.snapshot b/compiler/test/__snapshots__/records.a9c472b1.0.snapshot index 4cc32e7113..f04e315e84 100644 --- a/compiler/test/__snapshots__/records.a9c472b1.0.snapshot +++ b/compiler/test/__snapshots__/records.a9c472b1.0.snapshot @@ -1,100 +1,28 @@ records › record_multiple_fields_definition_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 2279 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.b50d234d.0.snapshot b/compiler/test/__snapshots__/records.b50d234d.0.snapshot index debc2f64ea..58a84fd0cd 100644 --- a/compiler/test/__snapshots__/records.b50d234d.0.snapshot +++ b/compiler/test/__snapshots__/records.b50d234d.0.snapshot @@ -1,95 +1,30 @@ records › record_get_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - (block $cleanup.4 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 486 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.d34c4740.0.snapshot b/compiler/test/__snapshots__/records.d34c4740.0.snapshot index 1dbe4be57c..c4fcda791e 100644 --- a/compiler/test/__snapshots__/records.d34c4740.0.snapshot +++ b/compiler/test/__snapshots__/records.d34c4740.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_mixed -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1648 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.d393173c.0.snapshot b/compiler/test/__snapshots__/records.d393173c.0.snapshot index 983becb252..8b29b9c97c 100644 --- a/compiler/test/__snapshots__/records.d393173c.0.snapshot +++ b/compiler/test/__snapshots__/records.d393173c.0.snapshot @@ -1,247 +1,154 @@ records › record_destruct_trailing -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$+\" (global $+_1126 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"+\" (func $+_1126 (param i32 i32 i32) (result i32))) - (global $bar_1115 (mut i32) (i32.const 0)) - (global $foo_1114 (mut i32) (i32.const 0)) - (global $baz_1116 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.22 - (block $compile_store.3 - (local.set $6 - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (global.set $foo_1114 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (global.set $bar_1115 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (global.set $baz_1116 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=24 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (global.set $baz_1116 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $baz_1116) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (global.set $bar_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $bar_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $foo_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $foo_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.21 - (local.set $10 - (call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $foo_1114) - ) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $bar_1115) - ) - ) - ) - (block $do_backpatches.20 - ) - ) - (return_call $+_1126 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $+_1126) - ) - (local.get $10) - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $baz_1116) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1115) (name bar)) true Managed ()) + (((stamp 1114) (name foo)) true Managed ()) + (((stamp 1116) (name baz)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.d44e8007.0.snapshot b/compiler/test/__snapshots__/records.d44e8007.0.snapshot index e58a07ab56..a046d5547b 100644 --- a/compiler/test/__snapshots__/records.d44e8007.0.snapshot +++ b/compiler/test/__snapshots__/records.d44e8007.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_mixed_2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1660 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.e4326567.0.snapshot b/compiler/test/__snapshots__/records.e4326567.0.snapshot index edabd34e98..a3733108ba 100644 --- a/compiler/test/__snapshots__/records.e4326567.0.snapshot +++ b/compiler/test/__snapshots__/records.e4326567.0.snapshot @@ -1,100 +1,28 @@ records › record_multiple_fields_both_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 2231 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.e5b56da8.0.snapshot b/compiler/test/__snapshots__/records.e5b56da8.0.snapshot index 312fe16b26..5e2e536e25 100644 --- a/compiler/test/__snapshots__/records.e5b56da8.0.snapshot +++ b/compiler/test/__snapshots__/records.e5b56da8.0.snapshot @@ -1,65 +1,19 @@ records › record_both_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1047233621) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1248 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.e705a980.0.snapshot b/compiler/test/__snapshots__/records.e705a980.0.snapshot index 932be85286..b80468e2b4 100644 --- a/compiler/test/__snapshots__/records.e705a980.0.snapshot +++ b/compiler/test/__snapshots__/records.e705a980.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_multiple -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1666 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot b/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot index 8a6e10a22d..28930fb9c8 100644 --- a/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot +++ b/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_multiple_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1720 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.f6feee77.0.snapshot b/compiler/test/__snapshots__/records.f6feee77.0.snapshot index ed098ed639..41d4a77fa1 100644 --- a/compiler/test/__snapshots__/records.f6feee77.0.snapshot +++ b/compiler/test/__snapshots__/records.f6feee77.0.snapshot @@ -1,100 +1,28 @@ records › record_multiple_fields_value_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block $compile_block.5 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 2239 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.fae50a8e.0.snapshot b/compiler/test/__snapshots__/records.fae50a8e.0.snapshot index 05099a271f..be2a3b2612 100644 --- a/compiler/test/__snapshots__/records.fae50a8e.0.snapshot +++ b/compiler/test/__snapshots__/records.fae50a8e.0.snapshot @@ -1,69 +1,22 @@ records › record_pun_mixed_2_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_record.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 447924047) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 1714 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot b/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot index 66b90f4c43..79a0d13d2e 100644 --- a/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot @@ -1,48 +1,34 @@ stdlib › stdlib_equal_4 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const 3) - (i32.const 3) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot b/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot index cedd34bb2a..e7edb71705 100644 --- a/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot @@ -1,190 +1,78 @@ stdlib › stdlib_equal_20 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.13 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_string.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7496034) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_record.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $8) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (return_call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (local.get $7) - (local.get $9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot b/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot index ec38f730b4..27720634b2 100644 --- a/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot @@ -1,104 +1,42 @@ stdlib › stdlib_equal_18 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 8) - ) - (i64.store offset=8 - (local.get $0) - (i64.const -9036296798633758874) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 8) - ) - (i64.store offset=8 - (local.get $0) - (i64.const -8891900135581192346) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\153\\132\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot b/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot index 09a369e7e7..ee9e992bc4 100644 --- a/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot @@ -1,130 +1,41 @@ stdlib › stdlib_equal_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.8 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (tuple.extract 0 - (tuple.make - (i32.or - (i32.shl - (i32.eq - (local.get $6) - (local.get $7) - ) - (i32.const 31) - ) - (i32.const 2147483646) - ) - (block $cleanup.7 (result i32) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $7) - ) - ) - (i32.const 1879048190) - ) - ) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot b/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot index 2581e25af8..44360685d2 100644 --- a/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot @@ -1,194 +1,67 @@ stdlib › stdlib_cons -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $compile_block.11 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot b/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot index f83220a0c8..582805e948 100644 --- a/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot @@ -1,190 +1,78 @@ stdlib › stdlib_equal_19 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.13 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_string.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_record.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $8) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (return_call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (local.get $7) - (local.get $9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot b/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot index 9c9c5dea1e..a6fff39564 100644 --- a/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot @@ -1,104 +1,40 @@ stdlib › stdlib_equal_16 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot b/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot index 44eb181a1a..0d4eee214c 100644 --- a/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot @@ -1,128 +1,62 @@ stdlib › stdlib_equal_12 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_array.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot b/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot index 51ead1b95c..605435af2c 100644 --- a/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot @@ -1,190 +1,78 @@ stdlib › stdlib_equal_21 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.13 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_string.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_record.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 157) - ) - (i32.store offset=20 - (local.get $0) - (local.get $8) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (return_call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (local.get $7) - (local.get $9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 78))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot b/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot index 9fc3d8c016..b741f8f2e9 100644 --- a/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot @@ -1,100 +1,40 @@ stdlib › stdlib_equal_15 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 102) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString f))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot b/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot index d157d5d81b..333745feda 100644 --- a/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot @@ -1,100 +1,40 @@ stdlib › stdlib_equal_14 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 32) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \" \"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot b/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot index cccebc51b1..51672f1b24 100644 --- a/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot @@ -1,378 +1,156 @@ stdlib › stdlib_equal_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $compile_block.25 - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.21 - (local.set $12 - (block $allocate_adt.19 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.24 - (local.set $13 - (block $allocate_adt.22 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $12) - ) - (local.get $0) - ) - ) - (block $do_backpatches.23 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $9) - (local.get $13) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot b/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot index cdbdfc76a7..7ec08b696f 100644 --- a/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot @@ -1,108 +1,52 @@ stdlib › stdlib_equal_11 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_array.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot b/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot index a11b7ab880..d7fc4a4c0a 100644 --- a/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot @@ -1,100 +1,45 @@ stdlib › stdlib_equal_9 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_array.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot b/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot index 3ccae1ee78..c5e0ea0948 100644 --- a/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot @@ -1,112 +1,54 @@ stdlib › stdlib_equal_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot b/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot index 90c01a2a84..d25adafe25 100644 --- a/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot @@ -1,48 +1,35 @@ stdlib › stdlib_equal_6 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const -2) - (i32.const -2) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot b/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot index eacd026e89..19fdb44b4e 100644 --- a/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot @@ -1,190 +1,79 @@ stdlib › stdlib_equal_22 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1114 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1114 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.13 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_record.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $6) - ) - (i32.store offset=24 - (local.get $0) - (i32.const -2) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_string.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303010) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_record.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 3) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 656589387) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 2227) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=20 - (local.get $0) - (local.get $8) - ) - (i32.store offset=24 - (local.get $0) - (i32.const 2147483646) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (return_call $==_1114 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1114) - ) - (local.get $7) - (local.get $9) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 643 -) +((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot b/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot index 3f42a7ba6b..20aff68260 100644 --- a/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot @@ -1,104 +1,50 @@ stdlib › stdlib_equal_10 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_array.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 12) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot b/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot index 7791c712be..58015d2329 100644 --- a/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot @@ -1,96 +1,40 @@ stdlib › stdlib_equal_13 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot b/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot index 4b35e05810..ea2c8cb84d 100644 --- a/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot @@ -1,48 +1,35 @@ stdlib › stdlib_equal_7 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const -2) - (i32.const 2147483646) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot b/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot index 182200a619..d78f70b6b7 100644 --- a/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot @@ -1,48 +1,34 @@ stdlib › stdlib_equal_5 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (i32.const 3) - (i32.const 5) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot b/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot index b78f955ff5..fe63af8b7a 100644 --- a/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot @@ -1,96 +1,40 @@ stdlib › stdlib_equal_8 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_array.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_array.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 8) - ) - ) - (i32.const 4) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot b/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot index 106abb6422..d5a8278368 100644 --- a/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot @@ -1,104 +1,42 @@ stdlib › stdlib_equal_17 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$==\" (global $==_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"==\" (func $==_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 8) - ) - (i64.store offset=8 - (local.get $0) - (i64.const -9036296798633758874) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 8) - ) - (i64.store offset=8 - (local.get $0) - (i64.const -9036296798633758874) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $==_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $==_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/strings.434adad0.0.snapshot b/compiler/test/__snapshots__/strings.434adad0.0.snapshot index 7cd70f8531..48ae295184 100644 --- a/compiler/test/__snapshots__/strings.434adad0.0.snapshot +++ b/compiler/test/__snapshots__/strings.434adad0.0.snapshot @@ -1,57 +1,9 @@ strings › string2 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 2945622000) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString \"\\240\\159\\146\\175\")))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/strings.a67428df.0.snapshot b/compiler/test/__snapshots__/strings.a67428df.0.snapshot index efb0c5357d..a2edd33aaf 100644 --- a/compiler/test/__snapshots__/strings.a67428df.0.snapshot +++ b/compiler/test/__snapshots__/strings.a67428df.0.snapshot @@ -1,57 +1,9 @@ strings › string1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot b/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot index 40504cc52d..faa092d407 100644 --- a/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot +++ b/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot @@ -1,73 +1,10 @@ strings › string3 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 48) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 36) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7863398673301594477) - ) - (i64.store offset=16 - (local.get $0) - (i64.const 8026576141579395193) - ) - (i64.store offset=24 - (local.get $0) - (i64.const 2318349367439027831) - ) - (i64.store offset=32 - (local.get $0) - (i64.const 2334956330867777911) - ) - (i64.store offset=40 - (local.get $0) - (i64.const 1953718630) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc (MAllocate (MString \"making my way downtown, walking fast\")))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/strings.fb85549f.0.snapshot b/compiler/test/__snapshots__/strings.fb85549f.0.snapshot index 53992937e5..5fa56d7720 100644 --- a/compiler/test/__snapshots__/strings.fb85549f.0.snapshot +++ b/compiler/test/__snapshots__/strings.fb85549f.0.snapshot @@ -1,104 +1,40 @@ strings › concat -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"GRAIN$EXPORT$++\" (global $++_1113 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$pervasives.gr\" \"++\" (func $++_1113 (param i32 i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (block $compile_block.7 - (block $compile_store.3 - (local.set $6 - (block $allocate_string.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7303014) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_string.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 1) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i64.store offset=8 - (local.get $0) - (i64.const 7496034) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (return_call $++_1113 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $++_1113) - ) - (local.get $6) - (local.get $7) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) + (mimp_name ++) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) + (mimp_name ++) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MReturnCallKnown (func ++_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ++_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot index a614ea7825..8f9686480c 100644 --- a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot @@ -1,322 +1,154 @@ tuples › nested_tup_3 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $b_1116 (mut i32) (i32.const 0)) - (global $a_1115 (mut i32) (i32.const 0)) - (global $y_1114 (mut i32) (i32.const 0)) - (global $x_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $compile_block.34 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_tuple.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (local.get $6) - ) - (i32.store offset=12 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (global.set $x_1113 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (global.set $y_1114 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $8) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $8) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $cleanup.18 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $y_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $y_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.20 (result i32) - (global.set $x_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $x_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.22 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $y_1114) - ) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (global.set $a_1115 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (global.set $b_1116 - (i32.const 0) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $11) - ) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $11) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $cleanup.31 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (drop - (block $compile_set.32 (result i32) - (global.set $b_1116 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1116) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.33 (result i32) - (global.set $a_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $a_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $a_1115) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind y_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind y_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind b_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind a_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind a_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1116) (name b)) true Managed ()) + (((stamp 1115) (name a)) true Managed ()) + (((stamp 1114) (name y)) true Managed ()) + (((stamp 1113) (name x)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot index 5119175418..8b89cd8147 100644 --- a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot @@ -1,223 +1,94 @@ tuples › nested_tup_1 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $b_1114 (mut i32) (i32.const 0)) - (global $a_1113 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.21 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_tuple.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (local.get $6) - ) - (i32.store offset=12 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (global.set $a_1113 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (global.set $b_1114 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $8) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $8) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $cleanup.18 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $b_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.20 (result i32) - (global.set $a_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $a_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $a_1113) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind a_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1114) (name b)) true Managed ()) + (((stamp 1113) (name a)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot index 2de95ddb65..f892a79217 100644 --- a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot +++ b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot @@ -1,205 +1,99 @@ tuples › tup1_destruct_trailing -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $a_1113 (mut i32) (i32.const 0)) - (global $c_1115 (mut i32) (i32.const 0)) - (global $b_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $compile_block.20 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (global.set $a_1113 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (global.set $b_1114 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (global.set $c_1115 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $cleanup.16 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.17 (result i32) - (global.set $c_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $c_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.18 (result i32) - (global.set $b_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $a_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $a_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (i32.const 1) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1113) (name a)) true Managed ()) + (((stamp 1115) (name c)) true Managed ()) + (((stamp 1114) (name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot b/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot index 93890627ef..899941523c 100644 --- a/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot +++ b/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot @@ -1,65 +1,18 @@ tuples › tup1_trailing -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot index fa6830fdae..0357ba126f 100644 --- a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot +++ b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot @@ -1,249 +1,124 @@ tuples › big_tup_access -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $a_1113 (mut i32) (i32.const 0)) - (global $d_1116 (mut i32) (i32.const 0)) - (global $c_1115 (mut i32) (i32.const 0)) - (global $b_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (block $compile_block.25 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 24) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 4) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.5 - (global.set $a_1113 - (i32.const 0) - ) - (block $do_backpatches.4 - ) - ) - (block $compile_store.7 - (global.set $b_1114 - (i32.const 0) - ) - (block $do_backpatches.6 - ) - ) - (block $compile_store.9 - (global.set $c_1115 - (i32.const 0) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (global.set $d_1116 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (local.set $7 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $6) - ) - ) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $8 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $6) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=16 - (local.get $6) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $compile_store.19 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=20 - (local.get $6) - ) - ) - ) - (block $do_backpatches.18 - ) - ) - (block $cleanup.20 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $6) - ) - ) - ) - (drop - (block $compile_set.21 (result i32) - (global.set $d_1116 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $d_1116) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.22 (result i32) - (global.set $c_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $c_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.23 (result i32) - (global.set $b_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $8) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.24 (result i32) - (global.set $a_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $7) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $a_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $c_1115) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 3) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind c_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1113) (name a)) true Managed ()) + (((stamp 1116) (name d)) true Managed ()) + (((stamp 1115) (name c)) true Managed ()) + (((stamp 1114) (name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1127) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot b/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot index 332d91f8ed..77a9daad7c 100644 --- a/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot +++ b/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot @@ -1,35 +1,13 @@ tuples › no_non_trailing_comma_singleton_tup -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.1 (result i32) - (i32.const 3) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot index 29f8fc8d68..9ab54346ac 100644 --- a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot +++ b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot @@ -1,322 +1,154 @@ tuples › nested_tup_2 -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32))) - (global $a_1113 (mut i32) (i32.const 0)) - (global $d_1116 (mut i32) (i32.const 0)) - (global $c_1115 (mut i32) (i32.const 0)) - (global $b_1114 (mut i32) (i32.const 0)) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $compile_block.34 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_tuple.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_tuple.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 16) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=8 - (local.get $0) - (local.get $6) - ) - (i32.store offset=12 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.11 - (global.set $a_1113 - (i32.const 0) - ) - (block $do_backpatches.10 - ) - ) - (block $compile_store.13 - (global.set $b_1114 - (i32.const 0) - ) - (block $do_backpatches.12 - ) - ) - (block $compile_store.15 - (local.set $9 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $8) - ) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.17 - (local.set $10 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $8) - ) - ) - ) - (block $do_backpatches.16 - ) - ) - (block $cleanup.18 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $8) - ) - ) - ) - (drop - (block $compile_set.19 (result i32) - (global.set $b_1114 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $10) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $b_1114) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.20 (result i32) - (global.set $a_1113 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $9) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $a_1113) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (block $compile_store.22 - (local.set $11 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (global.get $b_1114) - ) - ) - (block $do_backpatches.21 - ) - ) - (block $compile_store.24 - (global.set $c_1115 - (i32.const 0) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.26 - (global.set $d_1116 - (i32.const 0) - ) - (block $do_backpatches.25 - ) - ) - (block $compile_store.28 - (local.set $12 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=8 - (local.get $11) - ) - ) - ) - (block $do_backpatches.27 - ) - ) - (block $compile_store.30 - (local.set $13 - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (i32.load offset=12 - (local.get $11) - ) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $cleanup.31 - (drop - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (local.get $11) - ) - ) - ) - (drop - (block $compile_set.32 (result i32) - (global.set $d_1116 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $13) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $d_1116) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (drop - (block $compile_set.33 (result i32) - (global.set $c_1115 - (tuple.extract 0 - (tuple.make - (call $incRef_0 - (global.get $GRAIN$EXPORT$incRef_0) - (local.get $12) - ) - (call $decRef_0 - (global.get $GRAIN$EXPORT$decRef_0) - (global.get $c_1115) - ) - ) - ) - ) - (i32.const 1879048190) - ) - ) - (global.get $d_1116) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind d_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + ((((stamp 1113) (name a)) true Managed ()) + (((stamp 1116) (name d)) true Managed ()) + (((stamp 1115) (name c)) true Managed ()) + (((stamp 1114) (name b)) true Managed ()))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.f206002b.0.snapshot b/compiler/test/__snapshots__/tuples.f206002b.0.snapshot index 714f171f66..d9909a8ac1 100644 --- a/compiler/test/__snapshots__/tuples.f206002b.0.snapshot +++ b/compiler/test/__snapshots__/tuples.f206002b.0.snapshot @@ -1,65 +1,18 @@ tuples › tup1_trailing_space -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (block $compile_block.2 (result i32) - (block $allocate_tuple.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 7) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 7) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (signature ) (type_metadata )) From 2dc666bfbb4f844e4328b74c1edce4497e22ae05 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 4 May 2024 08:19:06 -0500 Subject: [PATCH 03/20] disable locations in snapshots --- compiler/test/runner.re | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/test/runner.re b/compiler/test/runner.re index 2a985fdbeb..9c3a2ea075 100644 --- a/compiler/test/runner.re +++ b/compiler/test/runner.re @@ -221,6 +221,7 @@ let makeSnapshotRunner = (~config_fn=?, test, ~module_header=module_header, name, prog) => { test(name, ({expect}) => { Config.preserve_all_configs(() => { + Config.sexp_locs_enabled := false; ignore @@ compile( ~hook=stop_after_object_emitted, @@ -249,6 +250,7 @@ let makeFilesizeRunner = let makeSnapshotFileRunner = (test, ~config_fn=?, name, filename) => { test(name, ({expect}) => { Config.preserve_all_configs(() => { + Config.sexp_locs_enabled := false; let infile = grainfile(filename); let outfile = wasmfile(name); ignore @@ From 7c942a2e1d89f5b8fafb520b8c6b3a25b3d72098 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 4 May 2024 11:15:32 -0500 Subject: [PATCH 04/20] reset idents on every compile --- compiler/src/compile.re | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/compile.re b/compiler/src/compile.re index 161539d917..7a314f459d 100644 --- a/compiler/src/compile.re +++ b/compiler/src/compile.re @@ -308,6 +308,7 @@ let compile_string = if (is_root_file) { Grain_utils.Config.set_root_config(); }; + Ident.setup(); let cstate = { cstate_desc: Initial(InputString(str)), cstate_filename: name, @@ -328,6 +329,7 @@ let compile_file = if (is_root_file) { Grain_utils.Config.set_root_config(); }; + Ident.setup(); let cstate = { cstate_desc: Initial(InputFile(filename)), cstate_filename: Some(filename), From 072208d38586f3be60524dd7271aa81ef70330bc Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 4 May 2024 11:22:23 -0500 Subject: [PATCH 05/20] format --- compiler/src/dune | 14 +++----------- compiler/src/utils/dune | 11 ++--------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/compiler/src/dune b/compiler/src/dune index 16ddbcf1c1..38f06d2015 100644 --- a/compiler/src/dune +++ b/compiler/src/dune @@ -1,17 +1,9 @@ (library (name grain) (public_name grain) - (libraries - cmdliner - compiler-libs.common - grain_codegen - grain_middle_end - grain_parsing - grain_typed - grain_utils - grain_diagnostics - ppx_sexp_conv.runtime-lib - sexplib) + (libraries cmdliner compiler-libs.common grain_codegen grain_middle_end + grain_parsing grain_typed grain_utils grain_diagnostics + ppx_sexp_conv.runtime-lib sexplib) (preprocess (pps ppx_sexp_conv))) diff --git a/compiler/src/utils/dune b/compiler/src/utils/dune index a459fc1651..dbd0cfbb82 100644 --- a/compiler/src/utils/dune +++ b/compiler/src/utils/dune @@ -2,15 +2,8 @@ (name grain_utils) (public_name grain_utils) (synopsis "Utilities for the Grain compiler") - (libraries - fp - fs.lib - cmdliner - compiler-libs.common - ppx_sexp_conv.runtime-lib - sexplib - str - dune-build-info) + (libraries fp fs.lib cmdliner compiler-libs.common ppx_sexp_conv.runtime-lib + sexplib str dune-build-info) (preprocess (pps ppx_sexp_conv sedlex.ppx)) (js_of_ocaml From 94452f3a7281327c5e3f3139f2f0ae46dc3f08f0 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Mon, 6 May 2024 21:55:36 -0500 Subject: [PATCH 06/20] don't compile warning tests past typed well formed --- compiler/test/runner.re | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/test/runner.re b/compiler/test/runner.re index 9c3a2ea075..c52fbc9a53 100644 --- a/compiler/test/runner.re +++ b/compiler/test/runner.re @@ -289,7 +289,8 @@ let makeWarningRunner = test(name, ({expect}) => { Config.preserve_all_configs(() => { Config.print_warnings := false; - ignore @@ compile(name, module_header ++ prog); + ignore @@ + compile(~hook=stop_after_typed_well_formed, name, module_header ++ prog); expect.ext.warning.toHaveTriggered(warning); }) }); @@ -299,7 +300,8 @@ let makeNoWarningRunner = (test, ~module_header=module_header, name, prog) => { test(name, ({expect}) => { Config.preserve_all_configs(() => { Config.print_warnings := false; - ignore @@ compile(name, module_header ++ prog); + ignore @@ + compile(~hook=stop_after_typed_well_formed, name, module_header ++ prog); expect.ext.warning.toHaveTriggeredNoWarnings(); }) }); From b47815e8f9a4190bb001a2dc0827f946b70ed0f5 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Mon, 6 May 2024 22:33:59 -0500 Subject: [PATCH 07/20] convert nan test to runnable --- .../basic_functionality.4d1501b9.0.snapshot | 9 --------- compiler/test/suites/basic_functionality.re | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot diff --git a/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot deleted file mode 100644 index 18109681c8..0000000000 --- a/compiler/test/__snapshots__/basic_functionality.4d1501b9.0.snapshot +++ /dev/null @@ -1,9 +0,0 @@ -basic functionality › nan -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 9221120237041090560)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/suites/basic_functionality.re b/compiler/test/suites/basic_functionality.re index 3e2f96199a..f774f87473 100644 --- a/compiler/test/suites/basic_functionality.re +++ b/compiler/test/suites/basic_functionality.re @@ -48,7 +48,7 @@ describe("basic functionality", ({test, testSkip}) => { assertSnapshot("infinity_neg", "let x = -Infinity; x"); assertRun("infinity_neg_2", "assert -Infinity == -1.0 / 0.0", ""); assertRun("infinity_neg_3", "assert -Infinity == -Infinity", ""); - assertSnapshot("nan", "let x = NaN; x"); + assertRun("nan", "print(NaN)", "NaN\n"); assertRun("nan_2", "assert NaN != NaN", ""); assertSnapshot("print_line_ending1", "print(1, suffix=\"\")"); From 06ff105a1734a646044e15a619630f89fc564a0d Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sun, 22 Sep 2024 09:25:03 -0500 Subject: [PATCH 08/20] Update smallest program size --- compiler/test/suites/basic_functionality.re | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/test/suites/basic_functionality.re b/compiler/test/suites/basic_functionality.re index f774f87473..e29f856d99 100644 --- a/compiler/test/suites/basic_functionality.re +++ b/compiler/test/suites/basic_functionality.re @@ -377,6 +377,6 @@ describe("basic functionality", ({test, testSkip}) => { ~config_fn=smallestFileConfig, "smallest_grain_program", "", - 6424, + 6829, ); }); From 165f2556cc5f7b3508b097384c27a3b43a6e8f54 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sun, 22 Sep 2024 09:37:43 -0500 Subject: [PATCH 09/20] make mash globals a record --- compiler/src/codegen/compcore.re | 9 +++++---- compiler/src/codegen/linkedtree.re | 19 ++++++++++--------- compiler/src/codegen/mashtree.re | 9 ++++++++- compiler/src/codegen/transl_anf.re | 6 +++++- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index e3ad70bc29..c7bcd7c7bb 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -3200,18 +3200,19 @@ let compile_globals = (wasm_mod, env, {globals}) => { | Types.Unmanaged(WasmF32) => const_float32(0.) | Types.Unmanaged(WasmF64) => const_float64(0.); List.iter( - ((id, mut, ty, initial)) => { + ({id, mutable_, allocation_type, initial_value: initial}) => { let name = linked_name(~env, Ident.unique_name(id)); ignore @@ Global.add_global( wasm_mod, name, - wasm_type(ty), - mut, + wasm_type(allocation_type), + mutable_, switch (initial) { | Some(initial) => Expression.Const.make(wasm_mod, compile_const(initial)) - | None => Expression.Const.make(wasm_mod, initial_value(ty)) + | None => + Expression.Const.make(wasm_mod, initial_value(allocation_type)) }, ); }, diff --git a/compiler/src/codegen/linkedtree.re b/compiler/src/codegen/linkedtree.re index b80b6b6174..a7da4581dd 100644 --- a/compiler/src/codegen/linkedtree.re +++ b/compiler/src/codegen/linkedtree.re @@ -74,16 +74,17 @@ let link = main_mashtree => { let dep_id = ref(0); let process_mashtree = (~main, dep, tree) => { - let table_offset_global = ( - tree.global_function_table_offset, - false, - Types.Unmanaged(WasmI32), - Some( - MConstLiteral( - MConstI32(Int32.of_int(num_function_table_elements^)), + let table_offset_global = { + id: tree.global_function_table_offset, + mutable_: false, + allocation_type: Types.Unmanaged(WasmI32), + initial_value: + Some( + MConstLiteral( + MConstI32(Int32.of_int(num_function_table_elements^)), + ), ), - ), - ); + }; let globals = [table_offset_global, ...tree.globals]; diff --git a/compiler/src/codegen/mashtree.re b/compiler/src/codegen/mashtree.re index 6c73c8f09b..c3b849a635 100644 --- a/compiler/src/codegen/mashtree.re +++ b/compiler/src/codegen/mashtree.re @@ -556,7 +556,7 @@ type mash_program = { exports: list(export), main_body: block, main_body_stack_size: stack_size, - globals: list((Ident.t, bool, Types.allocation_type, option(constant))), + globals: list(mash_global), function_table_elements: list(string), global_function_table_offset: Ident.t, compilation_mode: Grain_utils.Config.compilation_mode, @@ -564,6 +564,13 @@ type mash_program = { type_metadata: [@sexp.opaque] list(Types.type_metadata), [@sexp_drop_if sexp_locs_disabled] prog_loc: Location.t, +} + +and mash_global = { + id: Ident.t, + mutable_: bool, + allocation_type: Types.allocation_type, + initial_value: option(constant), }; let const_true = MConstLiteral(MConstI32(Int32.of_int(0xFFFFFFFE))); diff --git a/compiler/src/codegen/transl_anf.re b/compiler/src/codegen/transl_anf.re index d335fe4205..b4bb24de21 100644 --- a/compiler/src/codegen/transl_anf.re +++ b/compiler/src/codegen/transl_anf.re @@ -85,7 +85,11 @@ let global_table = ref(Ident.empty: Ident.tbl(Types.allocation_type)); let get_globals = () => { Ident.fold_all( - (id, ty, acc) => [(id, true, ty, None), ...acc], + (id, ty, acc) => + [ + {id, mutable_: true, allocation_type: ty, initial_value: None}, + ...acc, + ], global_table^, [], ); From 5f84500f4071439ce2cb343ab9c598e31602f566 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Mon, 23 Sep 2024 09:22:53 -0500 Subject: [PATCH 10/20] consistent use of grain_start --- compiler/src/codegen/compcore.re | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index c7bcd7c7bb..be75ef0a64 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -3274,13 +3274,13 @@ let compile_main = (wasm_mod, env, prog) => { Type.none, Type.none, [||], - Expression.Block.make(wasm_mod, "_start", starts), + Expression.Block.make(wasm_mod, grain_start, starts), ); if (Grain_utils.Config.use_start_section^) { Function.set_start(wasm_mod, start); } else { ignore @@ - Export.add_function_export(wasm_mod, "_start", Comp_utils.grain_start); + Export.add_function_export(wasm_mod, grain_start, Comp_utils.grain_start); }; }; From 4d32c89b9726150fbb976c80777f5fc9873e3512 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Mon, 23 Sep 2024 09:31:52 -0500 Subject: [PATCH 11/20] snapshots --- .../test/__snapshots__/arrays.0f9e7d37.0.snapshot | 5 ++++- .../test/__snapshots__/arrays.28fcc534.0.snapshot | 5 ++++- .../test/__snapshots__/arrays.4c8c9f91.0.snapshot | 5 ++++- .../test/__snapshots__/arrays.6eac4e1f.0.snapshot | 5 ++++- .../test/__snapshots__/arrays.74d79181.0.snapshot | 5 ++++- .../basic_functionality.00bcbc39.0.snapshot | 5 ++++- .../basic_functionality.06bd2a80.0.snapshot | 5 ++++- .../basic_functionality.52ca8e0e.0.snapshot | 6 +++++- .../basic_functionality.593b8d63.0.snapshot | 5 ++++- .../basic_functionality.61c58118.0.snapshot | 5 ++++- .../basic_functionality.626b2e44.0.snapshot | 5 ++++- .../basic_functionality.711a4824.0.snapshot | 5 ++++- .../basic_functionality.7599b5a6.0.snapshot | 5 ++++- .../basic_functionality.79ea1ccc.0.snapshot | 5 ++++- .../basic_functionality.9c18b19d.0.snapshot | 5 ++++- .../basic_functionality.bb137371.0.snapshot | 5 ++++- .../basic_functionality.c4090bb1.0.snapshot | 5 ++++- .../basic_functionality.e3995c7d.0.snapshot | 5 ++++- .../basic_functionality.fe88cb04.0.snapshot | 10 ++++++++-- .../test/__snapshots__/boxes.08fca3f7.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.0c59fc4e.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.17668725.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.2b56febf.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.7d564476.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.9035923e.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.adbe1660.0.snapshot | 5 ++++- .../test/__snapshots__/boxes.bc258c1b.0.snapshot | 5 ++++- .../__snapshots__/early_return.1183a893.0.snapshot | 4 +++- .../test/__snapshots__/functions.06134c8a.0.snapshot | 5 ++++- .../test/__snapshots__/functions.0b8146ea.0.snapshot | 5 ++++- .../test/__snapshots__/functions.14922a92.0.snapshot | 5 ++++- .../test/__snapshots__/functions.1be5ecd5.0.snapshot | 5 ++++- .../test/__snapshots__/functions.28e0f2b3.0.snapshot | 5 ++++- .../test/__snapshots__/functions.49ccab54.0.snapshot | 4 +++- .../test/__snapshots__/functions.6eacded0.0.snapshot | 5 ++++- .../test/__snapshots__/functions.84b6e84b.0.snapshot | 5 ++++- .../test/__snapshots__/functions.9fd69835.0.snapshot | 5 ++++- .../test/__snapshots__/functions.b37949b2.0.snapshot | 5 ++++- .../test/__snapshots__/functions.b3a8d88b.0.snapshot | 5 ++++- .../test/__snapshots__/functions.c6e8a9aa.0.snapshot | 5 ++++- .../test/__snapshots__/functions.e6c6212b.0.snapshot | 5 ++++- .../test/__snapshots__/functions.f400bb7b.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.00e05fe2.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.1176df90.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.3307d5a7.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.43f6980c.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.48249b50.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.4c3f3b2b.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.4c75261e.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.634331f0.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.63c16374.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.6796c72d.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.baaea1d3.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.cbbbaeb4.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.d2de286b.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.e90db621.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.f8f208a2.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.f9e32f30.0.snapshot | 5 ++++- .../test/__snapshots__/let_mut.fcc9c65d.0.snapshot | 5 ++++- .../test/__snapshots__/loops.0a25def1.0.snapshot | 6 +++++- .../test/__snapshots__/loops.0fafc5f0.0.snapshot | 6 +++++- .../test/__snapshots__/loops.c2b7bfc6.0.snapshot | 5 ++++- .../test/__snapshots__/loops.f1c03b79.0.snapshot | 6 +++++- .../__snapshots__/optimizations.d72b00c6.0.snapshot | 4 +++- .../__snapshots__/optimizations.ff6d5bfb.0.snapshot | 6 +++++- .../test/__snapshots__/provides.2a5f527b.0.snapshot | 4 +++- .../test/__snapshots__/provides.30cbc409.0.snapshot | 4 +++- .../test/__snapshots__/provides.c6bf4567.0.snapshot | 4 +++- .../test/__snapshots__/records.49dfc6ff.0.snapshot | 4 +++- .../test/__snapshots__/records.54f5977c.0.snapshot | 9 ++++++--- .../test/__snapshots__/records.63a951b8.0.snapshot | 4 +++- .../test/__snapshots__/records.98824516.0.snapshot | 4 +++- .../test/__snapshots__/records.a3299dd2.0.snapshot | 6 ++++-- .../test/__snapshots__/records.d393173c.0.snapshot | 9 ++++++--- .../test/__snapshots__/tuples.1451773e.0.snapshot | 12 ++++++++---- .../test/__snapshots__/tuples.1d60b40c.0.snapshot | 6 ++++-- .../test/__snapshots__/tuples.2c91b91d.0.snapshot | 9 ++++++--- .../test/__snapshots__/tuples.a34621a0.0.snapshot | 12 ++++++++---- .../test/__snapshots__/tuples.c1eb0a50.0.snapshot | 12 ++++++++---- 79 files changed, 334 insertions(+), 97 deletions(-) diff --git a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot index 8543860541..7e49d66823 100644 --- a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot +++ b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot @@ -23,6 +23,9 @@ arrays › array_access (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot index 13d5c033d6..13a9065071 100644 --- a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot +++ b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot @@ -23,6 +23,9 @@ arrays › array_access4 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot index 898af8fb45..08dbd70e2c 100644 --- a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot +++ b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot @@ -23,6 +23,9 @@ arrays › array_access2 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot index 248d4a6df5..70183a1e2d 100644 --- a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot +++ b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot @@ -23,6 +23,9 @@ arrays › array_access3 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot index d0b5bde11f..adc0069b6a 100644 --- a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot +++ b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot @@ -23,6 +23,9 @@ arrays › array_access5 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot index 901140719f..c6d99b1874 100644 --- a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot @@ -47,6 +47,9 @@ basic functionality › assignment1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot index cfac5f319a..70d8f44919 100644 --- a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot @@ -17,6 +17,9 @@ basic functionality › assignment1 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot index 2aa7d1cfa9..7b07f958d4 100644 --- a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot @@ -130,7 +130,11 @@ basic functionality › func_shadow (main_body_stack_size ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()) (((name foo)) true Managed ()))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot index 1e7e2f5600..7e55a931ea 100644 --- a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot @@ -85,6 +85,9 @@ basic functionality › if_one_sided6 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot index badadf60f3..f96d4cdde1 100644 --- a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot @@ -37,6 +37,9 @@ basic functionality › block_no_expression (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name f)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name f))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot index 118e833b38..277bbce0d5 100644 --- a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot @@ -79,6 +79,9 @@ basic functionality › if_one_sided5 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot index 78404fabeb..26b4d1d323 100644 --- a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot @@ -511,6 +511,9 @@ basic functionality › pattern_match_unsafe_wasm (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name test)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name test))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot index 5f1901cd69..ee5b51bf01 100644 --- a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot @@ -47,6 +47,9 @@ basic functionality › assignment1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot index 47ab22b3bd..b74e78cf4a 100644 --- a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot @@ -47,6 +47,9 @@ basic functionality › assignment1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot index 2d21d61103..00713ee6dc 100644 --- a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot @@ -53,6 +53,9 @@ basic functionality › if_one_sided3 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot index a6789a5c00..e8eb90b995 100644 --- a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot @@ -47,6 +47,9 @@ basic functionality › assignment1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name t)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot index f2ef9aaf94..73e3cb59aa 100644 --- a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot @@ -188,6 +188,9 @@ basic functionality › toplevel_statements (main_body_stack_size ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name five)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name five))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot index fa20170750..fab702e7f8 100644 --- a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot @@ -59,6 +59,9 @@ basic functionality › if_one_sided4 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot index 5f5af36905..5822d17a0f 100644 --- a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot @@ -218,8 +218,14 @@ basic functionality › func_shadow_and_indirect_call ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((name foo)) true Managed ()) (((name foo)) true Managed ()) - (((name foo)) true Managed ()) (((name foo)) true Managed ()))) + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements (func_1134)) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot index 2239eba119..ae973865ed 100644 --- a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot +++ b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot @@ -53,6 +53,9 @@ boxes › box_subtraction1 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot index af13b0c2e6..7830665191 100644 --- a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot @@ -60,6 +60,9 @@ boxes › box_multiplication2 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.17668725.0.snapshot b/compiler/test/__snapshots__/boxes.17668725.0.snapshot index 221199aea6..8d9f2affef 100644 --- a/compiler/test/__snapshots__/boxes.17668725.0.snapshot +++ b/compiler/test/__snapshots__/boxes.17668725.0.snapshot @@ -60,6 +60,9 @@ boxes › box_division2 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot index 56ec896b31..dab1eb636b 100644 --- a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot +++ b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot @@ -60,6 +60,9 @@ boxes › box_addition2 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot index 0f4cafb4f7..3fabd61481 100644 --- a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot +++ b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot @@ -53,6 +53,9 @@ boxes › box_division1 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot index 5a1dfd182b..a3eee9b055 100644 --- a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot @@ -60,6 +60,9 @@ boxes › box_subtraction2 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot index 8b4c6a2dde..f1b4bb7d71 100644 --- a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot +++ b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot @@ -53,6 +53,9 @@ boxes › box_addition1 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot index bc22f7262b..f2bd9d34eb 100644 --- a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot +++ b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot @@ -53,6 +53,9 @@ boxes › box_multiplication1 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot index d2d4f3fe6f..905407294c 100644 --- a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot +++ b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot @@ -83,7 +83,9 @@ early return › early_return3 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1113) (name foo)) true Managed ()))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1119) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot index 5fa7268883..370c2a234b 100644 --- a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot +++ b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot @@ -36,6 +36,9 @@ functions › dup_func (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot index f096cd421d..9112c97e0e 100644 --- a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot +++ b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot @@ -43,6 +43,9 @@ functions › regression_1725 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.14922a92.0.snapshot b/compiler/test/__snapshots__/functions.14922a92.0.snapshot index 3dac22ca2c..fe496afd73 100644 --- a/compiler/test/__snapshots__/functions.14922a92.0.snapshot +++ b/compiler/test/__snapshots__/functions.14922a92.0.snapshot @@ -58,6 +58,9 @@ functions › shorthand_4 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot index f32774fae6..750b383f43 100644 --- a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot +++ b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot @@ -39,6 +39,9 @@ functions › shorthand_1 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot index 3b46e750e2..7c0cacab41 100644 --- a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot +++ b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot @@ -44,6 +44,9 @@ functions › lambda_pat_any (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name x)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot index e43257bcad..499c08a21f 100644 --- a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot +++ b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot @@ -89,7 +89,9 @@ functions › curried_func (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name add)) true Managed ()))) + (globals + (((id ((name add))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements (func_1124)) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot index 3d98b63b64..52b549653a 100644 --- a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot +++ b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot @@ -336,7 +336,10 @@ functions › func_recursive_closure ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((name truc)) true Managed ()) (((name makeAdder)) true Managed ()))) + (((id ((name truc))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name makeAdder))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements (func_1146)) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot index 506f348f56..270576db6f 100644 --- a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot +++ b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot @@ -39,6 +39,9 @@ functions › shorthand_3 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot index 80544a2a79..04c6540cd1 100644 --- a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot +++ b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot @@ -58,6 +58,9 @@ functions › shorthand_2 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot index 99e3846bc7..8e9dcf0b6c 100644 --- a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot +++ b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot @@ -158,6 +158,9 @@ functions › lam_destructure_4 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot index c8101ce445..44dd5fc125 100644 --- a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot +++ b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot @@ -219,6 +219,9 @@ functions › lam_destructure_8 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot index 0b72aa6a36..eca1c76ac3 100644 --- a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot +++ b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot @@ -44,6 +44,9 @@ functions › lam_destructure_2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot index dacc10aa82..a224829d6a 100644 --- a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot +++ b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot @@ -60,6 +60,9 @@ functions › fn_trailing_comma (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name testFn)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name testFn))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot index eeec45e070..0406e5444d 100644 --- a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot +++ b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot @@ -254,6 +254,9 @@ functions › lam_destructure_6 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name foo)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot index f47c5a5555..04f3d5516f 100644 --- a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot @@ -47,6 +47,9 @@ let mut › let-mut_division1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot index 24fca54d03..5be8f3d481 100644 --- a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_multiplication2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot index 496ce14bf6..c857c12bc4 100644 --- a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot @@ -16,6 +16,9 @@ let mut › let-mut3 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot index cdc4c9c8ee..e513f10ebe 100644 --- a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_division3 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot index 89b56701d6..7516a04aef 100644 --- a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut5 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot index e3c5785e44..ed32942836 100644 --- a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot @@ -28,6 +28,9 @@ let mut › let-mut2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot index 362e5f3c98..6143e245ac 100644 --- a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot @@ -47,6 +47,9 @@ let mut › let-mut_multiplication1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot index a51731dd2e..359d48b738 100644 --- a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_multiplication3 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot index a33750d1fa..8e193a152b 100644 --- a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot @@ -24,6 +24,9 @@ let mut › let-mut4 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot index 0e9ac9ae8e..4463d3ba79 100644 --- a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot @@ -47,6 +47,9 @@ let mut › let-mut_subtraction1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot index e0d8711a83..54c89b87d2 100644 --- a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_subtraction2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot index 75b69a3a95..e97da09184 100644 --- a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_addition2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot index 33f8361b6c..f3a762fdc9 100644 --- a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot @@ -47,6 +47,9 @@ let mut › let-mut_addition1 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot index 40d036fe04..b8a57aef7e 100644 --- a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_subtraction3 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot index f0ccc153c3..b3a664b5b9 100644 --- a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_addition3 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot index d6ca478086..95fa5c99b8 100644 --- a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot @@ -54,6 +54,9 @@ let mut › let-mut_division2 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot index 300b42237a..e647b6eb28 100644 --- a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot @@ -15,6 +15,9 @@ let mut › let-mut1 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot index 6c8b50b94d..c13125ccf1 100644 --- a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot +++ b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot @@ -150,7 +150,11 @@ loops › loop2 (main_body_stack_size ((stack_size_ptr 5) (stack_size_i32 2) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot index 296d4a1429..2ac1e40d58 100644 --- a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot +++ b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot @@ -133,7 +133,11 @@ loops › loop5 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot index 217661d975..8309c3a89a 100644 --- a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot +++ b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot @@ -86,6 +86,9 @@ loops › loop3 (main_body_stack_size ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name b)) true Managed ()))) (function_table_elements ()) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot index 3850ba0c86..05df645821 100644 --- a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot +++ b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot @@ -132,7 +132,11 @@ loops › loop4 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name count)) true Managed ()) (((name b)) true Managed ()))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot index 43949e05fc..563cc34784 100644 --- a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot @@ -43,7 +43,9 @@ optimizations › trs1 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1113) (name f1)) true Managed ()))) + (globals + (((id ((stamp 1113) (name f1))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1125) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot index f7d187faf6..e0b535cc12 100644 --- a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot @@ -78,7 +78,11 @@ optimizations › test_dead_branch_elimination_5 (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((name y)) true Managed ()) (((name x)) true Managed ()))) + (globals + (((id ((name y))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot index cdbb52a1bc..1c982f3928 100644 --- a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot +++ b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot @@ -18,7 +18,9 @@ provides › multiple_provides_8 (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1113) (name foo)) true Managed ()))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1117) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot index e985f358fd..ec1bd155a6 100644 --- a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot +++ b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot @@ -104,7 +104,9 @@ provides › provide_start_function (main_body_stack_size ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1113) (name _start)) true Managed ()))) + (globals + (((id ((stamp 1113) (name _start))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1120) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot index fe2aff9aac..c8025861d1 100644 --- a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot +++ b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot @@ -35,7 +35,9 @@ provides › let_rec_provide (main_body_stack_size ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1113) (name foo)) true Managed ()))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1116) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot index 0edcf705e1..4f66889748 100644 --- a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot +++ b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot @@ -56,7 +56,9 @@ records › record_destruct_1 (main_body_stack_size ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1114) (name foo)) true Managed ()))) + (globals + (((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1123) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.54f5977c.0.snapshot b/compiler/test/__snapshots__/records.54f5977c.0.snapshot index 6e45e65d7d..1236e492f6 100644 --- a/compiler/test/__snapshots__/records.54f5977c.0.snapshot +++ b/compiler/test/__snapshots__/records.54f5977c.0.snapshot @@ -146,9 +146,12 @@ records › record_destruct_4 ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1115) (name bar)) true Managed ()) - (((stamp 1114) (name foo)) true Managed ()) - (((stamp 1116) (name baz)) true Managed ()))) + (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name baz))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1128) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.63a951b8.0.snapshot b/compiler/test/__snapshots__/records.63a951b8.0.snapshot index 641f2c1f96..1eb1453edd 100644 --- a/compiler/test/__snapshots__/records.63a951b8.0.snapshot +++ b/compiler/test/__snapshots__/records.63a951b8.0.snapshot @@ -56,7 +56,9 @@ records › record_destruct_2 (main_body_stack_size ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1114) (name bar)) true Managed ()))) + (globals + (((id ((stamp 1114) (name bar))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1123) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.98824516.0.snapshot b/compiler/test/__snapshots__/records.98824516.0.snapshot index 7cffabb691..83c8e0a78e 100644 --- a/compiler/test/__snapshots__/records.98824516.0.snapshot +++ b/compiler/test/__snapshots__/records.98824516.0.snapshot @@ -71,7 +71,9 @@ records › record_destruct_deep (main_body_stack_size ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) - (globals ((((stamp 1115) (name foo)) true Managed ()))) + (globals + (((id ((stamp 1115) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1124) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot index cd12ed6375..4ee1b3fd15 100644 --- a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot +++ b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot @@ -102,8 +102,10 @@ records › record_destruct_3 ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1115) (name bar)) true Managed ()) - (((stamp 1114) (name foo)) true Managed ()))) + (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1126) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/records.d393173c.0.snapshot b/compiler/test/__snapshots__/records.d393173c.0.snapshot index 8b29b9c97c..ad0ff61f4d 100644 --- a/compiler/test/__snapshots__/records.d393173c.0.snapshot +++ b/compiler/test/__snapshots__/records.d393173c.0.snapshot @@ -146,9 +146,12 @@ records › record_destruct_trailing ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1115) (name bar)) true Managed ()) - (((stamp 1114) (name foo)) true Managed ()) - (((stamp 1116) (name baz)) true Managed ()))) + (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name baz))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1128) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot index 8f9686480c..a1fa3836da 100644 --- a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot @@ -145,10 +145,14 @@ tuples › nested_tup_3 ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1116) (name b)) true Managed ()) - (((stamp 1115) (name a)) true Managed ()) - (((stamp 1114) (name y)) true Managed ()) - (((stamp 1113) (name x)) true Managed ()))) + (((id ((stamp 1116) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name y))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1113) (name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1131) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot index 8b89cd8147..aae76e4dc1 100644 --- a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot @@ -87,8 +87,10 @@ tuples › nested_tup_1 ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1114) (name b)) true Managed ()) - (((stamp 1113) (name a)) true Managed ()))) + (((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1125) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot index f892a79217..a91b1b3222 100644 --- a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot +++ b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot @@ -91,9 +91,12 @@ tuples › tup1_destruct_trailing ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1113) (name a)) true Managed ()) - (((stamp 1115) (name c)) true Managed ()) - (((stamp 1114) (name b)) true Managed ()))) + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1124) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot index 0357ba126f..772a044091 100644 --- a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot +++ b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot @@ -115,10 +115,14 @@ tuples › big_tup_access ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1113) (name a)) true Managed ()) - (((stamp 1116) (name d)) true Managed ()) - (((stamp 1115) (name c)) true Managed ()) - (((stamp 1114) (name b)) true Managed ()))) + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1127) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) diff --git a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot index 9ab54346ac..3e45eb6151 100644 --- a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot +++ b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot @@ -145,10 +145,14 @@ tuples › nested_tup_2 ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) (stack_size_f32 0) (stack_size_f64 0))) (globals - ((((stamp 1113) (name a)) true Managed ()) - (((stamp 1116) (name d)) true Managed ()) - (((stamp 1115) (name c)) true Managed ()) - (((stamp 1114) (name b)) true Managed ()))) + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) (function_table_elements ()) (global_function_table_offset ((stamp 1131) (name function_table_global))) (compilation_mode Normal) (signature ) (type_metadata )) From c797d02484aebd6b8c0a95c9527e17ab1f21e331 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Wed, 9 Oct 2024 19:53:03 -0500 Subject: [PATCH 12/20] refactor compcore --- compiler/src/codegen/compcore.re | 104 +------------------------- compiler/src/codegen/type_metadata.re | 101 +++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 101 deletions(-) create mode 100644 compiler/src/codegen/type_metadata.re diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index be75ef0a64..cca1975257 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -97,6 +97,8 @@ let init_codegen_env = compilation_mode: Normal, }; +// Generates the name for the linked symbol. Symbols are scoped using the +// dependency ID for that module. let linked_name = (~env, id) => { Printf.sprintf("%s_%d", id, env.dep_id); }; @@ -3304,106 +3306,6 @@ let compile_functions = (wasm_mod, env, {functions, prog_loc}) => { ignore @@ List.map(handle_attrs, functions); }; -let construct_type_metadata_table = metas => { - open Cmi_format; - // Create a hash table mapping "type hashes" unique to each Grain type to - // offsets in the metadata section - - // Structure: - // | Hash table: array of (offset into mappings data, bucket size) for each hash (type_hash % num_buckets) - // | Mappings: arrays of (type_hash, offset into actual metadata table) for each hash table bucket - // | Metadata: actual metadata content; appropriate offset for type metadata found through table data - let exceptions_buf = Buffer.create(256); - let exception_metas = List.map(m => m.ctm_exceptions, metas); - let exceptions_section_len = - List.fold_left((len, e) => String.length(e) + len, 0, exception_metas) - + 4; - Buffer.add_int32_le(exceptions_buf, Int32.of_int(exceptions_section_len)); - List.iter(Buffer.add_string(exceptions_buf), exception_metas); - - let exception_meta = (Buffer.contents(exceptions_buf), [(0, 0)]); - let non_exception_metas = - List.map(m => (m.ctm_metadata, m.ctm_offsets_tbl), metas); - let metas = [exception_meta, ...non_exception_metas]; - - let metadata_buf = Buffer.create(256); - let curr_offset = ref(0); - let hash_to_offset = - List.flatten( - List.map( - ((meta, offsets_tbl)) => { - Buffer.add_string(metadata_buf, meta); - let padding_bytes = String.length(meta) mod 8; - for (_ in 1 to padding_bytes) { - Buffer.add_int8(metadata_buf, 0); - }; - let hash_to_offset = - List.map( - ((hash, offset)) => (hash, offset + curr_offset^), - offsets_tbl, - ); - curr_offset := curr_offset^ + String.length(meta) + padding_bytes; - hash_to_offset; - }, - metas, - ), - ); - let rec next_pow_of_2 = (num, res) => - if (num <= 1) { - 1 lsl res; - } else { - next_pow_of_2(num lsr 1, res + 1); - }; - let num_entries = List.length(hash_to_offset); - // Choose number of buckets to be the greatest power of 2 <= # table entries - // (limit 4K) as a memory/lookup speed tradeoff (expect 1-2 entries/bucket) - let num_buckets = min(4096, next_pow_of_2(num_entries, 0)); - let buckets = Array.make(num_buckets, []); - List.iter( - ((hash, _) as hash_and_offset) => { - let hash_hash = hash mod num_buckets; - buckets[hash_hash] = [hash_and_offset, ...buckets[hash_hash]]; - }, - hash_to_offset, - ); - for (i in 0 to num_buckets - 1) { - buckets[i] = List.rev(buckets[i]); - }; - - let tbl_buckets_buf = Buffer.create(num_buckets * 8); - let tbl_vals_buf = Buffer.create(num_entries * 8); - // Store the number of buckets at the beginning of the metadata section - Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(num_buckets)); - // For 8-byte alignment - Buffer.add_int32_le(tbl_buckets_buf, 0l); - - // # buckets + buckets + data (2 i32s each) - let tbl_size = 8 + (num_buckets + num_entries) * 8; - // Initialize offset to point after the table buckets - let tbl_data_offset = ref(8 + num_buckets * 8); - Array.iter( - hash_to_offset => { - Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(tbl_data_offset^)); - Buffer.add_int32_le( - tbl_buckets_buf, - Int32.of_int(List.length(hash_to_offset)), - ); - List.iter( - ((hash, offset)) => { - Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(hash)); - Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(offset + tbl_size)); - tbl_data_offset := tbl_data_offset^ + 8; - }, - hash_to_offset, - ); - }, - buckets, - ); - Buffer.add_buffer(tbl_buckets_buf, tbl_vals_buf); - Buffer.add_buffer(tbl_buckets_buf, metadata_buf); - Buffer.to_bytes(tbl_buckets_buf); -}; - let compile_type_metadata = (wasm_mod, env, prog) => { let metadata_tbl_data = if (Config.elide_type_info^) { @@ -3414,7 +3316,7 @@ let compile_type_metadata = (wasm_mod, env, prog) => { prog => prog.Mashtree.signature.cmi_type_metadata, prog.programs, ); - Some(construct_type_metadata_table(metadata)); + Some(Type_metadata.construct_type_metadata_table(metadata)); }; let runtime_heap_ptr = switch (Grain_utils.Config.memory_base^) { diff --git a/compiler/src/codegen/type_metadata.re b/compiler/src/codegen/type_metadata.re new file mode 100644 index 0000000000..7ad47eaacf --- /dev/null +++ b/compiler/src/codegen/type_metadata.re @@ -0,0 +1,101 @@ +open Grain_typed; +open Cmi_format; + +let construct_type_metadata_table = metas => { + // Create a hash table mapping "type hashes" unique to each Grain type to + // offsets in the metadata section + + // Structure: + // | Hash table: array of (offset into mappings data, bucket size) for each hash (type_hash % num_buckets) + // | Mappings: arrays of (type_hash, offset into actual metadata table) for each hash table bucket + // | Metadata: actual metadata content; appropriate offset for type metadata found through table data + let exceptions_buf = Buffer.create(256); + let exception_metas = List.map(m => m.ctm_exceptions, metas); + let exceptions_section_len = + List.fold_left((len, e) => String.length(e) + len, 0, exception_metas) + + 4; + Buffer.add_int32_le(exceptions_buf, Int32.of_int(exceptions_section_len)); + List.iter(Buffer.add_string(exceptions_buf), exception_metas); + + let exception_meta = (Buffer.contents(exceptions_buf), [(0, 0)]); + let non_exception_metas = + List.map(m => (m.ctm_metadata, m.ctm_offsets_tbl), metas); + let metas = [exception_meta, ...non_exception_metas]; + + let metadata_buf = Buffer.create(256); + let curr_offset = ref(0); + let hash_to_offset = + List.flatten( + List.map( + ((meta, offsets_tbl)) => { + Buffer.add_string(metadata_buf, meta); + let padding_bytes = String.length(meta) mod 8; + for (_ in 1 to padding_bytes) { + Buffer.add_int8(metadata_buf, 0); + }; + let hash_to_offset = + List.map( + ((hash, offset)) => (hash, offset + curr_offset^), + offsets_tbl, + ); + curr_offset := curr_offset^ + String.length(meta) + padding_bytes; + hash_to_offset; + }, + metas, + ), + ); + let rec next_pow_of_2 = (num, res) => + if (num <= 1) { + 1 lsl res; + } else { + next_pow_of_2(num lsr 1, res + 1); + }; + let num_entries = List.length(hash_to_offset); + // Choose number of buckets to be the greatest power of 2 <= # table entries + // (limit 4K) as a memory/lookup speed tradeoff (expect 1-2 entries/bucket) + let num_buckets = min(4096, next_pow_of_2(num_entries, 0)); + let buckets = Array.make(num_buckets, []); + List.iter( + ((hash, _) as hash_and_offset) => { + let hash_hash = hash mod num_buckets; + buckets[hash_hash] = [hash_and_offset, ...buckets[hash_hash]]; + }, + hash_to_offset, + ); + for (i in 0 to num_buckets - 1) { + buckets[i] = List.rev(buckets[i]); + }; + + let tbl_buckets_buf = Buffer.create(num_buckets * 8); + let tbl_vals_buf = Buffer.create(num_entries * 8); + // Store the number of buckets at the beginning of the metadata section + Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(num_buckets)); + // For 8-byte alignment + Buffer.add_int32_le(tbl_buckets_buf, 0l); + + // # buckets + buckets + data (2 i32s each) + let tbl_size = 8 + (num_buckets + num_entries) * 8; + // Initialize offset to point after the table buckets + let tbl_data_offset = ref(8 + num_buckets * 8); + Array.iter( + hash_to_offset => { + Buffer.add_int32_le(tbl_buckets_buf, Int32.of_int(tbl_data_offset^)); + Buffer.add_int32_le( + tbl_buckets_buf, + Int32.of_int(List.length(hash_to_offset)), + ); + List.iter( + ((hash, offset)) => { + Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(hash)); + Buffer.add_int32_le(tbl_vals_buf, Int32.of_int(offset + tbl_size)); + tbl_data_offset := tbl_data_offset^ + 8; + }, + hash_to_offset, + ); + }, + buckets, + ); + Buffer.add_buffer(tbl_buckets_buf, tbl_vals_buf); + Buffer.add_buffer(tbl_buckets_buf, metadata_buf); + Buffer.to_bytes(tbl_buckets_buf); +}; From 7bb64fb06c07e171e7ee4e22046460f7201e6bce Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Wed, 9 Oct 2024 20:08:18 -0500 Subject: [PATCH 13/20] refactor objects to not store signature twice --- compiler/src/codegen/compcore.re | 6 +- compiler/src/codegen/emitmod.re | 18 +- compiler/src/codegen/linkedtree.re | 23 +- compiler/src/codegen/mashtree.re | 6 +- compiler/src/codegen/transl_anf.re | 24 +- .../__snapshots__/arrays.0f9e7d37.0.snapshot | 62 +- .../__snapshots__/arrays.1deb7b51.0.snapshot | 64 +- .../__snapshots__/arrays.24453e6e.0.snapshot | 36 +- .../__snapshots__/arrays.28fcc534.0.snapshot | 62 +- .../__snapshots__/arrays.4c8c9f91.0.snapshot | 62 +- .../__snapshots__/arrays.6eac4e1f.0.snapshot | 62 +- .../__snapshots__/arrays.74d79181.0.snapshot | 62 +- .../__snapshots__/arrays.9e17b4d1.0.snapshot | 36 +- .../__snapshots__/arrays.b85cb7fc.0.snapshot | 36 +- .../basic_functionality.00bcbc39.0.snapshot | 107 +- .../basic_functionality.00cfdb2e.0.snapshot | 26 +- .../basic_functionality.03de4778.0.snapshot | 26 +- .../basic_functionality.040643b3.0.snapshot | 96 +- .../basic_functionality.06bd2a80.0.snapshot | 44 +- .../basic_functionality.0996c5f7.0.snapshot | 66 +- .../basic_functionality.0a230f18.0.snapshot | 66 +- .../basic_functionality.0a2e4afa.0.snapshot | 66 +- .../basic_functionality.0c0b170b.0.snapshot | 66 +- .../basic_functionality.0c400bde.0.snapshot | 66 +- .../basic_functionality.0e812a39.0.snapshot | 116 +- .../basic_functionality.0f79ce35.0.snapshot | 70 +- .../basic_functionality.10dda088.0.snapshot | 97 +- .../basic_functionality.122e74b0.0.snapshot | 100 +- .../basic_functionality.125626a9.0.snapshot | 66 +- .../basic_functionality.13335202.0.snapshot | 116 +- .../basic_functionality.1ad0f349.0.snapshot | 116 +- .../basic_functionality.1ae16d82.0.snapshot | 66 +- .../basic_functionality.1b68c8db.0.snapshot | 66 +- .../basic_functionality.1bf5759c.0.snapshot | 209 ++- .../basic_functionality.1d2ec323.0.snapshot | 214 +-- .../basic_functionality.1e4b1f39.0.snapshot | 66 +- .../basic_functionality.1f787365.0.snapshot | 103 +- .../basic_functionality.20f7581b.0.snapshot | 26 +- .../basic_functionality.240ef39e.0.snapshot | 96 +- .../basic_functionality.2756b429.0.snapshot | 26 +- .../basic_functionality.27a7e2f7.0.snapshot | 18 +- .../basic_functionality.28405f1f.0.snapshot | 116 +- .../basic_functionality.28bf4c9e.0.snapshot | 66 +- .../basic_functionality.2bcc447b.0.snapshot | 189 +- .../basic_functionality.2cb30a54.0.snapshot | 21 +- .../basic_functionality.2d7e34cf.0.snapshot | 26 +- .../basic_functionality.2f2f8795.0.snapshot | 66 +- .../basic_functionality.2f53324c.0.snapshot | 69 +- .../basic_functionality.2f65c8cf.0.snapshot | 26 +- .../basic_functionality.304ca65f.0.snapshot | 26 +- .../basic_functionality.31e0d562.0.snapshot | 18 +- .../basic_functionality.32a8c452.0.snapshot | 142 +- .../basic_functionality.34dcfbdd.0.snapshot | 18 +- .../basic_functionality.3c2ba165.0.snapshot | 246 +-- .../basic_functionality.3e5f990b.0.snapshot | 66 +- .../basic_functionality.3edefd23.0.snapshot | 60 +- .../basic_functionality.3ffd0bf3.0.snapshot | 26 +- .../basic_functionality.427c6671.0.snapshot | 18 +- .../basic_functionality.448497ab.0.snapshot | 26 +- .../basic_functionality.46348f36.0.snapshot | 131 +- .../basic_functionality.48db380c.0.snapshot | 26 +- .../basic_functionality.4d6f9417.0.snapshot | 26 +- .../basic_functionality.4f5bd247.0.snapshot | 18 +- .../basic_functionality.52ca8e0e.0.snapshot | 273 +-- .../basic_functionality.565dbeda.0.snapshot | 26 +- .../basic_functionality.5705b20c.0.snapshot | 66 +- .../basic_functionality.593b8d63.0.snapshot | 182 +- .../basic_functionality.5b56d472.0.snapshot | 26 +- .../basic_functionality.5cd54e52.0.snapshot | 26 +- .../basic_functionality.5d973a3e.0.snapshot | 66 +- .../basic_functionality.61c58118.0.snapshot | 88 +- .../basic_functionality.626b2e44.0.snapshot | 170 +- .../basic_functionality.65d36891.0.snapshot | 66 +- .../basic_functionality.67d2cc45.0.snapshot | 66 +- .../basic_functionality.684b6ecb.0.snapshot | 66 +- .../basic_functionality.68d08483.0.snapshot | 66 +- .../basic_functionality.6f9706c2.0.snapshot | 26 +- .../basic_functionality.704872bc.0.snapshot | 26 +- .../basic_functionality.711a4824.0.snapshot | 1025 +++++------ .../basic_functionality.7222ab37.0.snapshot | 26 +- .../basic_functionality.7287219f.0.snapshot | 66 +- .../basic_functionality.7599b5a6.0.snapshot | 107 +- .../basic_functionality.7848308f.0.snapshot | 26 +- .../basic_functionality.79ea1ccc.0.snapshot | 107 +- .../basic_functionality.7b13e79a.0.snapshot | 26 +- .../basic_functionality.7bb7b0d4.0.snapshot | 18 +- .../basic_functionality.7beffe4d.0.snapshot | 18 +- .../basic_functionality.7ccc4940.0.snapshot | 26 +- .../basic_functionality.7d0640b4.0.snapshot | 160 +- .../basic_functionality.83f51526.0.snapshot | 18 +- .../basic_functionality.86f332c6.0.snapshot | 26 +- .../basic_functionality.8c8313f3.0.snapshot | 18 +- .../basic_functionality.8e01d666.0.snapshot | 18 +- .../basic_functionality.903ff701.0.snapshot | 18 +- .../basic_functionality.9110d0f5.0.snapshot | 68 +- .../basic_functionality.9157dba1.0.snapshot | 66 +- .../basic_functionality.9379df0d.0.snapshot | 190 +- .../basic_functionality.950b8fda.0.snapshot | 26 +- .../basic_functionality.970a2a2b.0.snapshot | 26 +- .../basic_functionality.974b7936.0.snapshot | 66 +- .../basic_functionality.994117f8.0.snapshot | 60 +- .../basic_functionality.9b9c7047.0.snapshot | 18 +- .../basic_functionality.9c18b19d.0.snapshot | 118 +- .../basic_functionality.9df4a5e0.0.snapshot | 26 +- .../basic_functionality.9fb01eb5.0.snapshot | 26 +- .../basic_functionality.a0045d1c.0.snapshot | 66 +- .../basic_functionality.a0747361.0.snapshot | 26 +- .../basic_functionality.a2e63440.0.snapshot | 97 +- .../basic_functionality.a3f7e180.0.snapshot | 74 +- .../basic_functionality.a4ec9fca.0.snapshot | 26 +- .../basic_functionality.a58a9361.0.snapshot | 66 +- .../basic_functionality.a5d5182f.0.snapshot | 97 +- .../basic_functionality.a72898d0.0.snapshot | 97 +- .../basic_functionality.abd9d13c.0.snapshot | 97 +- .../basic_functionality.b07cc734.0.snapshot | 160 +- .../basic_functionality.b6a1b657.0.snapshot | 66 +- .../basic_functionality.b836b89a.0.snapshot | 175 +- .../basic_functionality.bb137371.0.snapshot | 107 +- .../basic_functionality.bd891a1f.0.snapshot | 26 +- .../basic_functionality.bef9449e.0.snapshot | 96 +- .../basic_functionality.c1554a92.0.snapshot | 26 +- .../basic_functionality.c2c74be4.0.snapshot | 66 +- .../basic_functionality.c4090bb1.0.snapshot | 376 ++-- .../basic_functionality.c49928a5.0.snapshot | 66 +- .../basic_functionality.c55feb83.0.snapshot | 69 +- .../basic_functionality.c8095f7c.0.snapshot | 60 +- .../basic_functionality.c8144b17.0.snapshot | 26 +- .../basic_functionality.cb9c6c66.0.snapshot | 60 +- .../basic_functionality.cdeddcd2.0.snapshot | 66 +- .../basic_functionality.cefeb364.0.snapshot | 66 +- .../basic_functionality.d0c0c62b.0.snapshot | 66 +- .../basic_functionality.d0cb4f44.0.snapshot | 60 +- .../basic_functionality.d124f931.0.snapshot | 26 +- .../basic_functionality.d6ca4146.0.snapshot | 103 +- .../basic_functionality.d8a7dcf9.0.snapshot | 66 +- .../basic_functionality.d8f6f027.0.snapshot | 18 +- .../basic_functionality.d9fc01df.0.snapshot | 66 +- .../basic_functionality.dbf5d3ff.0.snapshot | 66 +- .../basic_functionality.df4cd2bf.0.snapshot | 69 +- .../basic_functionality.e2902464.0.snapshot | 116 +- .../basic_functionality.e3995c7d.0.snapshot | 132 +- .../basic_functionality.e56cd2a2.0.snapshot | 97 +- .../basic_functionality.e58c3266.0.snapshot | 66 +- .../basic_functionality.e6ea6b06.0.snapshot | 18 +- .../basic_functionality.e811c1e1.0.snapshot | 66 +- .../basic_functionality.ee7c0ebc.0.snapshot | 66 +- .../basic_functionality.f132ca8b.0.snapshot | 60 +- .../basic_functionality.f47797ca.0.snapshot | 18 +- .../basic_functionality.f58be537.0.snapshot | 222 +-- .../basic_functionality.f90a3baa.0.snapshot | 18 +- .../basic_functionality.f9743171.0.snapshot | 18 +- .../basic_functionality.fd64a58f.0.snapshot | 66 +- .../basic_functionality.fe19cffe.0.snapshot | 24 +- .../basic_functionality.fe88cb04.0.snapshot | 446 ++--- .../__snapshots__/boxes.08fca3f7.0.snapshot | 122 +- .../__snapshots__/boxes.0c59fc4e.0.snapshot | 136 +- .../__snapshots__/boxes.17668725.0.snapshot | 136 +- .../__snapshots__/boxes.2b56febf.0.snapshot | 136 +- .../__snapshots__/boxes.7d564476.0.snapshot | 122 +- .../__snapshots__/boxes.9035923e.0.snapshot | 136 +- .../__snapshots__/boxes.adbe1660.0.snapshot | 122 +- .../__snapshots__/boxes.bc258c1b.0.snapshot | 122 +- .../__snapshots__/boxes.eb81e542.0.snapshot | 56 +- .../__snapshots__/chars.200d9e1a.0.snapshot | 26 +- .../__snapshots__/chars.259e330c.0.snapshot | 26 +- .../__snapshots__/chars.27fb7f30.0.snapshot | 26 +- .../__snapshots__/chars.51010573.0.snapshot | 26 +- .../__snapshots__/chars.7e0f68db.0.snapshot | 26 +- .../__snapshots__/chars.af4b3613.0.snapshot | 26 +- .../__snapshots__/chars.e1cac8cd.0.snapshot | 26 +- .../comments.573e549e.0.snapshot | 26 +- .../comments.8f52e899.0.snapshot | 26 +- .../comments.ccf5fcf4.0.snapshot | 26 +- .../comments.fd91c233.0.snapshot | 26 +- .../early_return.1183a893.0.snapshot | 178 +- .../__snapshots__/enums.aa34084a.0.snapshot | 38 +- .../__snapshots__/enums.ae26523b.0.snapshot | 312 ++-- .../exceptions.a68ae348.0.snapshot | 38 +- .../exceptions.ccac3e71.0.snapshot | 38 +- .../functions.06134c8a.0.snapshot | 86 +- .../functions.0b8146ea.0.snapshot | 100 +- .../functions.14922a92.0.snapshot | 130 +- .../functions.1be5ecd5.0.snapshot | 92 +- .../functions.23afd9c9.0.snapshot | 496 ++--- .../functions.28e0f2b3.0.snapshot | 102 +- .../functions.49ccab54.0.snapshot | 181 +- .../functions.6eacded0.0.snapshot | 675 +++---- .../functions.7a8986a5.0.snapshot | 80 +- .../functions.84b6e84b.0.snapshot | 92 +- .../functions.8baf471f.0.snapshot | 310 ++-- .../functions.9223245d.0.snapshot | 434 ++--- .../functions.9fd69835.0.snapshot | 130 +- .../functions.b37949b2.0.snapshot | 322 ++-- .../functions.b3a8d88b.0.snapshot | 446 ++--- .../functions.b632a2ab.0.snapshot | 90 +- .../functions.c6e8a9aa.0.snapshot | 102 +- .../functions.ce978f54.0.snapshot | 26 +- .../functions.d9466880.0.snapshot | 190 +- .../functions.e6c6212b.0.snapshot | 134 +- .../functions.f400bb7b.0.snapshot | 508 +++--- .../functions.f647681b.0.snapshot | 142 +- .../includes.1d829099.0.snapshot | 36 +- .../includes.46f78654.0.snapshot | 72 +- .../includes.5dfba7dd.0.snapshot | 36 +- .../includes.6c8d23dc.0.snapshot | 72 +- .../includes.6e78c003.0.snapshot | 72 +- .../includes.7afbe731.0.snapshot | 36 +- .../includes.8222ee98.0.snapshot | 36 +- .../includes.86ff4075.0.snapshot | 72 +- .../includes.a3212bd0.0.snapshot | 36 +- .../includes.b3434679.0.snapshot | 70 +- .../includes.bd3eb3af.0.snapshot | 118 +- .../includes.beda767e.0.snapshot | 36 +- .../includes.c0c0d5ca.0.snapshot | 137 +- .../includes.c62f45f8.0.snapshot | 86 +- .../includes.cedde8e9.0.snapshot | 70 +- .../includes.de6b420f.0.snapshot | 38 +- .../includes.f2bf866b.0.snapshot | 70 +- .../includes.f4ba5583.0.snapshot | 72 +- .../__snapshots__/let_mut.00e05fe2.0.snapshot | 107 +- .../__snapshots__/let_mut.1176df90.0.snapshot | 125 +- .../__snapshots__/let_mut.3307d5a7.0.snapshot | 48 +- .../__snapshots__/let_mut.43f6980c.0.snapshot | 125 +- .../__snapshots__/let_mut.48249b50.0.snapshot | 125 +- .../__snapshots__/let_mut.4c3f3b2b.0.snapshot | 72 +- .../__snapshots__/let_mut.4c75261e.0.snapshot | 107 +- .../__snapshots__/let_mut.634331f0.0.snapshot | 125 +- .../__snapshots__/let_mut.63c16374.0.snapshot | 64 +- .../__snapshots__/let_mut.6796c72d.0.snapshot | 107 +- .../__snapshots__/let_mut.baaea1d3.0.snapshot | 125 +- .../__snapshots__/let_mut.cbbbaeb4.0.snapshot | 125 +- .../__snapshots__/let_mut.d2de286b.0.snapshot | 107 +- .../__snapshots__/let_mut.e90db621.0.snapshot | 125 +- .../__snapshots__/let_mut.f8f208a2.0.snapshot | 125 +- .../__snapshots__/let_mut.f9e32f30.0.snapshot | 125 +- .../__snapshots__/let_mut.fcc9c65d.0.snapshot | 46 +- .../__snapshots__/lists.884ce894.0.snapshot | 166 +- .../__snapshots__/lists.d9fd46fb.0.snapshot | 134 +- .../__snapshots__/lists.e5378351.0.snapshot | 134 +- .../__snapshots__/loops.0a25def1.0.snapshot | 320 ++-- .../__snapshots__/loops.0fafc5f0.0.snapshot | 278 +-- .../__snapshots__/loops.c2b7bfc6.0.snapshot | 186 +- .../__snapshots__/loops.f1c03b79.0.snapshot | 281 +-- .../__snapshots__/modules.52d25a2f.0.snapshot | 26 +- .../optimizations.d72b00c6.0.snapshot | 98 +- .../optimizations.ff6d5bfb.0.snapshot | 176 +- .../pattern_matching.0539d13e.0.snapshot | 229 +-- .../pattern_matching.05b60a1e.0.snapshot | 319 ++-- .../pattern_matching.0ad4ac05.0.snapshot | 1505 ++++++++-------- .../pattern_matching.0bb6923e.0.snapshot | 1158 ++++++------ .../pattern_matching.0fa61137.0.snapshot | 316 ++-- .../pattern_matching.14dc7554.0.snapshot | 148 +- .../pattern_matching.16cd197e.0.snapshot | 127 +- .../pattern_matching.16eb3dbf.0.snapshot | 425 ++--- .../pattern_matching.25930935.0.snapshot | 326 ++-- .../pattern_matching.3722b060.0.snapshot | 461 ++--- .../pattern_matching.46f91987.0.snapshot | 148 +- .../pattern_matching.5b158103.0.snapshot | 449 ++--- .../pattern_matching.5b6ff2d3.0.snapshot | 528 +++--- .../pattern_matching.5ff49e44.0.snapshot | 339 ++-- .../pattern_matching.64686134.0.snapshot | 200 +- .../pattern_matching.702ed9b0.0.snapshot | 1569 ++++++++-------- .../pattern_matching.7082d3ca.0.snapshot | 246 +-- .../pattern_matching.79346fef.0.snapshot | 1473 +++++++-------- .../pattern_matching.7f7fe4ef.0.snapshot | 72 +- .../pattern_matching.8614dff3.0.snapshot | 122 +- .../pattern_matching.8c0dc67a.0.snapshot | 1064 +++++------ .../pattern_matching.9561763b.0.snapshot | 869 ++++----- .../pattern_matching.98756c45.0.snapshot | 178 +- .../pattern_matching.9ffaa7a7.0.snapshot | 326 ++-- .../pattern_matching.aa8d2963.0.snapshot | 484 ++--- .../pattern_matching.ac58ffc3.0.snapshot | 425 ++--- .../pattern_matching.b1b060ad.0.snapshot | 1094 +++++------ .../pattern_matching.b9db0dd9.0.snapshot | 484 ++--- .../pattern_matching.be46eb0e.0.snapshot | 300 +-- .../pattern_matching.c91eac29.0.snapshot | 1126 ++++++------ .../pattern_matching.c9582b6d.0.snapshot | 391 ++-- .../pattern_matching.d048ece0.0.snapshot | 1190 ++++++------ .../pattern_matching.e17bcd61.0.snapshot | 133 +- .../pattern_matching.e41ad64e.0.snapshot | 1537 ++++++++-------- .../pattern_matching.eb4334e1.0.snapshot | 516 +++--- .../pattern_matching.f0c08ea4.0.snapshot | 1601 +++++++++-------- .../pattern_matching.f25e0163.0.snapshot | 674 +++---- .../pattern_matching.f3d48b0e.0.snapshot | 133 +- .../pattern_matching.f6c9c89c.0.snapshot | 384 ++-- .../provides.0ef7e7b3.0.snapshot | 36 +- .../provides.10f4f118.0.snapshot | 73 +- .../provides.2a5f527b.0.snapshot | 54 +- .../provides.30cbc409.0.snapshot | 222 +-- .../provides.82c10ab4.0.snapshot | 182 +- .../provides.c3bb4eff.0.snapshot | 124 +- .../provides.c6bf4567.0.snapshot | 85 +- .../provides.f378d570.0.snapshot | 36 +- .../__snapshots__/records.012b017b.0.snapshot | 26 +- .../__snapshots__/records.02742729.0.snapshot | 135 +- .../__snapshots__/records.02af5946.0.snapshot | 38 +- .../__snapshots__/records.2dc39420.0.snapshot | 38 +- .../__snapshots__/records.49dfc6ff.0.snapshot | 126 +- .../__snapshots__/records.54f5977c.0.snapshot | 309 ++-- .../__snapshots__/records.5f340064.0.snapshot | 38 +- .../__snapshots__/records.60c0a141.0.snapshot | 226 +-- .../__snapshots__/records.60c7acc4.0.snapshot | 45 +- .../__snapshots__/records.63a951b8.0.snapshot | 126 +- .../__snapshots__/records.89d08e01.0.snapshot | 38 +- .../__snapshots__/records.98824516.0.snapshot | 156 +- .../__snapshots__/records.a3299dd2.0.snapshot | 219 +-- .../__snapshots__/records.a702778a.0.snapshot | 114 +- .../__snapshots__/records.a9c472b1.0.snapshot | 56 +- .../__snapshots__/records.b50d234d.0.snapshot | 60 +- .../__snapshots__/records.d34c4740.0.snapshot | 45 +- .../__snapshots__/records.d393173c.0.snapshot | 309 ++-- .../__snapshots__/records.d44e8007.0.snapshot | 45 +- .../__snapshots__/records.e4326567.0.snapshot | 56 +- .../__snapshots__/records.e5b56da8.0.snapshot | 38 +- .../__snapshots__/records.e705a980.0.snapshot | 45 +- .../__snapshots__/records.f6e43cdb.0.snapshot | 45 +- .../__snapshots__/records.f6feee77.0.snapshot | 56 +- .../__snapshots__/records.fae50a8e.0.snapshot | 45 +- .../__snapshots__/stdlib.179d20b9.0.snapshot | 68 +- .../__snapshots__/stdlib.1c0b04b7.0.snapshot | 156 +- .../__snapshots__/stdlib.24cb9bbf.0.snapshot | 84 +- .../__snapshots__/stdlib.323e410a.0.snapshot | 82 +- .../__snapshots__/stdlib.37483d2d.0.snapshot | 134 +- .../__snapshots__/stdlib.4a5061c2.0.snapshot | 156 +- .../__snapshots__/stdlib.5fe88631.0.snapshot | 80 +- .../__snapshots__/stdlib.648f406e.0.snapshot | 124 +- .../__snapshots__/stdlib.69635cff.0.snapshot | 156 +- .../__snapshots__/stdlib.6bf88430.0.snapshot | 80 +- .../__snapshots__/stdlib.6de47be2.0.snapshot | 80 +- .../__snapshots__/stdlib.8300ad7c.0.snapshot | 312 ++-- .../__snapshots__/stdlib.91a94037.0.snapshot | 104 +- .../__snapshots__/stdlib.a70e79ca.0.snapshot | 90 +- .../__snapshots__/stdlib.b30d7785.0.snapshot | 108 +- .../__snapshots__/stdlib.c09a513a.0.snapshot | 70 +- .../__snapshots__/stdlib.cbf0318e.0.snapshot | 158 +- .../__snapshots__/stdlib.d28dee65.0.snapshot | 100 +- .../__snapshots__/stdlib.d4faa5bf.0.snapshot | 80 +- .../__snapshots__/stdlib.d887bb04.0.snapshot | 71 +- .../__snapshots__/stdlib.dae8b12a.0.snapshot | 68 +- .../__snapshots__/stdlib.e306600a.0.snapshot | 80 +- .../__snapshots__/stdlib.e6349872.0.snapshot | 84 +- .../__snapshots__/strings.434adad0.0.snapshot | 18 +- .../__snapshots__/strings.a67428df.0.snapshot | 18 +- .../__snapshots__/strings.b2ad5a89.0.snapshot | 21 +- .../__snapshots__/strings.fb85549f.0.snapshot | 80 +- .../__snapshots__/tuples.1451773e.0.snapshot | 308 ++-- .../__snapshots__/tuples.1d60b40c.0.snapshot | 188 +- .../__snapshots__/tuples.2c91b91d.0.snapshot | 198 +- .../__snapshots__/tuples.8d1f0463.0.snapshot | 36 +- .../__snapshots__/tuples.a34621a0.0.snapshot | 248 +-- .../__snapshots__/tuples.b4f702d8.0.snapshot | 26 +- .../__snapshots__/tuples.c1eb0a50.0.snapshot | 308 ++-- .../__snapshots__/tuples.f206002b.0.snapshot | 36 +- 353 files changed, 27457 insertions(+), 26408 deletions(-) diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index cca1975257..f5297b843a 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -3225,7 +3225,7 @@ let compile_globals = (wasm_mod, env, {globals}) => { let compile_main = (wasm_mod, env, prog) => { let num_mains = List.length(prog.programs); List.iteri( - (dep_id, prog: mash_program) => { + (dep_id, {mash_code: prog}: mash_program) => { let env = {...env, compilation_mode: prog.compilation_mode, dep_id}; let compile = () => { ignore @@ @@ -3469,7 +3469,7 @@ let compile_wasm_module = Type.funcref, ); - let compile_one = (dep_id, prog: mash_program) => { + let compile_one = (dep_id, prog: mash_code) => { let env = {...env, dep_id, compilation_mode: prog.compilation_mode}; ignore @@ compile_globals(wasm_mod, env, prog); ignore @@ compile_functions(wasm_mod, env, prog); @@ -3479,7 +3479,7 @@ let compile_wasm_module = }; List.iteri( - (dep_id, prog: mash_program) => { + (dep_id, {mash_code: prog}) => { switch (prog.compilation_mode) { | Runtime => Config.preserve_config(() => { diff --git a/compiler/src/codegen/emitmod.re b/compiler/src/codegen/emitmod.re index a4da0c536f..40fe98f172 100644 --- a/compiler/src/codegen/emitmod.re +++ b/compiler/src/codegen/emitmod.re @@ -29,7 +29,7 @@ let emit_object = (mashed: mash_program, outfile) => { let cmi = Marshal.to_bytes(mashed.signature, []); output_binary_int(oc, Bytes.length(cmi) + version_length + 12); output_bytes(oc, cmi); - Marshal.to_channel(oc, mashed, []); + Marshal.to_channel(oc, mashed.mash_code, []); close_out(oc); }; @@ -44,11 +44,17 @@ let load_object = (ic): mash_program => { if (read_version != Config.version) { raise(BadObject(InvalidVersion)); }; - let cmi_length = input_binary_int(ic); - seek_in(ic, cmi_length); - try(input_value(ic)) { - | _ => raise(BadObject(Corrupted)) - }; + let _ = input_binary_int(ic); + let signature: Cmi_format.cmi_infos = + try(input_value(ic)) { + | _ => raise(BadObject(Corrupted)) + }; + let mash_code: mash_code = + try(input_value(ic)) { + | _ => raise(BadObject(Corrupted)) + }; + + {signature, mash_code}; }; let load_object = object_file => { let ic = open_in_bin(object_file); diff --git a/compiler/src/codegen/linkedtree.re b/compiler/src/codegen/linkedtree.re index a7da4581dd..78e335c0d4 100644 --- a/compiler/src/codegen/linkedtree.re +++ b/compiler/src/codegen/linkedtree.re @@ -75,7 +75,7 @@ let link = main_mashtree => { let process_mashtree = (~main, dep, tree) => { let table_offset_global = { - id: tree.global_function_table_offset, + id: tree.mash_code.global_function_table_offset, mutable_: false, allocation_type: Types.Unmanaged(WasmI32), initial_value: @@ -86,7 +86,7 @@ let link = main_mashtree => { ), }; - let globals = [table_offset_global, ...tree.globals]; + let globals = [table_offset_global, ...tree.mash_code.globals]; let imports = List.fold_left( @@ -136,7 +136,7 @@ let link = main_mashtree => { }; }, [], - tree.imports, + tree.mash_code.imports, ); List.iter( @@ -176,22 +176,31 @@ let link = main_mashtree => { }; } }, - tree.exports, + tree.mash_code.exports, ); let exports = if (main) { - tree.exports; + tree.mash_code.exports; } else { []; }; num_function_table_elements := - num_function_table_elements^ + List.length(tree.function_table_elements); + num_function_table_elements^ + + List.length(tree.mash_code.function_table_elements); incr(dep_id); - {...tree, globals, imports, exports}; + { + ...tree, + mash_code: { + ...tree.mash_code, + globals, + imports, + exports, + }, + }; }; let programs = diff --git a/compiler/src/codegen/mashtree.re b/compiler/src/codegen/mashtree.re index c3b849a635..0c712111b9 100644 --- a/compiler/src/codegen/mashtree.re +++ b/compiler/src/codegen/mashtree.re @@ -551,6 +551,11 @@ and stack_size = { [@deriving sexp] type mash_program = { + mash_code, + signature: [@sexp.opaque] Cmi_format.cmi_infos, +} + +and mash_code = { functions: list(mash_function), imports: list(import), exports: list(export), @@ -560,7 +565,6 @@ type mash_program = { function_table_elements: list(string), global_function_table_offset: Ident.t, compilation_mode: Grain_utils.Config.compilation_mode, - signature: [@sexp.opaque] Cmi_format.cmi_infos, type_metadata: [@sexp.opaque] list(Types.type_metadata), [@sexp_drop_if sexp_locs_disabled] prog_loc: Location.t, diff --git a/compiler/src/codegen/transl_anf.re b/compiler/src/codegen/transl_anf.re index b4bb24de21..0fa9f1068a 100644 --- a/compiler/src/codegen/transl_anf.re +++ b/compiler/src/codegen/transl_anf.re @@ -1115,17 +1115,19 @@ let transl_anf_program = let compilation_mode = Config.compilation_mode^; { - functions, - imports, - exports, - main_body, - main_body_stack_size, - globals, - function_table_elements, - global_function_table_offset, - compilation_mode, signature, - type_metadata: anf_prog.type_metadata, - prog_loc: anf_prog.prog_loc, + mash_code: { + functions, + imports, + exports, + main_body, + main_body_stack_size, + globals, + function_table_elements, + global_function_table_offset, + compilation_mode, + type_metadata: anf_prog.type_metadata, + prog_loc: anf_prog.prog_loc, + }, }; }; diff --git a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot index 7e49d66823..ff73c2b966 100644 --- a/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot +++ b/compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot @@ -1,31 +1,33 @@ arrays › array_access -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot b/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot index 58fc2ee09f..e4fac972ce 100644 --- a/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot +++ b/compiler/test/__snapshots__/arrays.1deb7b51.0.snapshot @@ -1,32 +1,34 @@ arrays › array_access5 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 -3))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot b/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot index f151bcdb86..04fd701692 100644 --- a/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot +++ b/compiler/test/__snapshots__/arrays.24453e6e.0.snapshot @@ -1,18 +1,20 @@ arrays › array1_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot index 13a9065071..f0f421f443 100644 --- a/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot +++ b/compiler/test/__snapshots__/arrays.28fcc534.0.snapshot @@ -1,31 +1,33 @@ arrays › array_access4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 -2))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot index 08dbd70e2c..46610c6406 100644 --- a/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot +++ b/compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot @@ -1,31 +1,33 @@ arrays › array_access2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot index 70183a1e2d..806c31c587 100644 --- a/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot +++ b/compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot @@ -1,31 +1,33 @@ arrays › array_access3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot index adc0069b6a..0e898b2893 100644 --- a/compiler/test/__snapshots__/arrays.74d79181.0.snapshot +++ b/compiler/test/__snapshots__/arrays.74d79181.0.snapshot @@ -1,31 +1,33 @@ arrays › array_access5 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MArrayOp - (MArrayGet - ((immediate_desc (MImmConst (MConstI32 -3))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MArrayOp + (MArrayGet + ((immediate_desc (MImmConst (MConstI32 -3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot b/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot index bbd587e825..571dee1c9f 100644 --- a/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot +++ b/compiler/test/__snapshots__/arrays.9e17b4d1.0.snapshot @@ -1,18 +1,20 @@ arrays › array3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot b/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot index 343071485d..0f24a68542 100644 --- a/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot +++ b/compiler/test/__snapshots__/arrays.b85cb7fc.0.snapshot @@ -1,18 +1,20 @@ arrays › array1_trailing_space -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot index c6d99b1874..ff2b2c35d7 100644 --- a/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot @@ -1,55 +1,58 @@ basic functionality › assignment1 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind t_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind t_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name t))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot index 17fd9e9315..a0ed58fc86 100644 --- a/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.00cfdb2e.0.snapshot @@ -1,13 +1,15 @@ basic functionality › binop2.4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -2))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot b/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot index 975015b113..8269110388 100644 --- a/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.03de4778.0.snapshot @@ -1,13 +1,15 @@ basic functionality › neg -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -40))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -40))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot index 66f8fcc2cd..42778382f2 100644 --- a/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.040643b3.0.snapshot @@ -1,48 +1,50 @@ basic functionality › comp5 -((functions ()) - (imports - (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot index 70d8f44919..3e45ab5b96 100644 --- a/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot @@ -1,25 +1,27 @@ basic functionality › assignment1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind t_1113 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) + ((immediate_desc (MImmConst (MConstI32 1))) (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MSet (MGlobalBind t_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name t))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot index 467b63cf88..1ecad18ebd 100644 --- a/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0996c5f7.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo4 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 -17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 17))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot index 8b0f041873..a868528bbf 100644 --- a/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0a230f18.0.snapshot @@ -1,33 +1,35 @@ basic functionality › land4 -((functions ()) - (imports - (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func &_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot index 584c762767..8bc8806c60 100644 --- a/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0a2e4afa.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lxor1 -((functions ()) - (imports - (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ^_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot index a51e6996fc..c291df0772 100644 --- a/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0c0b170b.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lor1 -((functions ()) - (imports - (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func |_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot index 0a542c8340..990fb85f5d 100644 --- a/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0c400bde.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo6 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 17))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot index f3a56107b8..88510abd4a 100644 --- a/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0e812a39.0.snapshot @@ -1,58 +1,60 @@ basic functionality › precedence1 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot b/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot index 84f8e83932..cec73d2f8b 100644 --- a/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.0f79ce35.0.snapshot @@ -1,34 +1,38 @@ basic functionality › comp16 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot b/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot index ca4645dced..aa2b2d96c6 100644 --- a/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.10dda088.0.snapshot @@ -1,48 +1,51 @@ basic functionality › comp3 -((functions ()) - (imports - (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func >=_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >=_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot index eb165c8810..58f96d8aa6 100644 --- a/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.122e74b0.0.snapshot @@ -1,50 +1,52 @@ basic functionality › print_line_ending1 -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func print_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot index c6ef4f5ee6..3b6a064392 100644 --- a/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.125626a9.0.snapshot @@ -1,33 +1,35 @@ basic functionality › orshadow -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func +_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot b/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot index 2129eaacb0..b1c87767c6 100644 --- a/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.13335202.0.snapshot @@ -1,58 +1,60 @@ basic functionality › precedence2 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot index ea8bcce9d7..aafc3d5bda 100644 --- a/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1ad0f349.0.snapshot @@ -1,58 +1,60 @@ basic functionality › precedence3 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func %_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func %_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot index e08790f3b2..43cbf7b6b3 100644 --- a/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1ae16d82.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop4 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func *_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func *_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot index 5b1d94acd5..c4e606af15 100644 --- a/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1b68c8db.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lsl1 -((functions ()) - (imports - (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func <<_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 7))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func <<_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot index 4ba4f71b16..88d0a89219 100644 --- a/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot @@ -1,101 +1,110 @@ basic functionality › unsafe_wasm_globals -((functions ()) - (imports - (((mimp_id ((name _F64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) - (mimp_name _F64_VAL) (mimp_type (MGlobalImport (Unmanaged WasmF64) true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printF64) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmF64)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printF64) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name _F32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) - (mimp_name _F32_VAL) (mimp_type (MGlobalImport (Unmanaged WasmF32) true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printF32) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmF32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printF32) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name _I64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) - (mimp_name _I64_VAL) (mimp_type (MGlobalImport (Unmanaged WasmI64) true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printI64) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI64)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printI64) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name _I32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) - (mimp_name _I32_VAL) (mimp_type (MGlobalImport (Unmanaged WasmI32) true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printI32) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) - (mimp_name printI32) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func printI32_1152) - (closure - ((immediate_desc (MImmBinding (MGlobalBind printI32_1152 Managed))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MGlobalBind _I32_VAL_1153 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func printI64_1154) - (closure - ((immediate_desc (MImmBinding (MGlobalBind printI64_1154 Managed))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI64)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MGlobalBind _I64_VAL_1155 (Unmanaged WasmI64)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func printF32_1156) - (closure - ((immediate_desc (MImmBinding (MGlobalBind printF32_1156 Managed))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmF32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MGlobalBind _F32_VAL_1157 (Unmanaged WasmF32)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func printF64_1158) - (closure - ((immediate_desc (MImmBinding (MGlobalBind printF64_1158 Managed))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmF64)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MGlobalBind _F64_VAL_1159 (Unmanaged WasmF64)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name _F64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _F64_VAL) + (mimp_type (MGlobalImport (Unmanaged WasmF64) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF64) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmF64)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printF64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF64) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _F32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _F32_VAL) + (mimp_type (MGlobalImport (Unmanaged WasmF32) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF32) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmF32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printF32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printF32) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _I64_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _I64_VAL) + (mimp_type (MGlobalImport (Unmanaged WasmI64) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI64) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI64)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printI64))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI64) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name _I32_VAL))) (mimp_mod unsafeWasmGlobalsExports.gr) + (mimp_name _I32_VAL) + (mimp_type (MGlobalImport (Unmanaged WasmI32) true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI32) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name printI32))) (mimp_mod runtime/debugPrint.gr) + (mimp_name printI32) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printI32_1152) + (closure + ((immediate_desc + (MImmBinding (MGlobalBind printI32_1152 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _I32_VAL_1153 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printI64_1154) + (closure + ((immediate_desc + (MImmBinding (MGlobalBind printI64_1154 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI64)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _I64_VAL_1155 (Unmanaged WasmI64)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func printF32_1156) + (closure + ((immediate_desc + (MImmBinding (MGlobalBind printF32_1156 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmF32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _F32_VAL_1157 (Unmanaged WasmF32)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func printF64_1158) + (closure + ((immediate_desc (MImmBinding (MGlobalBind printF64_1158 Managed))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmF64)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MGlobalBind _F64_VAL_1159 (Unmanaged WasmF64)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot index 0dd7da0483..e38c80bf47 100644 --- a/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1d2ec323.0.snapshot @@ -1,107 +1,109 @@ basic functionality › comp22 -((functions ()) - (imports - (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func isnt_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot index 4aa86f09a0..cb6a6e39a0 100644 --- a/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1e4b1f39.0.snapshot @@ -1,33 +1,35 @@ basic functionality › land1 -((functions ()) - (imports - (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func &_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot b/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot index 9310368cbc..8b43f4d367 100644 --- a/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.1f787365.0.snapshot @@ -1,52 +1,55 @@ basic functionality › orshort2 -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot index efa319c05d..ecfefff71e 100644 --- a/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.20f7581b.0.snapshot @@ -1,13 +1,15 @@ basic functionality › simple_min -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -1073741824))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -1073741824))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot index dbbed7c9c4..1f8d20465f 100644 --- a/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.240ef39e.0.snapshot @@ -1,48 +1,50 @@ basic functionality › comp4 -((functions ()) - (imports - (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func >_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot index c4cb5f237a..6f5dc835d5 100644 --- a/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2756b429.0.snapshot @@ -1,13 +1,15 @@ basic functionality › forty -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 40))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 40))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot b/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot index 1fe5a735e7..432c141a10 100644 --- a/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.27a7e2f7.0.snapshot @@ -1,9 +1,11 @@ basic functionality › bigint_start_pos -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MBigInt (flags ()) (limbs (-1)))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MBigInt (flags ()) (limbs (-1)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot index c85a425567..47a630d275 100644 --- a/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.28405f1f.0.snapshot @@ -1,58 +1,60 @@ basic functionality › precedence4 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func %_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func %_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot index 3758891900..f8d2b474c5 100644 --- a/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.28bf4c9e.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop2 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func -_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot index 8106e7a605..0dc01ece7b 100644 --- a/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2bcc447b.0.snapshot @@ -1,95 +1,98 @@ basic functionality › assert2 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1116) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MString - \"AssertionError: Assertion failed in assert2, line 1\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 29))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 32))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MPrim1 Throw - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MString + \"AssertionError: Assertion failed in assert2, line 1\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 29))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 32))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MPrim1 Throw + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot index 1cbb461b95..25fc9f055c 100644 --- a/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2cb30a54.0.snapshot @@ -1,10 +1,13 @@ basic functionality › bigint_start_neg -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc (MAllocate (MBigInt (flags (BigIntNegative)) (limbs (-1)))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate (MBigInt (flags (BigIntNegative)) (limbs (-1)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot index 167643539d..99b6e76107 100644 --- a/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2d7e34cf.0.snapshot @@ -1,13 +1,15 @@ basic functionality › and2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot index 549f6056db..c4fd01cc01 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f2f8795.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lsl2 -((functions ()) - (imports - (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func <<_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <<))) (mimp_mod pervasives.gr) (mimp_name <<) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func <<_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <<_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot index 6116f9b0c7..2816887d20 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f53324c.0.snapshot @@ -1,34 +1,37 @@ basic functionality › comp17 -((functions ()) - (imports - (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func isnt_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot index 96a8a8d80d..e26d7c5c88 100644 --- a/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.2f65c8cf.0.snapshot @@ -1,13 +1,15 @@ basic functionality › fals -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot index 2aba1f7321..73ac1cb3d8 100644 --- a/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.304ca65f.0.snapshot @@ -1,13 +1,15 @@ basic functionality › oct_neg -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -63))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -63))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot b/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot index d1e74fd4f9..eaea29585b 100644 --- a/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.31e0d562.0.snapshot @@ -1,9 +1,11 @@ basic functionality › infinity -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 9218868437227405312)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 9218868437227405312)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot b/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot index 87d276037a..95fb7aec20 100644 --- a/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.32a8c452.0.snapshot @@ -1,71 +1,73 @@ basic functionality › complex2 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func +_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func print_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot b/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot index 0c685317b3..59db7119e7 100644 --- a/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.34dcfbdd.0.snapshot @@ -1,9 +1,11 @@ basic functionality › int64_1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MInt64 99999999999999999)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 99999999999999999)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot index d838604ae5..f3602a6b3a 100644 --- a/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3c2ba165.0.snapshot @@ -1,123 +1,125 @@ basic functionality › comp20 -((functions ()) - (imports - (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func isnt_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot index 3032f97169..05f87b0761 100644 --- a/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3e5f990b.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lor3 -((functions ()) - (imports - (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func |_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot index fe5aac76f9..06f4509914 100644 --- a/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3edefd23.0.snapshot @@ -1,30 +1,32 @@ basic functionality › decr_3 -((functions ()) - (imports - (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func decr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot index a1d5e014be..bedb9f830d 100644 --- a/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.3ffd0bf3.0.snapshot @@ -1,13 +1,15 @@ basic functionality › orshort1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot b/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot index ac894d738f..1e087eb3d3 100644 --- a/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.427c6671.0.snapshot @@ -1,9 +1,11 @@ basic functionality › uint64_1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MUint64 99999999999999999)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MUint64 99999999999999999)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot b/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot index c3a2256754..5cbb1df97b 100644 --- a/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.448497ab.0.snapshot @@ -1,13 +1,15 @@ basic functionality › binop5 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot b/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot index abc07701fa..9ae9f34952 100644 --- a/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.46348f36.0.snapshot @@ -1,66 +1,69 @@ basic functionality › precedence5 -((functions ()) - (imports - (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func >_1114) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MReturnCallKnown (func <_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 13))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - (((instr_desc - (MReturnCallKnown (func <_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 13))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot index 2920904cc2..279a92c570 100644 --- a/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.48db380c.0.snapshot @@ -1,13 +1,15 @@ basic functionality › if4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot index f0374692eb..3bccce3c18 100644 --- a/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.4d6f9417.0.snapshot @@ -1,13 +1,15 @@ basic functionality › not1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot b/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot index 9c2a1be3c3..29538fd135 100644 --- a/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.4f5bd247.0.snapshot @@ -1,9 +1,11 @@ basic functionality › heap_number_i64_wrapper -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MInt64 2147483648)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 2147483648)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot index 7b07f958d4..11b09b26f0 100644 --- a/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.52ca8e0e.0.snapshot @@ -1,140 +1,145 @@ basic functionality › func_shadow -((functions - (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup (((instr_desc (MAllocate (MString bar))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup (((instr_desc (MAllocate (MString baz))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString bar))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString baz))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1118 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MCallKnown (func foo_1115) + (MCallKnown (func print_1118) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) + ((immediate_desc + (MImmBinding (MGlobalBind print_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MReturnCallKnown (func print_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1118 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func foo_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot b/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot index 7e1547b370..c0a321c3e4 100644 --- a/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.565dbeda.0.snapshot @@ -1,13 +1,15 @@ basic functionality › hex_neg -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -255))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -255))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot index 4e7e0ee573..36656fdc9f 100644 --- a/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5705b20c.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo5 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 -17))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot index 7e55a931ea..3424e21c40 100644 --- a/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.593b8d63.0.snapshot @@ -1,93 +1,95 @@ basic functionality › if_one_sided6 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1121) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1121 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) ((instr_desc - (MSet (MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot index 7905be67b1..15e3a2b9ea 100644 --- a/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5b56d472.0.snapshot @@ -1,13 +1,15 @@ basic functionality › and3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot index 4cecbd4d17..449f836455 100644 --- a/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5cd54e52.0.snapshot @@ -1,13 +1,15 @@ basic functionality › or4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot index b3e6e5ab3b..fb1de315ab 100644 --- a/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.5d973a3e.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop6 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot index f96d4cdde1..6c4d442e67 100644 --- a/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.61c58118.0.snapshot @@ -1,45 +1,47 @@ basic functionality › block_no_expression -((functions - (((id ((name f))) (name (f)) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name f))) (name (f)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind f_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind f_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func f_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind f_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() ((Unmanaged WasmI32)))) (args ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name f))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func f_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind f_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() ((Unmanaged WasmI32)))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name f))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot index 277bbce0d5..3662d037ff 100644 --- a/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.626b2e44.0.snapshot @@ -1,87 +1,89 @@ basic functionality › if_one_sided5 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1121) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1121 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind x_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot b/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot index d5b7e732bb..f9f841905d 100644 --- a/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.65d36891.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lor2 -((functions ()) - (imports - (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func |_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot b/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot index dedfc7d940..1e628e3985 100644 --- a/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.67d2cc45.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop3 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func -_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot b/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot index 030ca58336..7237c486b4 100644 --- a/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.684b6ecb.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop2.2 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func -_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot b/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot index f2b197d83b..dcadd29830 100644 --- a/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.68d08483.0.snapshot @@ -1,33 +1,35 @@ basic functionality › land2 -((functions ()) - (imports - (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func &_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot index 0490300ad6..0cee1d39ad 100644 --- a/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.6f9706c2.0.snapshot @@ -1,13 +1,15 @@ basic functionality › or1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot index a100bc53ce..be84a1a89a 100644 --- a/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.704872bc.0.snapshot @@ -1,13 +1,15 @@ basic functionality › assert1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot index 26b4d1d323..0f5bced37e 100644 --- a/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.711a4824.0.snapshot @@ -1,519 +1,530 @@ basic functionality › pattern_match_unsafe_wasm -((functions - (((id ((name test))) (name (test)) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions + (((id ((name test))) (name (test)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func foo_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func foo_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func foo_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 5)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func foo_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 8)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func foo_1114) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 42)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs (((txt Unsafe))))) - ((id ((name foo))) (name ()) (args (Managed (Unmanaged WasmI32))) - (return_type ((Unmanaged WasmI32))) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 5)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func foo_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 8)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1114) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (((Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 42)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs (((txt Unsafe))))) + ((id ((name foo))) (name ()) (args (Managed (Unmanaged WasmI32))) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 3)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 4)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 5)))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MArgBind 1 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 6)))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 6))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))))))))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (1 + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT ((immediate_desc - (MImmBinding (MArgBind 1 (Unmanaged WasmI32)))) + (MImmConst (MConstI32 250551095))) (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 3)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MArgBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 4)))) - (immediate_analyses ((last_usage Unknown)))))))))))) + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MStore + (((MLocalBind 4 Managed) ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MArgBind 1 (Unmanaged WasmI32)))) - (immediate_analyses - ((last_usage Unknown)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstI32 5)))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MArgBind 1 (Unmanaged WasmI32)))) - (immediate_analyses - ((last_usage Last)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstI32 6)))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 5))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 6))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))))))))))))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc - (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (1 - (((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 - (((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (5 - (((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (6 + (MAllocate + (MADT + ((immediate_desc + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (5 + (((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (6 + (((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc + (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc (MAllocate (MString other))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) (((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc (MAllocate (MString other))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 8) (stack_size_i32 7) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs (((txt Unsafe))))))) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind test_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func test_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind test_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() ((Unmanaged WasmI32)))) (args ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name test))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 8) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs (((txt Unsafe))))))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind test_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func test_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind test_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() ((Unmanaged WasmI32)))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name test))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot index 56804653d3..ddcbb01c71 100644 --- a/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7222ab37.0.snapshot @@ -1,13 +1,15 @@ basic functionality › tru -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot index 208bf196d8..22c86339ec 100644 --- a/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7287219f.0.snapshot @@ -1,33 +1,35 @@ basic functionality › asr1 -((functions ()) - (imports - (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func >>_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 179))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 179))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot index ee5b51bf01..d914f6a6ec 100644 --- a/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot @@ -1,55 +1,58 @@ basic functionality › assignment1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind t_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind t_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name t))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot index b4e658abfd..a982d4d766 100644 --- a/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7848308f.0.snapshot @@ -1,13 +1,15 @@ basic functionality › or3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot index b74e78cf4a..18c1b2e5db 100644 --- a/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot @@ -1,55 +1,58 @@ basic functionality › assignment1 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind t_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind t_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name t))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot index 2630e9ad29..9b271d8917 100644 --- a/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7b13e79a.0.snapshot @@ -1,13 +1,15 @@ basic functionality › and4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot index b8da694fa1..ea8ad97f9a 100644 --- a/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7bb7b0d4.0.snapshot @@ -1,9 +1,11 @@ basic functionality › uint32_1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MUint32 42)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MUint32 42)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot index 396e01d17a..b3abe3f2e6 100644 --- a/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7beffe4d.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp5 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4650610929073913856)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650610929073913856)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot index 59781da516..210819e0aa 100644 --- a/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7ccc4940.0.snapshot @@ -1,13 +1,15 @@ basic functionality › division1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRational (numerator_flags ()) (numerator_limbs (5)) - (denominator_flags ()) (denominator_limbs (2)))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (5)) + (denominator_flags ()) (denominator_limbs (2)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot index 72e554d89b..a66208cba1 100644 --- a/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.7d0640b4.0.snapshot @@ -1,81 +1,83 @@ basic functionality › if_one_sided2 -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func >_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MReturnCallKnown (func print_1117) - (closure - ((immediate_desc - (MIncRef +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >_1114) + (closure ((immediate_desc - (MImmBinding (MGlobalBind print_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot b/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot index ae35121728..f3408c549b 100644 --- a/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.83f51526.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp3 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4584664420663164928)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4584664420663164928)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot b/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot index 6964ec0685..2e522aa139 100644 --- a/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.86f332c6.0.snapshot @@ -1,13 +1,15 @@ basic functionality › bin_neg -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot b/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot index 9707a9e316..0140a89924 100644 --- a/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.8c8313f3.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp2 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4630826316843712512)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4630826316843712512)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot b/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot index 7af3ec5687..b1718e51ff 100644 --- a/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.8e01d666.0.snapshot @@ -1,9 +1,11 @@ basic functionality › infinity_neg -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 -4503599627370496)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 -4503599627370496)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot b/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot index 1e43425908..e4be116cef 100644 --- a/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.903ff701.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp4 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4650529565213458432)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650529565213458432)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot index b73d83555c..9607462b53 100644 --- a/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9110d0f5.0.snapshot @@ -1,34 +1,36 @@ basic functionality › comp13 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot index dc6776940f..09b6725166 100644 --- a/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9157dba1.0.snapshot @@ -1,33 +1,35 @@ basic functionality › andshadow -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func +_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot index ed354172e7..39f78207c9 100644 --- a/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9379df0d.0.snapshot @@ -1,95 +1,97 @@ basic functionality › comp21 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot b/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot index 3ecd5c03b0..7146f733f8 100644 --- a/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.950b8fda.0.snapshot @@ -1,13 +1,15 @@ basic functionality › binop2.3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 -2))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 -2))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot index 34dca4d971..2104f71139 100644 --- a/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.970a2a2b.0.snapshot @@ -1,13 +1,15 @@ basic functionality › not2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot b/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot index b3a5c47b23..e2b194c10b 100644 --- a/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.974b7936.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lxor3 -((functions ()) - (imports - (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ^_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot b/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot index f2b9b0402b..2ae1d81007 100644 --- a/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.994117f8.0.snapshot @@ -1,30 +1,32 @@ basic functionality › incr_3 -((functions ()) - (imports - (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func incr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 -1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot index e2b66619df..0d3289b3e4 100644 --- a/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9b9c7047.0.snapshot @@ -1,9 +1,11 @@ basic functionality › void -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MString foo)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot index 00713ee6dc..8d941657cb 100644 --- a/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9c18b19d.0.snapshot @@ -1,61 +1,63 @@ basic functionality › if_one_sided3 -((functions ()) - (imports - (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MSet (MGlobalBind x_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot index 0d83cdd05d..096c5d3c8a 100644 --- a/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9df4a5e0.0.snapshot @@ -1,13 +1,15 @@ basic functionality › and1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot index a69e5d27f6..0a534c7811 100644 --- a/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.9fb01eb5.0.snapshot @@ -1,13 +1,15 @@ basic functionality › simple_max -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1073741823))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1073741823))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot index 8f40c52db0..d9dccfe7a3 100644 --- a/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a0045d1c.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot index 14c14ad851..0976b6a056 100644 --- a/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a0747361.0.snapshot @@ -1,13 +1,15 @@ basic functionality › hex -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 255))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 255))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot index c6433cc329..df301134b2 100644 --- a/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a2e63440.0.snapshot @@ -1,48 +1,51 @@ basic functionality › comp9 -((functions ()) - (imports - (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func >=_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >=_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 11))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func >=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 11))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot index 182b21c4a3..d59be4f6c7 100644 --- a/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a3f7e180.0.snapshot @@ -1,37 +1,39 @@ basic functionality › bigint_1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc (MAllocate (MInt64 9223372036854775807))))))))) - ((instr_desc - (MReturnCallKnown (func +_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MInt64 9223372036854775807))))))))) + ((instr_desc + (MReturnCallKnown (func +_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot index 2fee0217e1..033b41397e 100644 --- a/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a4ec9fca.0.snapshot @@ -1,13 +1,15 @@ basic functionality › andshort2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot index b9269d16a0..f289c388b7 100644 --- a/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a58a9361.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lxor2 -((functions ()) - (imports - (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ^_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot index fd346ab509..964fd4f60f 100644 --- a/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a5d5182f.0.snapshot @@ -1,49 +1,52 @@ basic functionality › comp2 -((functions ()) - (imports - (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <=_1114) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind <=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <=_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot b/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot index 68656b7de0..12d2161f51 100644 --- a/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.a72898d0.0.snapshot @@ -1,48 +1,51 @@ basic functionality › comp8 -((functions ()) - (imports - (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <=_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <=_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 11))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <=))) (mimp_mod pervasives.gr) (mimp_name <=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <=_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind <=_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 11))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot index 38ee6772ef..fa6cdb1360 100644 --- a/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.abd9d13c.0.snapshot @@ -1,48 +1,51 @@ basic functionality › comp7 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 8))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot index 871e63ed40..87045debfa 100644 --- a/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b07cc734.0.snapshot @@ -1,81 +1,83 @@ basic functionality › if_one_sided -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MReturnCallKnown (func print_1117) - (closure - ((immediate_desc - (MIncRef +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure ((immediate_desc - (MImmBinding (MGlobalBind print_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot index 9d988a27c7..5060a0ee11 100644 --- a/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b6a1b657.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lxor4 -((functions ()) - (imports - (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ^_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ^))) (mimp_mod pervasives.gr) (mimp_name ^) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ^_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ^_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot b/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot index 8607e552be..1a26954158 100644 --- a/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.b836b89a.0.snapshot @@ -1,95 +1,98 @@ basic functionality › complex1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func +_1127) + (MCallKnown (func print_1120) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1127 Managed))) + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) (immediate_analyses ((last_usage Last)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) (args - (((immediate_desc (MImmConst (MConstI32 4))) + (((immediate_desc (MImmConst (MConstI32 3))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func -_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1127) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1127 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func -_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot index e8eb90b995..c2d9ffaefa 100644 --- a/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bb137371.0.snapshot @@ -1,55 +1,58 @@ basic functionality › assignment1 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind t_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind t_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind t_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind t_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind t_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind t_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name t))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name t))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot index e9e1c1d029..6409360d80 100644 --- a/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bd891a1f.0.snapshot @@ -1,13 +1,15 @@ basic functionality › oct -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 63))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 63))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot b/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot index 1dd0829dbc..a972ebe465 100644 --- a/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.bef9449e.0.snapshot @@ -1,49 +1,51 @@ basic functionality › comp1 -((functions ()) - (imports - (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1114) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot index 8583c44da6..9ba7cf16a5 100644 --- a/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c1554a92.0.snapshot @@ -1,13 +1,15 @@ basic functionality › or2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot index 3ee849c72a..c09d426c69 100644 --- a/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c2c74be4.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lsr2 -((functions ()) - (imports - (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func >>>_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot index 73e3cb59aa..a74fa23862 100644 --- a/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c4090bb1.0.snapshot @@ -1,196 +1,204 @@ basic functionality › toplevel_statements -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind five_1117 Managed) + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1126) + (MCallKnown (func print_1120) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) (args (((immediate_desc (MImmConst (MConstI32 2))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind five_1117 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind five_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc (MAllocate (MString foo)))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name five))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind five_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name five))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot index d343ea96f4..b16a3cd64e 100644 --- a/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c49928a5.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lsr1 -((functions ()) - (imports - (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func >>>_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 7))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>>))) (mimp_mod pervasives.gr) (mimp_name >>>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot index e88e1c8ee1..fb0089a2b8 100644 --- a/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c55feb83.0.snapshot @@ -1,34 +1,37 @@ basic functionality › comp14 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot index 730a8b2739..f217719712 100644 --- a/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c8095f7c.0.snapshot @@ -1,30 +1,32 @@ basic functionality › incr_1 -((functions ()) - (imports - (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func incr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot b/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot index 454dad58b4..38389b5f14 100644 --- a/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.c8144b17.0.snapshot @@ -1,13 +1,15 @@ basic functionality › bin -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot index aa6eca1c8b..e087021ecb 100644 --- a/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cb9c6c66.0.snapshot @@ -1,30 +1,32 @@ basic functionality › incr_2 -((functions ()) - (imports - (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func incr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name incr))) (mimp_mod pervasives.gr) (mimp_name incr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func incr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind incr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot index b4b96521e8..7f45e0e7ee 100644 --- a/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cdeddcd2.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo3 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 -17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 -4))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot b/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot index 5abcea6adc..8d2fbe6e21 100644 --- a/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.cefeb364.0.snapshot @@ -1,33 +1,35 @@ basic functionality › lor4 -((functions ()) - (imports - (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func |_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name |))) (mimp_mod pervasives.gr) (mimp_name |) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func |_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind |_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot index 653666ee36..375c1bdd66 100644 --- a/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d0c0c62b.0.snapshot @@ -1,33 +1,35 @@ basic functionality › int64_pun_1 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func *_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 9999999))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 99999999))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func *_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 9999999))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 99999999))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot index 0fa3481229..94439c2814 100644 --- a/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d0cb4f44.0.snapshot @@ -1,30 +1,32 @@ basic functionality › decr_1 -((functions ()) - (imports - (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func decr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot index 03b2f51dfb..21b15ac8bb 100644 --- a/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d124f931.0.snapshot @@ -1,13 +1,15 @@ basic functionality › nil -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot index 91f0814b64..0bcdc9a233 100644 --- a/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d6ca4146.0.snapshot @@ -1,52 +1,55 @@ basic functionality › andshort1 -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MCallKnown (func print_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot index 368a8f31aa..30b4c8bc66 100644 --- a/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d8a7dcf9.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo1 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 -17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot index 20b2f67827..8c14b8d703 100644 --- a/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d8f6f027.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4629700416936869888)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4629700416936869888)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot b/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot index bbd1afde6c..b92471b26c 100644 --- a/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.d9fc01df.0.snapshot @@ -1,33 +1,35 @@ basic functionality › land3 -((functions ()) - (imports - (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func &_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name &))) (mimp_mod pervasives.gr) (mimp_name &) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func &_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind &_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot b/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot index 1bd882aaf2..cbb46198f9 100644 --- a/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.dbf5d3ff.0.snapshot @@ -1,33 +1,35 @@ basic functionality › comp18 -((functions ()) - (imports - (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func isnt_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name isnt))) (mimp_mod pervasives.gr) (mimp_name isnt) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func isnt_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind isnt_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot b/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot index 47afb004ca..7e2563d2bb 100644 --- a/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.df4cd2bf.0.snapshot @@ -1,34 +1,37 @@ basic functionality › comp15 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot index ff77cef932..9409d51ad0 100644 --- a/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e2902464.0.snapshot @@ -1,58 +1,60 @@ basic functionality › comp10 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1119 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot index fab702e7f8..d40f3d39ac 100644 --- a/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e3995c7d.0.snapshot @@ -1,67 +1,69 @@ basic functionality › if_one_sided4 -((functions ()) - (imports - (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func <_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MSet (MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (((instr_desc +((mash_code + ((functions ()) + (imports + (((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name <))) (mimp_mod pervasives.gr) (mimp_name <) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func <_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind <_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot index 0ab708089b..8388c68955 100644 --- a/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e56cd2a2.0.snapshot @@ -1,48 +1,51 @@ basic functionality › comp6 -((functions ()) - (imports - (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 8))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown))))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot index 3f355b55c9..cafa3ae254 100644 --- a/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e58c3266.0.snapshot @@ -1,33 +1,35 @@ basic functionality › asr2 -((functions ()) - (imports - (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func >>_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >>))) (mimp_mod pervasives.gr) (mimp_name >>) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func >>_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind >>_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot index f9fd91c219..3f17255425 100644 --- a/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e6ea6b06.0.snapshot @@ -1,9 +1,11 @@ basic functionality › int32_1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MInt32 42)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt32 42)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot b/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot index ca9b39d597..0271065ebf 100644 --- a/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.e811c1e1.0.snapshot @@ -1,33 +1,35 @@ basic functionality › binop2.1 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func -_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot b/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot index 63fe01a693..35b4622b8e 100644 --- a/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.ee7c0ebc.0.snapshot @@ -1,33 +1,35 @@ basic functionality › modulo2 -((functions ()) - (imports - (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func %_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 17))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 -4))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name %))) (mimp_mod pervasives.gr) (mimp_name %) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func %_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind %_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 -4))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot index 017a6cdfdc..bc5f9e86a7 100644 --- a/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f132ca8b.0.snapshot @@ -1,30 +1,32 @@ basic functionality › decr_2 -((functions ()) - (imports - (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func decr_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name decr))) (mimp_mod pervasives.gr) (mimp_name decr) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func decr_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind decr_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot index 670548bbb4..8f2c4f7796 100644 --- a/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f47797ca.0.snapshot @@ -1,9 +1,11 @@ basic functionality › hex_dec_exp5 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MFloat64 4650599933957636096)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MFloat64 4650599933957636096)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot index 53f7326bf1..faec0a0202 100644 --- a/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f58be537.0.snapshot @@ -1,111 +1,113 @@ basic functionality › comp19 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot index 09d635affb..fc9dc064e5 100644 --- a/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f90a3baa.0.snapshot @@ -1,9 +1,11 @@ basic functionality › heap_number_i32_wrapper_max -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MInt64 2147483647)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 2147483647)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot b/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot index 997ce6d1db..b61f66b91f 100644 --- a/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.f9743171.0.snapshot @@ -1,9 +1,11 @@ basic functionality › heap_number_i32_wrapper -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MInt64 1073741824)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MInt64 1073741824)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot index efe331610b..4a13750be9 100644 --- a/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fd64a58f.0.snapshot @@ -1,33 +1,35 @@ basic functionality › int64_pun_2 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func -_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 -99999999))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 999999999))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func -_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 -99999999))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 999999999))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot index a9ac09db27..396b820c9a 100644 --- a/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fe19cffe.0.snapshot @@ -1,12 +1,14 @@ basic functionality › bigint_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MBigInt (flags ()) (limbs (-7851998425750883293 1164749010670168)))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MBigInt (flags ()) (limbs (-7851998425750883293 1164749010670168)))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot index 5822d17a0f..88f723aa4d 100644 --- a/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot +++ b/compiler/test/__snapshots__/basic_functionality.fe88cb04.0.snapshot @@ -1,231 +1,239 @@ basic functionality › func_shadow_and_indirect_call -((functions - (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup (((instr_desc (MAllocate (MString bar))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup (((instr_desc (MAllocate (MString baz))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString bar))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString baz))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1130) + (arity 1) (variables ()))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed)) (return_type (Managed)) + (closure (0)) + (body + (((instr_desc + (MCleanup (((instr_desc (MAllocate (MString qux))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1130) - (arity 1) (variables ()))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name func))) (name ()) (args (Managed)) (return_type (Managed)) - (closure (0)) - (body - (((instr_desc - (MCleanup (((instr_desc (MAllocate (MString qux))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1121) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MCallKnown (func foo_1115) + (MCallKnown (func print_1121) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) + ((immediate_desc + (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1121) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1117 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1119 Managed) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func foo_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func foo_1117) + (MCallKnown (func print_1121) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MCallIndirect - (func - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1119 Managed))) - (immediate_analyses ((last_usage Last)))))) + ((immediate_desc + (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ()))))))))) - ((instr_desc - (MReturnCallKnown (func print_1121) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements (func_1134)) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1117 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1119 Managed) + ((instr_desc + (MCallKnown (func foo_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1121) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1121 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements (func_1134)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot index ae973865ed..fd27c7f602 100644 --- a/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot +++ b/compiler/test/__snapshots__/boxes.08fca3f7.0.snapshot @@ -1,61 +1,63 @@ boxes › box_subtraction1 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot index 7830665191..8697d6fcd5 100644 --- a/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.0c59fc4e.0.snapshot @@ -1,68 +1,70 @@ boxes › box_multiplication2 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.17668725.0.snapshot b/compiler/test/__snapshots__/boxes.17668725.0.snapshot index 8d9f2affef..7671e60053 100644 --- a/compiler/test/__snapshots__/boxes.17668725.0.snapshot +++ b/compiler/test/__snapshots__/boxes.17668725.0.snapshot @@ -1,68 +1,70 @@ boxes › box_division2 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 76))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot index dab1eb636b..5c8ebfef4f 100644 --- a/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot +++ b/compiler/test/__snapshots__/boxes.2b56febf.0.snapshot @@ -1,68 +1,70 @@ boxes › box_addition2 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot index 3fabd61481..c3e25e1adb 100644 --- a/compiler/test/__snapshots__/boxes.7d564476.0.snapshot +++ b/compiler/test/__snapshots__/boxes.7d564476.0.snapshot @@ -1,61 +1,63 @@ boxes › box_division1 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 76))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot index a3eee9b055..9e78a82620 100644 --- a/compiler/test/__snapshots__/boxes.9035923e.0.snapshot +++ b/compiler/test/__snapshots__/boxes.9035923e.0.snapshot @@ -1,68 +1,70 @@ boxes › box_subtraction2 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot index f1b4bb7d71..de2cebae2c 100644 --- a/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot +++ b/compiler/test/__snapshots__/boxes.adbe1660.0.snapshot @@ -1,61 +1,63 @@ boxes › box_addition1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot index f2bd9d34eb..6f80dd974a 100644 --- a/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot +++ b/compiler/test/__snapshots__/boxes.bc258c1b.0.snapshot @@ -1,61 +1,63 @@ boxes › box_multiplication1 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot b/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot index 9b0afc2fec..a1b1a73442 100644 --- a/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot +++ b/compiler/test/__snapshots__/boxes.eb81e542.0.snapshot @@ -1,28 +1,30 @@ boxes › test_set_extra1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot b/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot index b1d024cc3b..04b8464a16 100644 --- a/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot +++ b/compiler/test/__snapshots__/chars.200d9e1a.0.snapshot @@ -1,13 +1,15 @@ chars › char4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar A))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.259e330c.0.snapshot b/compiler/test/__snapshots__/chars.259e330c.0.snapshot index 23aaeea0bd..ac5ebf3d0f 100644 --- a/compiler/test/__snapshots__/chars.259e330c.0.snapshot +++ b/compiler/test/__snapshots__/chars.259e330c.0.snapshot @@ -1,13 +1,15 @@ chars › char2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar A))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot b/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot index 37f70f96f9..865a3d1b7f 100644 --- a/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot +++ b/compiler/test/__snapshots__/chars.27fb7f30.0.snapshot @@ -1,13 +1,15 @@ chars › char8 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar \"\\226\\156\\168\"))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\226\\156\\168\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.51010573.0.snapshot b/compiler/test/__snapshots__/chars.51010573.0.snapshot index fadb2cc199..e26b653074 100644 --- a/compiler/test/__snapshots__/chars.51010573.0.snapshot +++ b/compiler/test/__snapshots__/chars.51010573.0.snapshot @@ -1,13 +1,15 @@ chars › char7 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\140\\190\"))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\140\\190\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot b/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot index aa0381202a..000a131474 100644 --- a/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot +++ b/compiler/test/__snapshots__/chars.7e0f68db.0.snapshot @@ -1,13 +1,15 @@ chars › char6 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\146\\175\"))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar \"\\240\\159\\146\\175\"))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.af4b3613.0.snapshot b/compiler/test/__snapshots__/chars.af4b3613.0.snapshot index 928581c68f..45f8980ea8 100644 --- a/compiler/test/__snapshots__/chars.af4b3613.0.snapshot +++ b/compiler/test/__snapshots__/chars.af4b3613.0.snapshot @@ -1,13 +1,15 @@ chars › char5 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar A))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot b/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot index 234bb1e95f..5ba0493820 100644 --- a/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot +++ b/compiler/test/__snapshots__/chars.e1cac8cd.0.snapshot @@ -1,13 +1,15 @@ chars › char3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstChar A))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstChar A))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/comments.573e549e.0.snapshot b/compiler/test/__snapshots__/comments.573e549e.0.snapshot index 15acdf20fc..72acdee145 100644 --- a/compiler/test/__snapshots__/comments.573e549e.0.snapshot +++ b/compiler/test/__snapshots__/comments.573e549e.0.snapshot @@ -1,13 +1,15 @@ comments › comment_alone -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/comments.8f52e899.0.snapshot b/compiler/test/__snapshots__/comments.8f52e899.0.snapshot index 02b185d8a9..8ff41a190b 100644 --- a/compiler/test/__snapshots__/comments.8f52e899.0.snapshot +++ b/compiler/test/__snapshots__/comments.8f52e899.0.snapshot @@ -1,13 +1,15 @@ comments › comment_block -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot b/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot index f5a2d92127..060a4e7b1c 100644 --- a/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot +++ b/compiler/test/__snapshots__/comments.ccf5fcf4.0.snapshot @@ -1,13 +1,15 @@ comments › comment_shebang -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/comments.fd91c233.0.snapshot b/compiler/test/__snapshots__/comments.fd91c233.0.snapshot index 9634c290e2..5f4ba9f975 100644 --- a/compiler/test/__snapshots__/comments.fd91c233.0.snapshot +++ b/compiler/test/__snapshots__/comments.fd91c233.0.snapshot @@ -1,13 +1,15 @@ comments › comment_doc -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 10))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot index 905407294c..1867d5bf4a 100644 --- a/compiler/test/__snapshots__/early_return.1183a893.0.snapshot +++ b/compiler/test/__snapshots__/early_return.1183a893.0.snapshot @@ -1,91 +1,95 @@ early return › early_return3 -((functions - (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) +((mash_code + ((functions + (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1116) - (closure - ((immediate_desc - (MIncRef + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturn + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MGlobalBind ==_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturn - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturn - (((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports - ((WasmFunctionExport (ex_function_name foo) - (ex_function_internal_name foo_1113)) - (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) + (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1119) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturn + (((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name foo) + (ex_function_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) + (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/enums.aa34084a.0.snapshot b/compiler/test/__snapshots__/enums.aa34084a.0.snapshot index 9da66ae655..038c86efcc 100644 --- a/compiler/test/__snapshots__/enums.aa34084a.0.snapshot +++ b/compiler/test/__snapshots__/enums.aa34084a.0.snapshot @@ -1,19 +1,21 @@ enums › adt_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 496428475))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 496428475))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/enums.ae26523b.0.snapshot b/compiler/test/__snapshots__/enums.ae26523b.0.snapshot index a2e2f16140..e2487b95d7 100644 --- a/compiler/test/__snapshots__/enums.ae26523b.0.snapshot +++ b/compiler/test/__snapshots__/enums.ae26523b.0.snapshot @@ -1,155 +1,159 @@ enums › enum_recursive_data_definition -((functions ()) - (imports - (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"tree 1\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"tree 2\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 607720624))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 837658664))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 607720624))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 607720624))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 837658664))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 607720624))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 607720624))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MReturnCallKnown (func print_1129) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1129 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 10) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MString \"tree 1\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"tree 2\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 837658664))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 837658664))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 607720624))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MReturnCallKnown (func print_1129) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1129 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 10) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot b/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot index 701095c381..25cb6db976 100644 --- a/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot +++ b/compiler/test/__snapshots__/exceptions.a68ae348.0.snapshot @@ -1,19 +1,21 @@ exceptions › exception_4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot b/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot index c1fac147e3..8185c15646 100644 --- a/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot +++ b/compiler/test/__snapshots__/exceptions.ccac3e71.0.snapshot @@ -1,19 +1,21 @@ exceptions › exception_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot index 370c2a234b..02e7380726 100644 --- a/compiler/test/__snapshots__/functions.06134c8a.0.snapshot +++ b/compiler/test/__snapshots__/functions.06134c8a.0.snapshot @@ -1,44 +1,46 @@ functions › dup_func -((functions - (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1117 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1117 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot index 9112c97e0e..d20dacc459 100644 --- a/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot +++ b/compiler/test/__snapshots__/functions.0b8146ea.0.snapshot @@ -1,51 +1,53 @@ functions › regression_1725 -((functions - (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MReturn - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturn - (((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed)) (return_type (Managed)) + (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MReturn + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturn + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.14922a92.0.snapshot b/compiler/test/__snapshots__/functions.14922a92.0.snapshot index fe496afd73..1afb80d8e9 100644 --- a/compiler/test/__snapshots__/functions.14922a92.0.snapshot +++ b/compiler/test/__snapshots__/functions.14922a92.0.snapshot @@ -1,66 +1,68 @@ functions › shorthand_4 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot index 750b383f43..bc9eed8060 100644 --- a/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot +++ b/compiler/test/__snapshots__/functions.1be5ecd5.0.snapshot @@ -1,47 +1,49 @@ functions › shorthand_1 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot b/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot index 6417d24360..e0ad812abb 100644 --- a/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot +++ b/compiler/test/__snapshots__/functions.23afd9c9.0.snapshot @@ -1,256 +1,258 @@ functions › lam_destructure_5 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func lam_lambda_1118) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1118) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot index 7c0cacab41..b514e82626 100644 --- a/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot +++ b/compiler/test/__snapshots__/functions.28e0f2b3.0.snapshot @@ -1,52 +1,54 @@ functions › lambda_pat_any -((functions - (((id ((name x))) (name (x)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name x))) (name (x)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MReturnCallKnown (func x_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func x_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot index 499c08a21f..e3c2fc2b7a 100644 --- a/compiler/test/__snapshots__/functions.49ccab54.0.snapshot +++ b/compiler/test/__snapshots__/functions.49ccab54.0.snapshot @@ -1,97 +1,100 @@ functions › curried_func -((functions - (((id ((name add))) (name (add)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc - (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1122) - (arity 2) - (variables - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name func))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure (1)) - (body - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MClosureBind 0))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind add_1113 Managed) +((mash_code + ((functions + (((id ((name add))) (name (add)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1122) + (arity 2) + (variables + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (1)) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func add_1113) + (MReturnCallKnown (func +_1116) (closure ((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind add_1113 Managed))) + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) (immediate_analyses ((last_usage Last)))))) (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) + (func_type ((Managed Managed) (Managed))) (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallIndirect - (func - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name add))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements (func_1124)) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind add_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func add_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind add_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name add))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements (func_1124)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot index 52b549653a..afa66ec675 100644 --- a/compiler/test/__snapshots__/functions.6eacded0.0.snapshot +++ b/compiler/test/__snapshots__/functions.6eacded0.0.snapshot @@ -1,345 +1,350 @@ functions › func_recursive_closure -((functions - (((id ((name makeAdder))) (name (makeAdder)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc - (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1143) - (arity 2) - (variables - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name truc))) (name (truc)) (args (Managed)) (return_type (Managed)) - (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func foo_1117) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))) - (stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name func))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure (1)) - (body - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MClosureBind 0))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name foo))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func makeAdder_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind makeAdder_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MClosure - ((func_idx ()) (global_offset function_table_global_1143) - (arity 2) - (variables +((mash_code + ((functions + (((id ((name makeAdder))) (name (makeAdder)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1143) + (arity 2) + (variables + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name truc))) (name (truc)) (args (Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name func))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (1)) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name foo))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func makeAdder_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind makeAdder_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx ()) (global_offset function_table_global_1143) + (arity 2) + (variables + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1132) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1132 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args (((immediate_desc (MIncRef - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func ==_1132) - (closure + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1132 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func ==_1132) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1132 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1132) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1132 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func bar_1120) + (closure + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MCallKnown (func -_1137) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1137 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) + (MImmBinding (MLocalBind 1 Managed))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func bar_1120) - (closure - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MCallKnown (func -_1137) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind -_1137 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func foo_1117) - (closure - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 3) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())) - ((id ((name bar))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure (2)) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func foo_1117) - (closure - ((immediate_desc (MImmBinding (MClosureBind 0))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallIndirect - (func - ((immediate_desc (MImmBinding (MClosureBind 1))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports - ((WasmFunctionExport (ex_function_name truc) - (ex_function_internal_name truc_1116)) - (WasmGlobalExport (ex_global_name truc) - (ex_global_internal_name truc_1116)))) - (main_body - (((instr_desc - (MStore - (((MGlobalBind makeAdder_1113 Managed) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 3) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())) + ((id ((name bar))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure (2)) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func foo_1117) + (closure + ((immediate_desc (MImmBinding (MClosureBind 0))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MClosureBind 1))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind truc_1116 Managed) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func truc_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind truc_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (() (Managed))) (args ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name truc))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name makeAdder))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements (func_1146)) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name ==))) (mimp_mod pervasives.gr) (mimp_name ==) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name truc) + (ex_function_internal_name truc_1116)) + (WasmGlobalExport (ex_global_name truc) + (ex_global_internal_name truc_1116)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind makeAdder_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind truc_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func truc_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind truc_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type (() (Managed))) (args ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name truc))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name makeAdder))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements (func_1146)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot b/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot index 286a8b41ed..61c695a112 100644 --- a/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot +++ b/compiler/test/__snapshots__/functions.7a8986a5.0.snapshot @@ -1,41 +1,43 @@ functions › app_1 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func lam_lambda_1114) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1114) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot index 270576db6f..469a2c69bb 100644 --- a/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot +++ b/compiler/test/__snapshots__/functions.84b6e84b.0.snapshot @@ -1,47 +1,49 @@ functions › shorthand_3 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.8baf471f.0.snapshot b/compiler/test/__snapshots__/functions.8baf471f.0.snapshot index 0c30f2b4fa..4c2e7f15f7 100644 --- a/compiler/test/__snapshots__/functions.8baf471f.0.snapshot +++ b/compiler/test/__snapshots__/functions.8baf471f.0.snapshot @@ -1,160 +1,162 @@ functions › lam_destructure_3 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func lam_lambda_1116) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1116) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.9223245d.0.snapshot b/compiler/test/__snapshots__/functions.9223245d.0.snapshot index 16f8338642..9ea77a55cf 100644 --- a/compiler/test/__snapshots__/functions.9223245d.0.snapshot +++ b/compiler/test/__snapshots__/functions.9223245d.0.snapshot @@ -1,221 +1,223 @@ functions › lam_destructure_7 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func lam_lambda_1117) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1117) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot index 04c6540cd1..e99c990cac 100644 --- a/compiler/test/__snapshots__/functions.9fd69835.0.snapshot +++ b/compiler/test/__snapshots__/functions.9fd69835.0.snapshot @@ -1,66 +1,68 @@ functions › shorthand_2 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot index 8e9dcf0b6c..e5652bfb4a 100644 --- a/compiler/test/__snapshots__/functions.b37949b2.0.snapshot +++ b/compiler/test/__snapshots__/functions.b37949b2.0.snapshot @@ -1,166 +1,168 @@ functions › lam_destructure_4 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 7) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot index 44dd5fc125..6b61a20235 100644 --- a/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot +++ b/compiler/test/__snapshots__/functions.b3a8d88b.0.snapshot @@ -1,227 +1,229 @@ functions › lam_destructure_8 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 11) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot b/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot index 37c62d92f5..23ecb10b14 100644 --- a/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot +++ b/compiler/test/__snapshots__/functions.b632a2ab.0.snapshot @@ -1,46 +1,48 @@ functions › lam_destructure_1 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MReturnCallKnown (func lam_lambda_1113) - (closure - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func lam_lambda_1113) + (closure + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot index eca1c76ac3..6d5447bfab 100644 --- a/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot +++ b/compiler/test/__snapshots__/functions.c6e8a9aa.0.snapshot @@ -1,52 +1,54 @@ functions › lam_destructure_2 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.ce978f54.0.snapshot b/compiler/test/__snapshots__/functions.ce978f54.0.snapshot index 552e37a9b1..05adf50f75 100644 --- a/compiler/test/__snapshots__/functions.ce978f54.0.snapshot +++ b/compiler/test/__snapshots__/functions.ce978f54.0.snapshot @@ -1,13 +1,15 @@ functions › multi_bind2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.d9466880.0.snapshot b/compiler/test/__snapshots__/functions.d9466880.0.snapshot index 5a292b4000..d8cebaa692 100644 --- a/compiler/test/__snapshots__/functions.d9466880.0.snapshot +++ b/compiler/test/__snapshots__/functions.d9466880.0.snapshot @@ -1,95 +1,97 @@ functions › func_record_associativity2 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure (0)) - (body - (((instr_desc - (MCleanup - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1125) - (arity 1) (variables ()))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 815701713))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((g) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 242946859))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - (((f) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallIndirect - (func - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) - ((instr_desc - (MPrim1 Not - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements (lam_lambda_1121)) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure (0)) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1125) + (arity 1) (variables ()))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 815701713))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((g) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 242946859))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((f) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) + ((instr_desc + (MPrim1 Not + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1121)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot index a224829d6a..0172c3a5b5 100644 --- a/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot +++ b/compiler/test/__snapshots__/functions.e6c6212b.0.snapshot @@ -1,68 +1,70 @@ functions › fn_trailing_comma -((functions - (((id ((name testFn))) (name (testFn)) (args (Managed Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind testFn_1113 Managed) +((mash_code + ((functions + (((id ((name testFn))) (name (testFn)) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func testFn_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind testFn_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name testFn))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind testFn_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func testFn_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind testFn_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name testFn))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot index 0406e5444d..aff242262e 100644 --- a/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot +++ b/compiler/test/__snapshots__/functions.f400bb7b.0.snapshot @@ -1,262 +1,264 @@ functions › lam_destructure_6 -((functions - (((id ((name foo))) (name (foo)) (args (Managed Managed Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) +((mash_code + ((functions + (((id ((name foo))) (name (foo)) (args (Managed Managed Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) + (MSet (MLocalBind 0 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func foo_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MReturnCallKnown (func +_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func foo_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name foo))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/functions.f647681b.0.snapshot b/compiler/test/__snapshots__/functions.f647681b.0.snapshot index f38710b804..702dd136aa 100644 --- a/compiler/test/__snapshots__/functions.f647681b.0.snapshot +++ b/compiler/test/__snapshots__/functions.f647681b.0.snapshot @@ -1,71 +1,73 @@ functions › func_record_associativity1 -((functions - (((id ((name lam_lambda))) (name ()) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure (0)) - (body - (((instr_desc - (MCleanup - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1121) - (arity 1) (variables ()))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 242946859))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((f) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MCallIndirect - (func - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))) - (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) - ((instr_desc - (MPrim1 Not - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements (lam_lambda_1118)) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions + (((id ((name lam_lambda))) (name ()) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure (0)) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1121) + (arity 1) (variables ()))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 242946859))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((f) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallIndirect + (func + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + (func_type (() ((Unmanaged WasmI32)))) (args ()))))))))) + ((instr_desc + (MPrim1 Not + ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1118)) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.1d829099.0.snapshot b/compiler/test/__snapshots__/includes.1d829099.0.snapshot index 9a7cbceb93..831b66860b 100644 --- a/compiler/test/__snapshots__/includes.1d829099.0.snapshot +++ b/compiler/test/__snapshots__/includes.1d829099.0.snapshot @@ -1,18 +1,20 @@ includes › include_relative_path2 -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod ../../test/test-libs/provideAll.gr) - (mimp_name x) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod ../../test/test-libs/provideAll.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.46f78654.0.snapshot b/compiler/test/__snapshots__/includes.46f78654.0.snapshot index d86c564f43..3f5dcb00a5 100644 --- a/compiler/test/__snapshots__/includes.46f78654.0.snapshot +++ b/compiler/test/__snapshots__/includes.46f78654.0.snapshot @@ -1,36 +1,38 @@ includes › include_some_multiple -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot b/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot index 2f34a20f37..540ea8786c 100644 --- a/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot +++ b/compiler/test/__snapshots__/includes.5dfba7dd.0.snapshot @@ -1,18 +1,20 @@ includes › include_alias -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot b/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot index 65be517fcf..654ea48e22 100644 --- a/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot +++ b/compiler/test/__snapshots__/includes.6c8d23dc.0.snapshot @@ -1,36 +1,38 @@ includes › include_some_multiple_trailing2 -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.6e78c003.0.snapshot b/compiler/test/__snapshots__/includes.6e78c003.0.snapshot index 2cd370a1a5..8756b9aad3 100644 --- a/compiler/test/__snapshots__/includes.6e78c003.0.snapshot +++ b/compiler/test/__snapshots__/includes.6e78c003.0.snapshot @@ -1,36 +1,38 @@ includes › include_some_multiple_trailing -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.7afbe731.0.snapshot b/compiler/test/__snapshots__/includes.7afbe731.0.snapshot index 3e6ddfee40..1d5bf3b156 100644 --- a/compiler/test/__snapshots__/includes.7afbe731.0.snapshot +++ b/compiler/test/__snapshots__/includes.7afbe731.0.snapshot @@ -1,18 +1,20 @@ includes › include_some -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.8222ee98.0.snapshot b/compiler/test/__snapshots__/includes.8222ee98.0.snapshot index ef665bbda5..97214d524f 100644 --- a/compiler/test/__snapshots__/includes.8222ee98.0.snapshot +++ b/compiler/test/__snapshots__/includes.8222ee98.0.snapshot @@ -1,18 +1,20 @@ includes › include_module -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.86ff4075.0.snapshot b/compiler/test/__snapshots__/includes.86ff4075.0.snapshot index cc8fda1b62..231a2846ec 100644 --- a/compiler/test/__snapshots__/includes.86ff4075.0.snapshot +++ b/compiler/test/__snapshots__/includes.86ff4075.0.snapshot @@ -1,36 +1,38 @@ includes › include_alias_multiple -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot b/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot index 002219a808..3b7728e794 100644 --- a/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot +++ b/compiler/test/__snapshots__/includes.a3212bd0.0.snapshot @@ -1,18 +1,20 @@ includes › include_relative_path3 -((functions ()) - (imports - (((mimp_id ((name j))) (mimp_mod nested/nested.gr) (mimp_name j) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind j_1116 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name j))) (mimp_mod nested/nested.gr) (mimp_name j) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind j_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.b3434679.0.snapshot b/compiler/test/__snapshots__/includes.b3434679.0.snapshot index c80b06659f..55424c9060 100644 --- a/compiler/test/__snapshots__/includes.b3434679.0.snapshot +++ b/compiler/test/__snapshots__/includes.b3434679.0.snapshot @@ -1,35 +1,37 @@ includes › include_some_constructor -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot b/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot index 0a492bea1a..d137749bcd 100644 --- a/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot +++ b/compiler/test/__snapshots__/includes.bd3eb3af.0.snapshot @@ -1,59 +1,61 @@ includes › include_some_mixed -((functions ()) - (imports - (((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func sum_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind sum_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name sum))) (mimp_mod tlists.gr) (mimp_name sum) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func sum_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind sum_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.beda767e.0.snapshot b/compiler/test/__snapshots__/includes.beda767e.0.snapshot index 01fe68ee39..3f8d487585 100644 --- a/compiler/test/__snapshots__/includes.beda767e.0.snapshot +++ b/compiler/test/__snapshots__/includes.beda767e.0.snapshot @@ -1,18 +1,20 @@ includes › include_relative_path1 -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod ../test-libs/provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod ../test-libs/provideAll.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot b/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot index cf7b1fc9b0..b8ea19cba3 100644 --- a/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot +++ b/compiler/test/__snapshots__/includes.c0c0d5ca.0.snapshot @@ -1,68 +1,71 @@ includes › include_relative_path4 -((functions ()) - (imports - (((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func bar_1119) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind bar_1119 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func print_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name bar))) (mimp_mod ./bar/bar.gr) (mimp_name bar) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name print))) (mimp_mod pervasives.gr) (mimp_name print) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func bar_1119) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind bar_1119 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot b/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot index 10d2567116..5e2ac37e66 100644 --- a/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot +++ b/compiler/test/__snapshots__/includes.c62f45f8.0.snapshot @@ -1,43 +1,45 @@ includes › include_muliple_modules -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1136 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1136 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot b/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot index b6e9a96671..cefb2381ff 100644 --- a/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot +++ b/compiler/test/__snapshots__/includes.cedde8e9.0.snapshot @@ -1,35 +1,37 @@ includes › include_same_module_unify -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.de6b420f.0.snapshot b/compiler/test/__snapshots__/includes.de6b420f.0.snapshot index 1c229012b7..5321ebf138 100644 --- a/compiler/test/__snapshots__/includes.de6b420f.0.snapshot +++ b/compiler/test/__snapshots__/includes.de6b420f.0.snapshot @@ -1,19 +1,21 @@ includes › annotation_across_import -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ())))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ())))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot b/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot index 1baab32c26..fe3d0378d4 100644 --- a/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot +++ b/compiler/test/__snapshots__/includes.f2bf866b.0.snapshot @@ -1,35 +1,37 @@ includes › include_all_constructor -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 609193316))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1121))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 609193316))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1121))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot b/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot index 7cb3561b03..f82fe0ed18 100644 --- a/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot +++ b/compiler/test/__snapshots__/includes.f4ba5583.0.snapshot @@ -1,36 +1,38 @@ includes › include_module2 -((functions ()) - (imports - (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name x))) (mimp_mod provideAll.gr) (mimp_name x) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name y))) (mimp_mod provideAll.gr) (mimp_name y) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot index 04f3d5516f..11d4b8aaa6 100644 --- a/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.00e05fe2.0.snapshot @@ -1,55 +1,58 @@ let mut › let-mut_division1 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 76))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot index 5be8f3d481..91a396ca17 100644 --- a/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.1176df90.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_multiplication2 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot index c857c12bc4..46bed06049 100644 --- a/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.3307d5a7.0.snapshot @@ -1,24 +1,26 @@ let mut › let-mut3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot index e513f10ebe..2aa0237de8 100644 --- a/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.43f6980c.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_division3 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 76))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot index 7516a04aef..1bc3d0c245 100644 --- a/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.48249b50.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut5 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot index ed32942836..d22b12de89 100644 --- a/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c3f3b2b.0.snapshot @@ -1,36 +1,38 @@ let mut › let-mut2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot index 6143e245ac..ccd3b7d5cf 100644 --- a/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.4c75261e.0.snapshot @@ -1,55 +1,58 @@ let mut › let-mut_multiplication1 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot index 359d48b738..c12a543d48 100644 --- a/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.634331f0.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_multiplication3 -((functions ()) - (imports - (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func *_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name *))) (mimp_mod pervasives.gr) (mimp_name *) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func *_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind *_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot index 8e193a152b..975c707f00 100644 --- a/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.63c16374.0.snapshot @@ -1,32 +1,34 @@ let mut › let-mut4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot index 4463d3ba79..0ce513433e 100644 --- a/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.6796c72d.0.snapshot @@ -1,55 +1,58 @@ let mut › let-mut_subtraction1 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot index 54c89b87d2..f468af0398 100644 --- a/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.baaea1d3.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_subtraction2 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot index e97da09184..0e0d623369 100644 --- a/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.cbbbaeb4.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_addition2 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot index f3a762fdc9..a9cffb8b71 100644 --- a/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.d2de286b.0.snapshot @@ -1,55 +1,58 @@ let mut › let-mut_addition1 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot index b8a57aef7e..f8a24fdd37 100644 --- a/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.e90db621.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_subtraction3 -((functions ()) - (imports - (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind -_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot index b3a664b5b9..a658425342 100644 --- a/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f8f208a2.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_addition3 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func +_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot index 95fa5c99b8..049bfde48c 100644 --- a/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.f9e32f30.0.snapshot @@ -1,62 +1,65 @@ let mut › let-mut_division2 -((functions ()) - (imports - (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 76))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func /_1117) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 19))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name /))) (mimp_mod pervasives.gr) (mimp_name /) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func /_1117) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind /_1117 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot index e647b6eb28..fd27211dee 100644 --- a/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot +++ b/compiler/test/__snapshots__/let_mut.fcc9c65d.0.snapshot @@ -1,23 +1,25 @@ let mut › let-mut1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/lists.884ce894.0.snapshot b/compiler/test/__snapshots__/lists.884ce894.0.snapshot index 2c5ad2dba0..51e808de6e 100644 --- a/compiler/test/__snapshots__/lists.884ce894.0.snapshot +++ b/compiler/test/__snapshots__/lists.884ce894.0.snapshot @@ -1,83 +1,85 @@ lists › list_spread -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot b/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot index 6fafb863ca..2152b1141b 100644 --- a/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot +++ b/compiler/test/__snapshots__/lists.d9fd46fb.0.snapshot @@ -1,67 +1,69 @@ lists › list1_trailing_space -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/lists.e5378351.0.snapshot b/compiler/test/__snapshots__/lists.e5378351.0.snapshot index 74f6f64933..220a861a8e 100644 --- a/compiler/test/__snapshots__/lists.e5378351.0.snapshot +++ b/compiler/test/__snapshots__/lists.e5378351.0.snapshot @@ -1,67 +1,69 @@ lists › list1_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot index c13125ccf1..4ac9b0c1bd 100644 --- a/compiler/test/__snapshots__/loops.0a25def1.0.snapshot +++ b/compiler/test/__snapshots__/loops.0a25def1.0.snapshot @@ -1,160 +1,164 @@ loops › loop2 -((functions ()) - (imports - (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 12))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind count_1114 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MFor - ((((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCallKnown (func >_1128) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCallKnown (func >_1128) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1128 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))) ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind >_1128 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - () - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func -_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind -_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc - (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MCallKnown (func +_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc - (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name count))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot index 2ac1e40d58..0458ed9122 100644 --- a/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot +++ b/compiler/test/__snapshots__/loops.0fafc5f0.0.snapshot @@ -1,143 +1,145 @@ loops › loop5 -((functions ()) - (imports - (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 12))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind count_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MFor - ((((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MCallKnown (func -_1124) - (closure +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >=))) (mimp_mod pervasives.gr) (mimp_name >=) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func -_1124) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1124 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MCallKnown (func >=_1126) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind -_1124 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc + (MImmBinding (MGlobalBind >=_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func +_1120) + (closure + ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MCallKnown (func >=_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind >=_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - () - (((instr_desc - (MStore - (((MLocalBind 0 Managed) + (MImmBinding (MGlobalBind +_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind count_1114 Managed) ((instr_desc - (MCallKnown (func +_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind count_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name count))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot index 8309c3a89a..15be696501 100644 --- a/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot +++ b/compiler/test/__snapshots__/loops.c2b7bfc6.0.snapshot @@ -1,94 +1,96 @@ loops › loop3 -((functions ()) - (imports - (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MFor - ((((instr_desc - (MCallKnown (func >_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind >_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - () - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MCallKnown (func >_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) ((instr_desc - (MCallKnown (func -_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind -_1118 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot index 05df645821..48f71e5ed1 100644 --- a/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot +++ b/compiler/test/__snapshots__/loops.f1c03b79.0.snapshot @@ -1,142 +1,145 @@ loops › loop4 -((functions ()) - (imports - (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 12))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind count_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MFor - ((((instr_desc - (MCallKnown (func >_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind >_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))))) - () - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func -_1120) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind -_1120 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef +((mash_code + ((functions ()) + (imports + (((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name >))) (mimp_mod pervasives.gr) (mimp_name >) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name -))) (mimp_mod pervasives.gr) (mimp_name -) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind count_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MFor + ((((instr_desc + (MCallKnown (func >_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind >_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))))) + () + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func -_1120) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind -_1120 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind b_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MSet (MGlobalBind b_1113 Managed) + ((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MGlobalBind b_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MSet (MGlobalBind b_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MCallKnown (func +_1124) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1124 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MSet (MGlobalBind count_1114 Managed) ((instr_desc - (MCallKnown (func +_1124) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1124 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MSet (MGlobalBind count_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name count))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind count_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name count))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot b/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot index 93d336be05..e8a535eee4 100644 --- a/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot +++ b/compiler/test/__snapshots__/modules.52d25a2f.0.snapshot @@ -1,13 +1,15 @@ modules › smallest_submodule -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot index 563cc34784..93029dc6c1 100644 --- a/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.d72b00c6.0.snapshot @@ -1,51 +1,53 @@ optimizations › trs1 -((functions - (((id ((stamp 1113) (name f1))) (name (f1)) - (args (Managed Managed Managed)) (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((stamp 1113) (name f1))) (name (f1)) + (args (Managed Managed Managed)) (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind f1_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MArgBind 2 Managed))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MReturnCallKnown (func f1_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind f1_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind f1_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MReturnCallKnown (func f1_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind f1_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name f1))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name f1))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot index e0b535cc12..e5258ee982 100644 --- a/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot +++ b/compiler/test/__snapshots__/optimizations.ff6d5bfb.0.snapshot @@ -1,88 +1,90 @@ optimizations › test_dead_branch_elimination_5 -((functions ()) - (imports - (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind y_1114 Managed) - ((instr_desc - (MAllocate - (MBox - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MBoxOp - (MBoxUpdate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MBoxOp MBoxUnbox - ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((name y))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((name +))) (mimp_mod pervasives.gr) (mimp_name +) + (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) + (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind y_1114 Managed) + ((instr_desc + (MAllocate + (MBox + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MBoxOp + (MBoxUpdate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind x_1113 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MBoxOp MBoxUnbox + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((name y))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot index a9604da3bb..243cb6ca80 100644 --- a/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0539d13e.0.snapshot @@ -1,117 +1,120 @@ pattern matching › record_match_3 -((functions ()) - (imports - (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))) - ((baz) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 - (((instr_desc - (MReturnCallKnown (func +_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1126) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MReturnCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1126) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot index 56fa3a8998..922deb732a 100644 --- a/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.05b60a1e.0.snapshot @@ -1,164 +1,169 @@ pattern matching › adt_match_deep -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) + (((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 4) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1130) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 4) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot index c0e20a9305..50913ffc17 100644 --- a/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0ad4ac05.0.snapshot @@ -1,776 +1,793 @@ pattern matching › tuple_match_deep4 -((functions ()) - (imports - (((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1153) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 18 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 19 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 20 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 17 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 19 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 19 Managed) ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 7 Managed) + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 17 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) + (MImmBinding (MLocalBind 7 Managed))) (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1153) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 21 Managed) - ((instr_desc - (MCallKnown (func +_1153) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1153) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 22 Managed) - ((instr_desc - (MCallKnown (func +_1153) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 23 Managed) - ((instr_desc - (MCallKnown (func +_1153) - (closure + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1153) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1153) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1153 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1153 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 24) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1158) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 24) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1158) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot index 3c1e489061..b1c73a12e6 100644 --- a/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0bb6923e.0.snapshot @@ -1,591 +1,607 @@ pattern matching › adt_match_4 -((functions ()) - (imports - (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 6))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 10 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 14 Managed) ((instr_desc - (MSet (MLocalBind 5 Managed) + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 10 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 17) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1152) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 17) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1152) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot b/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot index c347dfa26b..f5d9a897da 100644 --- a/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot @@ -1,163 +1,169 @@ pattern matching › low_level_constant_match_2 -((functions ()) - (imports - (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryI64 (wasm_op Op_eq_int64) - (arg_types (Wasm_int64 Wasm_int64)) (ret_type Grain_bool)) - ((immediate_desc (MImmConst (MConstLiteral (MConstI64 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI64 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryI64 (wasm_op Op_eq_int64) - (arg_types (Wasm_int64 Wasm_int64)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI64 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI64 1)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryI64 (wasm_op Op_eq_int64) - (arg_types (Wasm_int64 Wasm_int64)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI64 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI64 2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) (ret_type Grain_bool)) + ((immediate_desc (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI64 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) (((instr_desc - (MImmediate + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryI64 (wasm_op Op_eq_int64) + (arg_types (Wasm_int64 Wasm_int64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI64 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func print_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot b/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot index 5fee537e1a..8b35e89f4a 100644 --- a/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.14dc7554.0.snapshot @@ -1,78 +1,80 @@ pattern matching › record_match_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot index b73348687c..6d3d3abc3b 100644 --- a/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.16cd197e.0.snapshot @@ -1,65 +1,68 @@ pattern matching › constant_match_3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot b/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot index ecd1af735a..beec7668a6 100644 --- a/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.16eb3dbf.0.snapshot @@ -1,217 +1,222 @@ pattern matching › guarded_match_2 -((functions ()) - (imports - (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 42))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 99))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1130) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot b/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot index 7eb5ca69fa..d419e0314d 100644 --- a/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.25930935.0.snapshot @@ -1,168 +1,174 @@ pattern matching › low_level_constant_match_3 -((functions ()) - (imports - (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF32 (wasm_op Op_eq_float32) - (arg_types (Wasm_float32 Wasm_float32)) (ret_type Grain_bool)) - ((immediate_desc - (MImmConst (MConstLiteral (MConstF32 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstF32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF32 (wasm_op Op_eq_float32) - (arg_types (Wasm_float32 Wasm_float32)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF32 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF32 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF32 (wasm_op Op_eq_float32) - (arg_types (Wasm_float32 Wasm_float32)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF32 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF32 4611686018427387904)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstF32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) (((instr_desc - (MImmediate + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF32 (wasm_op Op_eq_float32) + (arg_types (Wasm_float32 Wasm_float32)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF32 4611686018427387904)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func print_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot b/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot index f3b9ac5821..f9157ffaaa 100644 --- a/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.3722b060.0.snapshot @@ -1,236 +1,239 @@ pattern matching › tuple_match_deep -((functions ()) - (imports - (((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1131) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 - (((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MCallKnown (func +_1131) - (closure - ((immediate_desc - (MIncRef + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1131 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MCallKnown (func +_1131) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1131 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1131) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1131 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1134) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1131) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1131 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 13) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1134) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot b/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot index 1e7e2f2413..ffab51a22c 100644 --- a/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.46f91987.0.snapshot @@ -1,78 +1,80 @@ pattern matching › record_match_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot index fdd9a7eace..c31fe71698 100644 --- a/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5b158103.0.snapshot @@ -1,226 +1,233 @@ pattern matching › constant_match_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) ((instr_desc (MAllocate (MString bar))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MIf + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 7) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1134) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1134) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot index a2c78a8a44..e18d5086cd 100644 --- a/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5b6ff2d3.0.snapshot @@ -1,276 +1,286 @@ pattern matching › alias_match_5 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate + (MPrim2 Eq + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 0 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmBinding (MLocalBind 3 Managed))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstI32 5))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate + (MPrim2 Eq + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 0 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmBinding + (MLocalBind 3 Managed))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 2))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 0 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))) (((instr_desc (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 7) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1131) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot b/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot index db653cacd8..3d9fbfe82a 100644 --- a/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.5ff49e44.0.snapshot @@ -1,173 +1,176 @@ pattern matching › record_match_4 -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))) - ((baz) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 - (((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1128) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot b/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot index bb3d2d6985..0b7af63939 100644 --- a/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.64686134.0.snapshot @@ -1,101 +1,105 @@ pattern matching › constant_match_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MRational (numerator_flags ()) (numerator_limbs (1)) - (denominator_flags ()) (denominator_limbs (3))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRational (numerator_flags ()) (numerator_limbs (1)) - (denominator_flags ()) (denominator_limbs (3))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (1)) + (denominator_flags ()) (denominator_limbs (3))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRational (numerator_flags ()) (numerator_limbs (1)) + (denominator_flags ()) (denominator_limbs (3))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 3) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1120) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot b/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot index 0fb80c77f6..598c682fe5 100644 --- a/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.702ed9b0.0.snapshot @@ -1,808 +1,825 @@ pattern matching › tuple_match_deep6 -((functions ()) - (imports - (((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 6))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1157) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 18 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 19 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 20 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 21 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 22 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 17 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 19 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 14 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 21 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 21 Managed) ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 9 Managed) + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 17 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 19 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) + (MImmBinding (MLocalBind 9 Managed))) (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1157) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 23 Managed) - ((instr_desc - (MCallKnown (func +_1157) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1157) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 24 Managed) - ((instr_desc - (MCallKnown (func +_1157) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 25 Managed) - ((instr_desc - (MCallKnown (func +_1157) - (closure + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1157) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 24 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1157) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1157 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 25 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1157 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 26) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1162) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 26) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1162) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot b/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot index 52198872c2..29442c951f 100644 --- a/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.7082d3ca.0.snapshot @@ -1,127 +1,129 @@ pattern matching › tuple_match_3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boop))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boop))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 - (((instr_desc - (MAllocate - (MTuple - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot b/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot index 640b3c89e9..311dd00d83 100644 --- a/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.79346fef.0.snapshot @@ -1,760 +1,777 @@ pattern matching › tuple_match_deep3 -((functions ()) - (imports - (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 18 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 19 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) ((instr_desc - (MSet (MLocalBind 6 Managed) + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) + (MImmBinding (MLocalBind 6 Managed))) (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 20 Managed) - ((instr_desc - (MCallKnown (func +_1151) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 21 Managed) - ((instr_desc - (MCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 22 Managed) - ((instr_desc - (MCallKnown (func +_1151) - (closure + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 23) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1156) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 23) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1156) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot b/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot index bbaee79950..0783ca06c6 100644 --- a/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.7f7fe4ef.0.snapshot @@ -1,39 +1,41 @@ pattern matching › alias_match_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1115) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1115) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot index 4ce15ec144..fd07d014d3 100644 --- a/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.8614dff3.0.snapshot @@ -1,64 +1,66 @@ pattern matching › alias_match_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) + (MSet (MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 + (MSet (MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))) (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot b/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot index 808474ed2c..e282a23134 100644 --- a/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.8c0dc67a.0.snapshot @@ -1,543 +1,559 @@ pattern matching › adt_match_1 -((functions ()) - (imports - (((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 7 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 9 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1143) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) ((instr_desc - (MSet (MLocalBind 2 Managed) + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 7 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 9 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1143) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MCallKnown (func +_1143) + (closure ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1143) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1143 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MCallKnown (func +_1143) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1143) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1143 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1143) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1143 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1143 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 14) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1146) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 14) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1146) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot b/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot index f11f48d595..f20e1de159 100644 --- a/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.9561763b.0.snapshot @@ -1,446 +1,449 @@ pattern matching › tuple_match_deep2 -((functions ()) - (imports - (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1149) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 7))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 17 Managed) + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 18 Managed) + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 19 Managed) + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 20 Managed) + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 21 Managed) + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 22 Managed) + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 - (((instr_desc - (MStore - (((MLocalBind 23 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + ((0 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 24 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 25 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 24 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 26 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 26 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 25 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 27 Managed) - ((instr_desc - (MCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 27 Managed) + ((instr_desc + (MCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 26 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 26 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1149) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1149 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 27 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 28) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1155) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1149) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1149 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 27 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 28) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1155) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot b/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot index a62c665e71..bb56f97423 100644 --- a/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.98756c45.0.snapshot @@ -1,93 +1,95 @@ pattern matching › record_match_deep -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 305098605))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc (MImmConst (MConstI32 0))) (immediate_analyses ((last_usage Unknown)))) - (((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - ((0 + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot b/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot index 40e5c01e47..c012ef0848 100644 --- a/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.9ffaa7a7.0.snapshot @@ -1,168 +1,174 @@ pattern matching › low_level_constant_match_4 -((functions ()) - (imports - (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF64 (wasm_op Op_eq_float64) - (arg_types (Wasm_float64 Wasm_float64)) (ret_type Grain_bool)) - ((immediate_desc - (MImmConst (MConstLiteral (MConstF64 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstF64 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF64 (wasm_op Op_eq_float64) - (arg_types (Wasm_float64 Wasm_float64)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF64 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF64 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 - (WasmBinaryF64 (wasm_op Op_eq_float64) - (arg_types (Wasm_float64 Wasm_float64)) - (ret_type Grain_bool)) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF64 4607182418800017408)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst - (MConstLiteral (MConstF64 4611686018427387904)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) (ret_type Grain_bool)) + ((immediate_desc + (MImmConst (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstF64 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) (((instr_desc - (MImmediate + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 + (WasmBinaryF64 (wasm_op Op_eq_float64) + (arg_types (Wasm_float64 Wasm_float64)) + (ret_type Grain_bool)) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4607182418800017408)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst + (MConstLiteral (MConstF64 4611686018427387904)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func print_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot b/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot index 5292523a28..dd9f344a5e 100644 --- a/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.aa8d2963.0.snapshot @@ -1,247 +1,253 @@ pattern matching › guarded_match_4 -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 8))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - (((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate + (((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 42))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 99))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1132) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1132) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot b/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot index ff105cd715..62efe44410 100644 --- a/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.ac58ffc3.0.snapshot @@ -1,217 +1,222 @@ pattern matching › guarded_match_1 -((functions ()) - (imports - (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 42))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 99))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1130) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 2) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1130) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot b/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot index 5b47d0fc4d..53fbcc8cfe 100644 --- a/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.b1b060ad.0.snapshot @@ -1,559 +1,575 @@ pattern matching › adt_match_2 -((functions ()) - (imports - (((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1145) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 8 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 10 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) ((instr_desc - (MSet (MLocalBind 3 Managed) + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 8 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 8 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 10 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 8 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 10 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1145) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MCallKnown (func +_1145) + (closure ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1145) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1145 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MCallKnown (func +_1145) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1145) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1145 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1145) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1145 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1145 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 15) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1148) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 15) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1148) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot b/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot index f277086160..00cd673eca 100644 --- a/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.b9db0dd9.0.snapshot @@ -1,247 +1,253 @@ pattern matching › guarded_match_3 -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - (((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate + (((instr_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 42))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 99))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 99))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1132) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1132) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot index ccce6e3c90..f633dbaa05 100644 --- a/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.be46eb0e.0.snapshot @@ -1,155 +1,161 @@ pattern matching › low_level_constant_match_1 -((functions ()) - (imports - (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 1)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1116) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) (((instr_desc - (MImmediate + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 1)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MCallKnown (func print_1116) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MCallKnown (func print_1116) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind print_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MImmBinding (MGlobalBind print_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot b/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot index 3843458f85..ae0a1a1ed3 100644 --- a/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.c91eac29.0.snapshot @@ -1,575 +1,591 @@ pattern matching › adt_match_3 -((functions ()) - (imports - (((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1147) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 9 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 13 Managed) ((instr_desc - (MSet (MLocalBind 4 Managed) + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 9 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1147) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MCallKnown (func +_1147) + (closure ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1147) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1147 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MCallKnown (func +_1147) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1147) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1147 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1147) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1147 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1147 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 16) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1150) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 16) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1150) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot b/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot index b4ba4736d5..18157d1e7e 100644 --- a/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.c9582b6d.0.snapshot @@ -1,200 +1,209 @@ pattern matching › alias_match_4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 1 Managed) - ((instr_desc - (MImmediate + (MPrim2 Eq + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 2 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmBinding (MLocalBind 2 Managed))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 1 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 2 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 6) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1129) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 6) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1129) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot b/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot index 7c7eb0ffba..c13fe6c722 100644 --- a/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.d048ece0.0.snapshot @@ -1,607 +1,623 @@ pattern matching › adt_match_5 -((functions ()) - (imports - (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 7))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1151) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 15 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 6 Managed) + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 11 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 13 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 13 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MCallKnown (func +_1151) + (closure ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MCallKnown (func +_1151) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1151) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1151) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1151 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1151 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 18) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1154) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 18) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1154) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot b/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot index 2e078d4622..a310c53fa1 100644 --- a/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot @@ -1,68 +1,71 @@ pattern matching › or_match_4 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot index 6bffceb371..e2f43d7817 100644 --- a/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.e41ad64e.0.snapshot @@ -1,792 +1,809 @@ pattern matching › tuple_match_deep5 -((functions ()) - (imports - (((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1155) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 18 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 19 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 20 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 21 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 20 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 20 Managed) ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 8 Managed) + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 5 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) + ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 4 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 4 Managed) - ((instr_desc - (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) + (MImmBinding (MLocalBind 8 Managed))) (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1155) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 22 Managed) - ((instr_desc - (MCallKnown (func +_1155) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1155) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 23 Managed) - ((instr_desc - (MCallKnown (func +_1155) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 24 Managed) - ((instr_desc - (MCallKnown (func +_1155) - (closure + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1155) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1155) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1155 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1155 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 25) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1160) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 25) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1160) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot b/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot index c08ac43ead..1980cf68ab 100644 --- a/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.eb4334e1.0.snapshot @@ -1,267 +1,277 @@ pattern matching › constant_match_4 -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 7))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) + (MImmBinding (MLocalBind 2 Managed))) (immediate_analyses ((last_usage Unknown)))))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate + (MPrim2 Eq + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MDrop ((instr_desc - (MCallKnown (func ==_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind ==_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 3 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (3 + (MCallKnown (func ==_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MGlobalBind ==_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 3 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (3 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 7) (stack_size_i32 5) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1135) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 7) (stack_size_i32 5) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1135) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot index a1dae6bae5..8e6d5272a4 100644 --- a/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f0c08ea4.0.snapshot @@ -1,824 +1,841 @@ pattern matching › tuple_match_deep7 -((functions ()) - (imports - (((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 7))) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1159) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 11 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 14 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 15 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 16 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 17 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 18 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 19 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 20 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 21 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 22 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 23 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 23 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 11 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 11 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 12 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 13 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 14 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 20 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 15 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 22 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 3))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 4))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 22 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 22 Managed) ((instr_desc - (MSet (MLocalBind 9 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 11 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 10 Managed) + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 11 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 12 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 13 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 14 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 15 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 22 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) ((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 18 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) + (MImmConst (MConstI32 3))) (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 11 Managed) - ((instr_desc + ((last_usage Unknown)))))))) + (((instr_desc (MImmediate ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 20 Managed))) - (immediate_analyses - ((last_usage Last)))))) + (MImmConst (MConstI32 4))) (immediate_analyses - ((last_usage Unknown))))))))))))) + ((last_usage Unknown)))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses + ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 9 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 10 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 11 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 20 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 7 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 2))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc + ((last_usage Unknown))))))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 8 Managed) + ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 4))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 21 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 20 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 7 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 8 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 6 Managed) ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 19 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 6 Managed) - ((instr_desc - (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (2 + (((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MIncRef ((immediate_desc - (MImmBinding (MLocalBind 16 Managed))) + (MImmBinding (MLocalBind 10 Managed))) (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 17 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc - (MIncRef + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1159) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (2 - (((instr_desc - (MStore - (((MLocalBind 24 Managed) - ((instr_desc - (MCallKnown (func +_1159) - (closure + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage TailCallLast)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (3 + (((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1159) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage TailCallLast)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 24 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (3 - (((instr_desc - (MStore - (((MLocalBind 25 Managed) - ((instr_desc - (MCallKnown (func +_1159) - (closure - ((immediate_desc - (MIncRef + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 26 Managed) + ((instr_desc + (MCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))) ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 26 Managed) - ((instr_desc - (MCallKnown (func +_1159) - (closure + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1159) + (closure + ((immediate_desc + (MIncRef ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MImmBinding (MLocalBind 25 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1159) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind +_1159 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 26 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (4 + (MImmBinding (MGlobalBind +_1159 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 26 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (4 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 999))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 999))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed)))) - (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 27) (stack_size_i32 12) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1164) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed)))) + (((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 27) (stack_size_i32 12) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1164) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot index 01893af2ed..384d943bbc 100644 --- a/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f25e0163.0.snapshot @@ -1,339 +1,353 @@ pattern matching › or_match_3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 7 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MAdtOp (MAdtGet 1) - ((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 9 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc - (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 10 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 9 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 10 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 7 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 7 Managed) ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 5 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 0))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - (((instr_desc - (MStore - (((MLocalBind 8 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 8 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop + (MAdtOp (MAdtGet 1) + ((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc + (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses + ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 10 (Unmanaged WasmI32)) ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding - (MLocalBind 3 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses - ((last_usage Unknown))))))))))))) + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 9 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 10 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 5 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 0))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + (((instr_desc + (MStore + (((MLocalBind 8 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses + ((last_usage Last)))) + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 8 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 0))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))) + (((immediate_desc + (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding + (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MDrop + ((instr_desc + (MSet (MLocalBind 2 Managed) ((instr_desc (MImmediate ((immediate_desc - (MImmConst (MConstI32 0))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 1))) + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses + ((last_usage Last)))))) (immediate_analyses - ((last_usage Unknown)))))))))))))))) - (((immediate_desc - (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding - (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MDrop - ((instr_desc - (MSet (MLocalBind 2 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 + ((last_usage Unknown))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MSwitch + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32))))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 8) (stack_size_i32 11) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1140) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 11) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1140) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot index f01296df55..cac7a6b370 100644 --- a/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f3d48b0e.0.snapshot @@ -1,68 +1,71 @@ pattern matching › or_match_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - Managed))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + Managed))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 3) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot b/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot index 906a675849..19495acb67 100644 --- a/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot +++ b/compiler/test/__snapshots__/pattern_matching.f6c9c89c.0.snapshot @@ -1,191 +1,199 @@ pattern matching › or_match_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MAdtOp MAdtGetTag - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 (Unmanaged WasmI32)) - ((instr_desc - (MIf - ((immediate_desc (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 3 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Is - ((immediate_desc - (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAdtOp (MAdtGet 0) - ((immediate_desc - (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 5 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses - ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding (MLocalBind 5 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))))))) - (((instr_desc - (MStore - (((MLocalBind 6 (Unmanaged WasmI32)) - ((instr_desc - (MPrim2 Eq - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses - ((last_usage Last)))))) - (immediate_analyses - ((last_usage Unknown)))) - ((immediate_desc - (MImmConst (MConstI32 5))) - (immediate_analyses - ((last_usage Unknown)))))))))))) - ((instr_desc - (MIf - ((immediate_desc - (MImmBinding - (MLocalBind 6 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 1))) - (immediate_analyses - ((last_usage Unknown)))))))) - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstI32 2))) - (immediate_analyses - ((last_usage Unknown)))))))))))))))))))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown))))))))) - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MSwitch - ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) - (immediate_analyses ((last_usage Last)))) - ((0 +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MAdtOp MAdtGetTag + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 (Unmanaged WasmI32)) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 1 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 3 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Is + ((immediate_desc + (MImmBinding (MLocalBind 0 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 3 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAdtOp (MAdtGet 0) + ((immediate_desc + (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MIf + ((immediate_desc + (MImmBinding (MLocalBind 4 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 5 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses + ((last_usage Unknown)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 5 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))))))) + (((instr_desc + (MStore + (((MLocalBind 6 (Unmanaged WasmI32)) + ((instr_desc + (MPrim2 Eq + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding + (MLocalBind 1 Managed))) + (immediate_analyses + ((last_usage Last)))))) + (immediate_analyses + ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstI32 5))) + (immediate_analyses + ((last_usage Unknown)))))))))))) + ((instr_desc + (MIf + ((immediate_desc + (MImmBinding + (MLocalBind 6 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 1))) + (immediate_analyses + ((last_usage Unknown)))))))) + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstI32 2))) + (immediate_analyses + ((last_usage Unknown)))))))))))))))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown))))))))) + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MSwitch + ((immediate_desc (MImmBinding (MLocalBind 2 (Unmanaged WasmI32)))) + (immediate_analyses ((last_usage Last)))) + ((0 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))) + (1 + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))) + (2 + (((instr_desc + (MImmediate + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))) (((instr_desc (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))) - (1 - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))) - (2 - (((instr_desc - (MImmediate - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))) - (((instr_desc - (MImmediate - ((immediate_desc MImmTrap) - (immediate_analyses ((last_usage Unknown)))))))) - (Unmanaged WasmI32)))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 7) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1128) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc MImmTrap) + (immediate_analyses ((last_usage Unknown)))))))) + (Unmanaged WasmI32)))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 7) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot b/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot index 96f45ca767..69979171ff 100644 --- a/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot +++ b/compiler/test/__snapshots__/provides.0ef7e7b3.0.snapshot @@ -1,18 +1,20 @@ provides › provide7 -((functions ()) - (imports - (((mimp_id ((stamp 1122) (name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1123) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1122) (name x))) (mimp_mod provideAll.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1122 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.10f4f118.0.snapshot b/compiler/test/__snapshots__/provides.10f4f118.0.snapshot index 52660b1da3..949e63e696 100644 --- a/compiler/test/__snapshots__/provides.10f4f118.0.snapshot +++ b/compiler/test/__snapshots__/provides.10f4f118.0.snapshot @@ -1,36 +1,39 @@ provides › provide9 -((functions ()) - (imports - (((mimp_id ((stamp 1123) (name z))) (mimp_mod provideAll.gr) (mimp_name z) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func y_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind z_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1123) (name z))) (mimp_mod provideAll.gr) + (mimp_name z) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) + (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1122) (name y))) (mimp_mod provideAll.gr) + (mimp_name y) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func y_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind z_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot index 1c982f3928..1b1f9d048c 100644 --- a/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot +++ b/compiler/test/__snapshots__/provides.2a5f527b.0.snapshot @@ -1,26 +1,30 @@ provides › multiple_provides_8 -((functions ()) (imports ()) - (exports - ((WasmGlobalExport (ex_global_name bar) (ex_global_internal_name foo_1113)) - (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) + (exports + ((WasmGlobalExport (ex_global_name bar) + (ex_global_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) + (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot index ec1bd155a6..f0df44a129 100644 --- a/compiler/test/__snapshots__/provides.30cbc409.0.snapshot +++ b/compiler/test/__snapshots__/provides.30cbc409.0.snapshot @@ -1,112 +1,116 @@ provides › provide_start_function -((functions - (((id ((stamp 1113) (name _start))) (name (_start)) (args (Managed)) - (return_type ((Unmanaged WasmI32))) (closure ()) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc (MAllocate (MString \"starting up\"))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports - ((WasmFunctionExport (ex_function_name _start) - (ex_function_internal_name _start_1113)) - (WasmGlobalExport (ex_global_name _start) - (ex_global_internal_name _start_1113)))) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions + (((id ((stamp 1113) (name _start))) (name (_start)) (args (Managed)) + (return_type ((Unmanaged WasmI32))) (closure ()) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString init))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MCallKnown (func print_1115) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind _start_1113 Managed) + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"starting up\"))))))))) ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name _start))) (mutable_ true) - (allocation_type Managed) (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1120) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1115) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports + ((WasmFunctionExport (ex_function_name _start) + (ex_function_internal_name _start_1113)) + (WasmGlobalExport (ex_global_name _start) + (ex_global_internal_name _start_1113)))) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString init))))))))) + ((instr_desc + (MDrop + ((instr_desc + (MCallKnown (func print_1115) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind _start_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name _start))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot b/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot index 90bc3f9b83..e750ee32c8 100644 --- a/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot +++ b/compiler/test/__snapshots__/provides.82c10ab4.0.snapshot @@ -1,91 +1,95 @@ provides › provide12 -((functions - (((id ((stamp 1202) (name lam_lambda))) (name ()) (args (Managed Managed)) - (return_type ((Unmanaged WasmI32))) (closure (0)) - (body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString ok))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MArgBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func print_1203) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind print_1203 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports - (((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) - (mimp_name print) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) - (mimp_name apply) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) - (mimp_name apply) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions + (((id ((stamp 1202) (name lam_lambda))) (name ()) + (args (Managed Managed)) (return_type ((Unmanaged WasmI32))) + (closure (0)) + (body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) ((instr_desc - (MAllocate - (MClosure - ((func_idx (0)) (global_offset function_table_global_1207) - (arity 2) (variables ()))))))))))) - ((instr_desc - (MReturnCallKnown (func apply_1201) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind apply_1201 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements (lam_lambda_1202)) - (global_function_table_offset ((stamp 1207) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString ok))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MArgBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func print_1203) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind print_1203 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports + (((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1203) (name print))) (mimp_mod pervasives.gr) + (mimp_name print) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) + (mimp_name apply) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1201) (name apply))) (mimp_mod providedType.gr) + (mimp_name apply) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MClosure + ((func_idx (0)) (global_offset function_table_global_1207) + (arity 2) (variables ()))))))))))) + ((instr_desc + (MReturnCallKnown (func apply_1201) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind apply_1201 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements (lam_lambda_1202)) + (global_function_table_offset ((stamp 1207) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot b/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot index 1072c16e27..2fc5cbb238 100644 --- a/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot +++ b/compiler/test/__snapshots__/provides.c3bb4eff.0.snapshot @@ -1,61 +1,65 @@ provides › provide8 -((functions ()) - (imports - (((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) (mimp_name y) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((stamp 1123) (name x))) (mimp_mod provideAll.gr) (mimp_name x) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)) - ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MCallKnown (func y_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed) (Managed))) - (args - (((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1122) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1127) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) + (mimp_name y) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name y))) (mimp_mod provideAll.gr) + (mimp_name y) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1123) (name x))) (mimp_mod provideAll.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)) + ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1122) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MCallKnown (func y_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed) (Managed))) + (args + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1122) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1122 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind x_1123 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1127) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot index c8025861d1..3ea3513962 100644 --- a/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot +++ b/compiler/test/__snapshots__/provides.c6bf4567.0.snapshot @@ -1,43 +1,46 @@ provides › let_rec_provide -((functions - (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) - (return_type (Managed)) (closure ()) - (body - (((instr_desc - (MCleanup - (((instr_desc +((mash_code + ((functions + (((id ((stamp 1113) (name foo))) (name (foo)) (args (Managed)) + (return_type (Managed)) (closure ()) + (body + (((instr_desc + (MCleanup + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))))))) + (((immediate_desc (MImmBinding (MArgBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (attrs ())))) + (imports ()) + (exports + ((WasmFunctionExport (ex_function_name foo) + (ex_function_internal_name foo_1113)) + (WasmGlobalExport (ex_global_name foo) + (ex_global_internal_name foo_1113)))) + (main_body + (((instr_desc + (MStore + (((MGlobalBind foo_1113 Managed) + ((instr_desc (MImmediate - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))))))) - (((immediate_desc (MImmBinding (MArgBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (attrs ())))) - (imports ()) - (exports - ((WasmFunctionExport (ex_function_name foo) - (ex_function_internal_name foo_1113)) - (WasmGlobalExport (ex_global_name foo) (ex_global_internal_name foo_1113)))) - (main_body - (((instr_desc - (MStore - (((MGlobalBind foo_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/provides.f378d570.0.snapshot b/compiler/test/__snapshots__/provides.f378d570.0.snapshot index a4baa325b9..976f93266e 100644 --- a/compiler/test/__snapshots__/provides.f378d570.0.snapshot +++ b/compiler/test/__snapshots__/provides.f378d570.0.snapshot @@ -1,18 +1,20 @@ provides › provide4 -((functions ()) - (imports - (((mimp_id ((stamp 1116) (name x))) (mimp_mod onlyXProvided.gr) - (mimp_name x) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind x_1116 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1116) (name x))) (mimp_mod onlyXProvided.gr) + (mimp_name x) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind x_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.012b017b.0.snapshot b/compiler/test/__snapshots__/records.012b017b.0.snapshot index a41dcea523..32e65395a6 100644 --- a/compiler/test/__snapshots__/records.012b017b.0.snapshot +++ b/compiler/test/__snapshots__/records.012b017b.0.snapshot @@ -1,13 +1,15 @@ records › record_spread_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1122) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 1879048190)))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1122) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.02742729.0.snapshot b/compiler/test/__snapshots__/records.02742729.0.snapshot index 55e3515215..1cf2961150 100644 --- a/compiler/test/__snapshots__/records.02742729.0.snapshot +++ b/compiler/test/__snapshots__/records.02742729.0.snapshot @@ -1,67 +1,70 @@ records › record_get_multiple -((functions ()) - (imports - (((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MReturnCallKnown (func +_1118) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1121) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1118) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MReturnCallKnown (func +_1118) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1118 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.02af5946.0.snapshot b/compiler/test/__snapshots__/records.02af5946.0.snapshot index 43d718a369..f66d2ec989 100644 --- a/compiler/test/__snapshots__/records.02af5946.0.snapshot +++ b/compiler/test/__snapshots__/records.02af5946.0.snapshot @@ -1,19 +1,21 @@ records › record_definition_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.2dc39420.0.snapshot b/compiler/test/__snapshots__/records.2dc39420.0.snapshot index aa6a9f9884..a6f63c6bb1 100644 --- a/compiler/test/__snapshots__/records.2dc39420.0.snapshot +++ b/compiler/test/__snapshots__/records.2dc39420.0.snapshot @@ -1,19 +1,21 @@ records › record_pun -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot index 4f66889748..f74ca3741c 100644 --- a/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot +++ b/compiler/test/__snapshots__/records.49dfc6ff.0.snapshot @@ -1,64 +1,66 @@ records › record_destruct_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1123) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1114) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.54f5977c.0.snapshot b/compiler/test/__snapshots__/records.54f5977c.0.snapshot index 1236e492f6..9877f4dbda 100644 --- a/compiler/test/__snapshots__/records.54f5977c.0.snapshot +++ b/compiler/test/__snapshots__/records.54f5977c.0.snapshot @@ -1,157 +1,160 @@ records › record_destruct_4 -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))) - ((baz) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind baz_1116 Managed) + (MSet (MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind baz_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind foo_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind bar_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1116) (name baz))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1128) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1115) (name bar))) (mutable_ true) + (allocation_type Managed) (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())) + ((id ((stamp 1116) (name baz))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.5f340064.0.snapshot b/compiler/test/__snapshots__/records.5f340064.0.snapshot index 2afd99faa7..a1f9a8f945 100644 --- a/compiler/test/__snapshots__/records.5f340064.0.snapshot +++ b/compiler/test/__snapshots__/records.5f340064.0.snapshot @@ -1,19 +1,21 @@ records › record_value_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.60c0a141.0.snapshot b/compiler/test/__snapshots__/records.60c0a141.0.snapshot index fd68454ca5..54fafc20c1 100644 --- a/compiler/test/__snapshots__/records.60c0a141.0.snapshot +++ b/compiler/test/__snapshots__/records.60c0a141.0.snapshot @@ -1,113 +1,115 @@ records › record_recursive_data_definition -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 305098605))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - (((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 0 (Unmanaged WasmI32)) - ((instr_desc - (MRecordOp - (MRecordSet 0 - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 250551095))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MRecordOp - (MRecordSet 0 - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last))))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 6) (stack_size_i32 1) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 0 (Unmanaged WasmI32)) + ((instr_desc + (MRecordOp + (MRecordSet 0 + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 250551095))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp + (MRecordSet 0 + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last))))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 6) (stack_size_i32 1) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.60c7acc4.0.snapshot b/compiler/test/__snapshots__/records.60c7acc4.0.snapshot index c42524f498..f15c8efe59 100644 --- a/compiler/test/__snapshots__/records.60c7acc4.0.snapshot +++ b/compiler/test/__snapshots__/records.60c7acc4.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_mixed_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.63a951b8.0.snapshot b/compiler/test/__snapshots__/records.63a951b8.0.snapshot index 1eb1453edd..07948f629f 100644 --- a/compiler/test/__snapshots__/records.63a951b8.0.snapshot +++ b/compiler/test/__snapshots__/records.63a951b8.0.snapshot @@ -1,64 +1,66 @@ records › record_destruct_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind bar_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind bar_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind bar_1114 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1114) (name bar))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1123) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind bar_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind bar_1114 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1114) (name bar))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1123) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.89d08e01.0.snapshot b/compiler/test/__snapshots__/records.89d08e01.0.snapshot index 2da4610018..76ff5f4536 100644 --- a/compiler/test/__snapshots__/records.89d08e01.0.snapshot +++ b/compiler/test/__snapshots__/records.89d08e01.0.snapshot @@ -1,19 +1,21 @@ records › record_pun_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.98824516.0.snapshot b/compiler/test/__snapshots__/records.98824516.0.snapshot index 83c8e0a78e..38e5614eec 100644 --- a/compiler/test/__snapshots__/records.98824516.0.snapshot +++ b/compiler/test/__snapshots__/records.98824516.0.snapshot @@ -1,79 +1,81 @@ records › record_destruct_deep -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 305098605))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 305098605))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - (((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind foo_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1115) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind foo_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind foo_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1115) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot index 4ee1b3fd15..607363a351 100644 --- a/compiler/test/__snapshots__/records.a3299dd2.0.snapshot +++ b/compiler/test/__snapshots__/records.a3299dd2.0.snapshot @@ -1,111 +1,114 @@ records › record_destruct_3 -((functions ()) - (imports - (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1125) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))) - ((baz) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1114 Managed) + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1125) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1125 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind bar_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1126) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1125) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1125 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1115) (name bar))) (mutable_ true) + (allocation_type Managed) (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1126) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.a702778a.0.snapshot b/compiler/test/__snapshots__/records.a702778a.0.snapshot index ecbb85b4d2..496abf3f69 100644 --- a/compiler/test/__snapshots__/records.a702778a.0.snapshot +++ b/compiler/test/__snapshots__/records.a702778a.0.snapshot @@ -1,57 +1,59 @@ records › record_get_multilevel -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 9))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 978173424))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1114))) - (immediate_analyses ((last_usage Unknown)))) - (((baz) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1122) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 978173424))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1114))) + (immediate_analyses ((last_usage Unknown)))) + (((baz) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1122) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.a9c472b1.0.snapshot b/compiler/test/__snapshots__/records.a9c472b1.0.snapshot index f04e315e84..af29c0e7b5 100644 --- a/compiler/test/__snapshots__/records.a9c472b1.0.snapshot +++ b/compiler/test/__snapshots__/records.a9c472b1.0.snapshot @@ -1,28 +1,30 @@ records › record_multiple_fields_definition_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.b50d234d.0.snapshot b/compiler/test/__snapshots__/records.b50d234d.0.snapshot index 58a84fd0cd..a82c97b8c5 100644 --- a/compiler/test/__snapshots__/records.b50d234d.0.snapshot +++ b/compiler/test/__snapshots__/records.b50d234d.0.snapshot @@ -1,30 +1,32 @@ records › record_get_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.d34c4740.0.snapshot b/compiler/test/__snapshots__/records.d34c4740.0.snapshot index c4fcda791e..bb83cea892 100644 --- a/compiler/test/__snapshots__/records.d34c4740.0.snapshot +++ b/compiler/test/__snapshots__/records.d34c4740.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_mixed -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.d393173c.0.snapshot b/compiler/test/__snapshots__/records.d393173c.0.snapshot index ad0ff61f4d..ca55992fc2 100644 --- a/compiler/test/__snapshots__/records.d393173c.0.snapshot +++ b/compiler/test/__snapshots__/records.d393173c.0.snapshot @@ -1,157 +1,160 @@ records › record_destruct_trailing -((functions ()) - (imports - (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) (mimp_name +) - (mimp_type (MGlobalImport Managed true)) (mimp_kind MImportGrain) - (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1126) (name +))) (mimp_mod pervasives.gr) + (mimp_name +) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown))))) + ((baz) + ((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MRecordOp (MRecordGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MRecordOp (MRecordGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MRecordOp (MRecordGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown))))) - ((baz) - ((immediate_desc (MImmConst (MConstI32 6))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind baz_1116 Managed) + (MSet (MGlobalBind baz_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MSet (MGlobalBind bar_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MRecordOp (MRecordGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MRecordOp (MRecordGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MRecordOp (MRecordGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind baz_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind bar_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind foo_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Unknown)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind foo_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc - (MIncRef - ((immediate_desc - (MImmBinding (MGlobalBind bar_1115 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func +_1126) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1115) (name bar))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name foo))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1116) (name baz))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1128) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind foo_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Unknown)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind foo_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MIncRef + ((immediate_desc + (MImmBinding (MGlobalBind bar_1115 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func +_1126) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind +_1126 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind baz_1116 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1115) (name bar))) (mutable_ true) + (allocation_type Managed) (initial_value ())) + ((id ((stamp 1114) (name foo))) (mutable_ true) + (allocation_type Managed) (initial_value ())) + ((id ((stamp 1116) (name baz))) (mutable_ true) + (allocation_type Managed) (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.d44e8007.0.snapshot b/compiler/test/__snapshots__/records.d44e8007.0.snapshot index a046d5547b..2f483f7ca9 100644 --- a/compiler/test/__snapshots__/records.d44e8007.0.snapshot +++ b/compiler/test/__snapshots__/records.d44e8007.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_mixed_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.e4326567.0.snapshot b/compiler/test/__snapshots__/records.e4326567.0.snapshot index a3733108ba..ff2892856f 100644 --- a/compiler/test/__snapshots__/records.e4326567.0.snapshot +++ b/compiler/test/__snapshots__/records.e4326567.0.snapshot @@ -1,28 +1,30 @@ records › record_multiple_fields_both_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.e5b56da8.0.snapshot b/compiler/test/__snapshots__/records.e5b56da8.0.snapshot index 5e2e536e25..2dc5cdbe97 100644 --- a/compiler/test/__snapshots__/records.e5b56da8.0.snapshot +++ b/compiler/test/__snapshots__/records.e5b56da8.0.snapshot @@ -1,19 +1,21 @@ records › record_both_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 523616810))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 523616810))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.e705a980.0.snapshot b/compiler/test/__snapshots__/records.e705a980.0.snapshot index b80468e2b4..49cadf844d 100644 --- a/compiler/test/__snapshots__/records.e705a980.0.snapshot +++ b/compiler/test/__snapshots__/records.e705a980.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_multiple -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot b/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot index 28930fb9c8..f05c08c997 100644 --- a/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot +++ b/compiler/test/__snapshots__/records.f6e43cdb.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_multiple_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.f6feee77.0.snapshot b/compiler/test/__snapshots__/records.f6feee77.0.snapshot index 41d4a77fa1..3022fa87be 100644 --- a/compiler/test/__snapshots__/records.f6feee77.0.snapshot +++ b/compiler/test/__snapshots__/records.f6feee77.0.snapshot @@ -1,28 +1,30 @@ records › record_multiple_fields_value_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 1) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/records.fae50a8e.0.snapshot b/compiler/test/__snapshots__/records.fae50a8e.0.snapshot index be2a3b2612..65ec8309ee 100644 --- a/compiler/test/__snapshots__/records.fae50a8e.0.snapshot +++ b/compiler/test/__snapshots__/records.fae50a8e.0.snapshot @@ -1,22 +1,25 @@ records › record_pun_mixed_2_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 223962023))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 223962023))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot b/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot index 79a0d13d2e..4adb5e58a8 100644 --- a/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.179d20b9.0.snapshot @@ -1,34 +1,36 @@ stdlib › stdlib_equal_4 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot b/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot index e7edb71705..bb5acc1877 100644 --- a/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.1c0b04b7.0.snapshot @@ -1,78 +1,80 @@ stdlib › stdlib_equal_20 -((functions ()) - (imports - (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString bar))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1121) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot b/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot index 27720634b2..b0864992a2 100644 --- a/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.24cb9bbf.0.snapshot @@ -1,42 +1,44 @@ stdlib › stdlib_equal_18 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc (MAllocate (MString \"foo \\240\\159\\153\\132\"))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\153\\132\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot b/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot index ee9e992bc4..b190228191 100644 --- a/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.323e410a.0.snapshot @@ -1,41 +1,43 @@ stdlib › stdlib_equal_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MCleanup - (((instr_desc - (MPrim2 Is - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))) - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1119) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MCleanup + (((instr_desc + (MPrim2 Is + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))) + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot b/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot index 44360685d2..2e60aabbf8 100644 --- a/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.37483d2d.0.snapshot @@ -1,67 +1,69 @@ stdlib › stdlib_cons -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1120) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 3) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot b/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot index 582805e948..c3cbf264b5 100644 --- a/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.4a5061c2.0.snapshot @@ -1,78 +1,80 @@ stdlib › stdlib_equal_19 -((functions ()) - (imports - (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1121) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot b/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot index a6fff39564..7aaf49117d 100644 --- a/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.5fe88631.0.snapshot @@ -1,40 +1,42 @@ stdlib › stdlib_equal_16 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot b/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot index 0d4eee214c..5e3483c251 100644 --- a/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.648f406e.0.snapshot @@ -1,62 +1,64 @@ stdlib › stdlib_equal_12 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot b/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot index 605435af2c..379b867130 100644 --- a/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.69635cff.0.snapshot @@ -1,78 +1,80 @@ stdlib › stdlib_equal_21 -((functions ()) - (imports - (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 78))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1121) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 78))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot b/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot index b741f8f2e9..f5c0978d4f 100644 --- a/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.6bf88430.0.snapshot @@ -1,40 +1,42 @@ stdlib › stdlib_equal_15 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString f))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString f))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot b/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot index 333745feda..bb3f3b78f8 100644 --- a/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.6de47be2.0.snapshot @@ -1,40 +1,42 @@ stdlib › stdlib_equal_14 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \" \"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \" \"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot b/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot index 51672f1b24..e51cfae7b2 100644 --- a/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.8300ad7c.0.snapshot @@ -1,156 +1,158 @@ stdlib › stdlib_equal_3 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MAllocate - (MADT - ((immediate_desc (MImmConst (MConstI32 819301804))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 5))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown)))) - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1128) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1128) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot b/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot index 7ec08b696f..a3a7fe5e84 100644 --- a/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.91a94037.0.snapshot @@ -1,52 +1,54 @@ stdlib › stdlib_equal_11 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1119) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1119) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot b/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot index d7fc4a4c0a..56c3820553 100644 --- a/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.a70e79ca.0.snapshot @@ -1,45 +1,47 @@ stdlib › stdlib_equal_9 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1117) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1117) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot b/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot index c5e0ea0948..40683c0553 100644 --- a/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.b30d7785.0.snapshot @@ -1,54 +1,56 @@ stdlib › stdlib_equal_2 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1120) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1120) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot b/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot index d25adafe25..3803044572 100644 --- a/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.c09a513a.0.snapshot @@ -1,35 +1,37 @@ stdlib › stdlib_equal_6 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot b/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot index 19fdb44b4e..b9679a6381 100644 --- a/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.cbf0318e.0.snapshot @@ -1,79 +1,81 @@ stdlib › stdlib_equal_22 -((functions ()) - (imports - (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MAllocate - (MRecord - ((immediate_desc (MImmConst (MConstI32 328294693))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 1113))) - (immediate_analyses ((last_usage Unknown)))) - (((foo) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown))))) - ((bar) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))) - ((baz) - ((immediate_desc - (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1114) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1121) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1114) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) ((instr_desc (MAllocate (MString boo))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MRecord + ((immediate_desc (MImmConst (MConstI32 328294693))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1113))) + (immediate_analyses ((last_usage Unknown)))) + (((foo) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown))))) + ((bar) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))) + ((baz) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1114) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1121) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot b/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot index 20aff68260..7e9c2e036a 100644 --- a/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d28dee65.0.snapshot @@ -1,50 +1,52 @@ stdlib › stdlib_equal_10 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MAllocate - (MArray - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1118) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MArray + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1118) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot b/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot index 58015d2329..d2023beb96 100644 --- a/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d4faa5bf.0.snapshot @@ -1,40 +1,42 @@ stdlib › stdlib_equal_13 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString \"\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot b/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot index ea2c8cb84d..0c2ad74222 100644 --- a/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.d887bb04.0.snapshot @@ -1,35 +1,38 @@ stdlib › stdlib_equal_7 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type - (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 2147483646)))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type + (((Unmanaged WasmI32) (Unmanaged WasmI32)) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstLiteral (MConstI32 -2)))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc + (MImmConst (MConstLiteral (MConstI32 2147483646)))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot b/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot index d78f70b6b7..79e2b0c6a2 100644 --- a/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.dae8b12a.0.snapshot @@ -1,34 +1,36 @@ stdlib › stdlib_equal_5 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot b/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot index fe63af8b7a..31861ddf81 100644 --- a/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.e306600a.0.snapshot @@ -1,40 +1,42 @@ stdlib › stdlib_equal_8 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MArray ()))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MArray ()))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot b/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot index d5a8278368..2158b79f32 100644 --- a/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot +++ b/compiler/test/__snapshots__/stdlib.e6349872.0.snapshot @@ -1,42 +1,44 @@ stdlib › stdlib_equal_17 -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) - (mimp_name ==) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) - ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) - ((instr_desc - (MReturnCallKnown (func ==_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) ((Unmanaged WasmI32)))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ==))) (mimp_mod pervasives.gr) + (mimp_name ==) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc (MAllocate (MString \"foo \\240\\159\\152\\130\"))))))))) + ((instr_desc + (MReturnCallKnown (func ==_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ==_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) ((Unmanaged WasmI32)))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/strings.434adad0.0.snapshot b/compiler/test/__snapshots__/strings.434adad0.0.snapshot index 48ae295184..014ceebe71 100644 --- a/compiler/test/__snapshots__/strings.434adad0.0.snapshot +++ b/compiler/test/__snapshots__/strings.434adad0.0.snapshot @@ -1,9 +1,11 @@ strings › string2 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MString \"\\240\\159\\146\\175\")))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString \"\\240\\159\\146\\175\")))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/strings.a67428df.0.snapshot b/compiler/test/__snapshots__/strings.a67428df.0.snapshot index a2edd33aaf..b57edd424c 100644 --- a/compiler/test/__snapshots__/strings.a67428df.0.snapshot +++ b/compiler/test/__snapshots__/strings.a67428df.0.snapshot @@ -1,9 +1,11 @@ strings › string1 -((functions ()) (imports ()) (exports ()) - (main_body (((instr_desc (MAllocate (MString foo)))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body (((instr_desc (MAllocate (MString foo)))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot b/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot index faa092d407..75c95f2c88 100644 --- a/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot +++ b/compiler/test/__snapshots__/strings.b2ad5a89.0.snapshot @@ -1,10 +1,13 @@ strings › string3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc (MAllocate (MString \"making my way downtown, walking fast\")))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate (MString \"making my way downtown, walking fast\")))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/strings.fb85549f.0.snapshot b/compiler/test/__snapshots__/strings.fb85549f.0.snapshot index 5fa56d7720..eecffe2301 100644 --- a/compiler/test/__snapshots__/strings.fb85549f.0.snapshot +++ b/compiler/test/__snapshots__/strings.fb85549f.0.snapshot @@ -1,40 +1,42 @@ strings › concat -((functions ()) - (imports - (((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) - (mimp_name ++) - (mimp_type - (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) - ((Unmanaged WasmI32)))) - (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) - ((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) - (mimp_name ++) (mimp_type (MGlobalImport Managed true)) - (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) - (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString bar))))))))) - ((instr_desc - (MReturnCallKnown (func ++_1113) - (closure - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind ++_1113 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown))))) - (func_type ((Managed Managed) (Managed))) - (args - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))) - (main_body_stack_size - ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) + (imports + (((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) + (mimp_name ++) + (mimp_type + (MFuncImport (Managed (Unmanaged WasmI32) (Unmanaged WasmI32)) + ((Unmanaged WasmI32)))) + (mimp_kind MImportGrain) (mimp_setup MSetupNone) (mimp_used true)) + ((mimp_id ((stamp 1113) (name ++))) (mimp_mod pervasives.gr) + (mimp_name ++) (mimp_type (MGlobalImport Managed true)) + (mimp_kind MImportGrain) (mimp_setup MCallGetter) (mimp_used true)))) + (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) ((instr_desc (MAllocate (MString foo))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) ((instr_desc (MAllocate (MString bar))))))))) + ((instr_desc + (MReturnCallKnown (func ++_1113) + (closure + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind ++_1113 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown))))) + (func_type ((Managed Managed) (Managed))) + (args + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 2) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot index a1fa3836da..16e02fa686 100644 --- a/compiler/test/__snapshots__/tuples.1451773e.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1451773e.0.snapshot @@ -1,158 +1,160 @@ tuples › nested_tup_3 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind y_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MSet (MGlobalBind y_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) + (MSet (MGlobalBind x_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind x_1113 Managed) + (MSet (MGlobalBind b_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind y_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind y_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind x_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind y_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind a_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind b_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind a_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind a_1115 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1116) (name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1115) (name a))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name y))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1113) (name x))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1131) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind a_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind a_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1116) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name y))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1113) (name x))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot index aae76e4dc1..191e954642 100644 --- a/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot +++ b/compiler/test/__snapshots__/tuples.1d60b40c.0.snapshot @@ -1,96 +1,98 @@ tuples › nested_tup_1 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind a_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind a_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind a_1113 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1125) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind a_1113 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1125) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot index a91b1b3222..7ff16ace95 100644 --- a/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot +++ b/compiler/test/__snapshots__/tuples.2c91b91d.0.snapshot @@ -1,102 +1,104 @@ tuples › tup1_destruct_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind a_1113 Managed) + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1114 Managed) + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind c_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind c_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind a_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 0))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1124) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 4) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1124) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot b/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot index 899941523c..4d608f9b1a 100644 --- a/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot +++ b/compiler/test/__snapshots__/tuples.8d1f0463.0.snapshot @@ -1,18 +1,20 @@ tuples › tup1_trailing -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot index 772a044091..8e68001253 100644 --- a/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot +++ b/compiler/test/__snapshots__/tuples.a34621a0.0.snapshot @@ -1,128 +1,130 @@ tuples › big_tup_access -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 2) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 3) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind a_1113 Managed) + (MSet (MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1114 Managed) + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind c_1115 Managed) + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind d_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 2) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 3) - ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind d_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind c_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind a_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind c_1115 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1127) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind c_1115 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 5) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1127) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot b/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot index 77a9daad7c..b0f3f0f7a8 100644 --- a/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot +++ b/compiler/test/__snapshots__/tuples.b4f702d8.0.snapshot @@ -1,13 +1,15 @@ tuples › no_non_trailing_comma_singleton_tup -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1114) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1114) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot index 3e45eb6151..e79184448c 100644 --- a/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot +++ b/compiler/test/__snapshots__/tuples.c1eb0a50.0.snapshot @@ -1,158 +1,160 @@ tuples › nested_tup_2 -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MStore - (((MLocalBind 0 Managed) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 1 Managed) + (MSet (MGlobalBind b_1114 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 4))) - (immediate_analyses ((last_usage Unknown)))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 2 Managed) + (MSet (MGlobalBind a_1113 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MImmediate + ((immediate_desc + (MIncRef + ((immediate_desc (MImmBinding (MGlobalBind b_1114 Managed))) + (immediate_analyses ((last_usage Last)))))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MTupleOp (MTupleGet 0) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MTupleOp (MTupleGet 1) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))) + ((instr_desc + (MCleanup () + (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Unknown)))))))) + ((instr_desc + (MDrop ((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmBinding (MLocalBind 0 Managed))) - (immediate_analyses ((last_usage Last)))) - ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) - (immediate_analyses ((last_usage Last)))))))))))))) - ((instr_desc - (MStore - (((MGlobalBind a_1113 Managed) + (MSet (MGlobalBind d_1116 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MDrop ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 3 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 4 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 2 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind b_1114 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind a_1113 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MStore - (((MLocalBind 5 Managed) - ((instr_desc - (MImmediate - ((immediate_desc - (MIncRef - ((immediate_desc (MImmBinding (MGlobalBind b_1114 Managed))) - (immediate_analyses ((last_usage Last)))))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind c_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MGlobalBind d_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmConst (MConstLiteral (MConstI32 0)))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 6 Managed) - ((instr_desc - (MTupleOp (MTupleGet 0) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))))))) - ((instr_desc - (MStore - (((MLocalBind 7 Managed) - ((instr_desc - (MTupleOp (MTupleGet 1) - ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Last)))))))))))) - ((instr_desc - (MCleanup () - (((immediate_desc (MImmBinding (MLocalBind 5 Managed))) - (immediate_analyses ((last_usage Unknown)))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind d_1116 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MDrop - ((instr_desc - (MSet (MGlobalBind c_1115 Managed) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) - (immediate_analyses ((last_usage Last))))))))))))) - ((instr_desc - (MImmediate - ((immediate_desc (MImmBinding (MGlobalBind d_1116 Managed))) - (immediate_analyses ((last_usage Last))))))))) - (main_body_stack_size - ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals - (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) - (initial_value ())) - ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) - (initial_value ())))) - (function_table_elements ()) - (global_function_table_offset ((stamp 1131) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) + (MSet (MGlobalBind c_1115 Managed) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last))))))))))))) + ((instr_desc + (MImmediate + ((immediate_desc (MImmBinding (MGlobalBind d_1116 Managed))) + (immediate_analyses ((last_usage Last))))))))) + (main_body_stack_size + ((stack_size_ptr 8) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals + (((id ((stamp 1113) (name a))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1116) (name d))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1115) (name c))) (mutable_ true) (allocation_type Managed) + (initial_value ())) + ((id ((stamp 1114) (name b))) (mutable_ true) (allocation_type Managed) + (initial_value ())))) + (function_table_elements ()) + (global_function_table_offset ((stamp 1131) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) diff --git a/compiler/test/__snapshots__/tuples.f206002b.0.snapshot b/compiler/test/__snapshots__/tuples.f206002b.0.snapshot index d9909a8ac1..9ecb99a7da 100644 --- a/compiler/test/__snapshots__/tuples.f206002b.0.snapshot +++ b/compiler/test/__snapshots__/tuples.f206002b.0.snapshot @@ -1,18 +1,20 @@ tuples › tup1_trailing_space -((functions ()) (imports ()) (exports ()) - (main_body - (((instr_desc - (MAllocate - (MTuple - (((immediate_desc (MImmConst (MConstI32 1))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 2))) - (immediate_analyses ((last_usage Unknown)))) - ((immediate_desc (MImmConst (MConstI32 3))) - (immediate_analyses ((last_usage Unknown))))))))))) - (main_body_stack_size - ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) - (stack_size_f32 0) (stack_size_f64 0))) - (globals ()) (function_table_elements ()) - (global_function_table_offset ((stamp 1116) (name function_table_global))) - (compilation_mode Normal) (signature ) (type_metadata )) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MAllocate + (MTuple + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown))))))))))) + (main_body_stack_size + ((stack_size_ptr 0) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((stamp 1116) (name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature )) From 2d314afbb1ce0080d79fab7943d110ce1c69128b Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Wed, 9 Oct 2024 20:11:01 -0500 Subject: [PATCH 14/20] document object file layout --- compiler/src/codegen/emitmod.re | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/src/codegen/emitmod.re b/compiler/src/codegen/emitmod.re index 40fe98f172..5f69512e25 100644 --- a/compiler/src/codegen/emitmod.re +++ b/compiler/src/codegen/emitmod.re @@ -2,6 +2,13 @@ open Grain_typed; open Grain_utils; open Mashtree; +/* + Grain object files follow this layout: + + | magic | version length | version | mash_code offset | cmi | mash_code | + | 0xF0 0x9F 0x8C 0xBE | 5 | 0.6.3 | 1024 | | | + */ + type bad_object = | InvalidMagic | InvalidVersion From aa4c88c1bfb9a26ddf6125657b887835c700ad3c Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Wed, 9 Oct 2024 20:14:47 -0500 Subject: [PATCH 15/20] make small function for internal names in linkedtree --- compiler/src/codegen/linkedtree.re | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/src/codegen/linkedtree.re b/compiler/src/codegen/linkedtree.re index 78e335c0d4..1f9f005636 100644 --- a/compiler/src/codegen/linkedtree.re +++ b/compiler/src/codegen/linkedtree.re @@ -29,6 +29,12 @@ let max_stack_size = (s1, s2) => { let wasi_module = "wasi_snapshot_preview1"; +// Generates the name for the internal symbol. Symbols are scoped using the +// dependency ID for that module. +let internal_name = (id, dep_id) => { + Printf.sprintf("%s_%d", id, dep_id); +}; + let link = main_mashtree => { let main_module = Module_resolution.current_filename^(); @@ -144,7 +150,7 @@ let link = main_mashtree => { switch (export) { | WasmFunctionExport({ex_function_name, ex_function_internal_name}) => let internal_name = - Printf.sprintf("%s_%d", ex_function_internal_name, dep_id^); + internal_name(ex_function_internal_name, dep_id^); Hashtbl.add( func_export_resolutions, (dep, ex_function_name), @@ -159,8 +165,7 @@ let link = main_mashtree => { ); }; | WasmGlobalExport({ex_global_name, ex_global_internal_name}) => - let internal_name = - Printf.sprintf("%s_%d", ex_global_internal_name, dep_id^); + let internal_name = internal_name(ex_global_internal_name, dep_id^); Hashtbl.add( global_export_resolutions, (dep, ex_global_name), From 462676b2215dc2f8d91436166547b7d19227224a Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 9 Nov 2024 16:33:49 -0600 Subject: [PATCH 16/20] Merge with main with fixed exception handling --- compiler/src/codegen/compcore.re | 15 ++++++++----- compiler/src/codegen/mashtree.re | 2 +- compiler/src/codegen/transl_anf.re | 5 ++++- compiler/src/compile.re | 1 + compiler/src/parsing/driver.re | 1 + compiler/src/parsing/well_formedness.re | 1 + compiler/src/utils/config.re | 25 ++++++++++++++------- compiler/src/utils/config.rei | 11 +++++++-- compiler/test/suites/basic_functionality.re | 2 +- stdlib/exception.gr | 2 -- stdlib/runtime/exception.gr | 1 + 11 files changed, 45 insertions(+), 21 deletions(-) diff --git a/compiler/src/codegen/compcore.re b/compiler/src/codegen/compcore.re index f5297b843a..397346d504 100644 --- a/compiler/src/codegen/compcore.re +++ b/compiler/src/codegen/compcore.re @@ -59,8 +59,6 @@ let runtime_heap_next_ptr_name = Ident.unique_name(Ident.create_persistent("runtimeHeapNextPtr")); let metadata_ptr_name = Ident.unique_name(Ident.create_persistent("metadataPtr")); -let reloc_base_name = - Ident.unique_name(Ident.create_persistent("relocBase")); /* Memory allocation */ let malloc_name = Ident.unique_name(Ident.create_persistent("malloc")); @@ -658,8 +656,9 @@ let heap_allocate = (wasm_mod, env, num_words: int) => runtime_heap_next_ptr_name, Type.int32, ), - // fake GC refcount of 1 - Expression.Const.make(wasm_mod, const_int32(1)), + // fake GC refcount of 2 + // this means objects (should) never drop to zero refcount + Expression.Const.make(wasm_mod, const_int32(2)), ), Expression.Binary.make( wasm_mod, @@ -1158,7 +1157,7 @@ let compile_record_op = (wasm_mod, env, rec_imm, op) => { let compile_closure_op = (wasm_mod, env, closure_imm, op) => { let closure = () => compile_imm(wasm_mod, env, closure_imm); switch (op) { - | MClosureSetPtr(idx) => + | MClosureSetPtr(global_offset, idx) => store( ~offset=8, wasm_mod, @@ -1166,7 +1165,11 @@ let compile_closure_op = (wasm_mod, env, closure_imm, op) => { Expression.Binary.make( wasm_mod, Op.add_int32, - Expression.Global_get.make(wasm_mod, reloc_base_name, Type.int32), + Expression.Global_get.make( + wasm_mod, + linked_name(~env, global_offset), + Type.int32, + ), Expression.Const.make(wasm_mod, wrap_int32(idx)), ), ) diff --git a/compiler/src/codegen/mashtree.re b/compiler/src/codegen/mashtree.re index 0c712111b9..3a208c927f 100644 --- a/compiler/src/codegen/mashtree.re +++ b/compiler/src/codegen/mashtree.re @@ -424,7 +424,7 @@ type record_op = [@deriving sexp] type closure_op = - | MClosureSetPtr(int32); + | MClosureSetPtr(string, int32); [@deriving sexp] type instr = { diff --git a/compiler/src/codegen/transl_anf.re b/compiler/src/codegen/transl_anf.re index 0fa9f1068a..8ceab4a9a5 100644 --- a/compiler/src/codegen/transl_anf.re +++ b/compiler/src/codegen/transl_anf.re @@ -765,7 +765,10 @@ let lift_imports = (env, imports) => { { instr_desc: MClosureOp( - MClosureSetPtr(Int32.of_int(idx)), + MClosureSetPtr( + get_function_table_global_name(), + Int32.of_int(idx), + ), imm( MImmBinding( MGlobalBind( diff --git a/compiler/src/compile.re b/compiler/src/compile.re index 7a314f459d..27887dd4af 100644 --- a/compiler/src/compile.re +++ b/compiler/src/compile.re @@ -149,6 +149,7 @@ let next_state = (~is_root_file=false, {cstate_desc, cstate_filename} as cs) => Grain_utils.Config.apply_attribute_flags( ~no_pervasives=has_attr("noPervasives"), ~runtime_mode=has_attr("runtimeMode"), + ~no_exception_mod=has_attr("exceptionMod"), ); Well_formedness.check_well_formedness(p); diff --git a/compiler/src/parsing/driver.re b/compiler/src/parsing/driver.re index dcfa1612ad..e6e600da31 100644 --- a/compiler/src/parsing/driver.re +++ b/compiler/src/parsing/driver.re @@ -161,6 +161,7 @@ let read_imports = (program: Parsetree.parsed_program) => { Grain_utils.Config.with_attribute_flags( ~no_pervasives=module_has_attr("noPervasives"), ~runtime_mode=module_has_attr("runtimeMode"), + ~no_exception_mod=module_has_attr("exceptionMod"), Grain_utils.Config.get_implicit_opens, ), ); diff --git a/compiler/src/parsing/well_formedness.re b/compiler/src/parsing/well_formedness.re index 103edf6550..8eb34e8a7e 100644 --- a/compiler/src/parsing/well_formedness.re +++ b/compiler/src/parsing/well_formedness.re @@ -402,6 +402,7 @@ let disallowed_attributes = (errs, super) => { let known_module_attributes = [ {name: "runtimeMode", arity: 0}, {name: "noPervasives", arity: 0}, + {name: "exceptionMod", arity: 0}, ]; validate_against_known(attributes, known_module_attributes, "module"); super.enter_parsed_program(prog); diff --git a/compiler/src/utils/config.re b/compiler/src/utils/config.re index 2f41324a0b..252e82221b 100644 --- a/compiler/src/utils/config.re +++ b/compiler/src/utils/config.re @@ -411,6 +411,8 @@ type compilation_mode = let compilation_mode = internal_opt(Normal, NotDigestible); +let no_exception_mod = internal_opt(false, NotDigestible); + let statically_link = toggle_flag( ~names=["no-link"], @@ -566,7 +568,8 @@ let module_search_path = () => { }; }; -let apply_attribute_flags = (~no_pervasives as np, ~runtime_mode as rm) => { +let apply_attribute_flags = + (~no_pervasives as np, ~runtime_mode as rm, ~no_exception_mod as ne) => { // Only apply options if attributes were explicitly given so as to not // unintentionally override options set previously e.g. compiling a // wasi-polyfill file in non-runtime-mode if @runtimeMode is not specified @@ -576,11 +579,15 @@ let apply_attribute_flags = (~no_pervasives as np, ~runtime_mode as rm) => { if (rm) { compilation_mode := Runtime; }; + if (ne) { + no_exception_mod := true; + }; }; -let with_attribute_flags = (~no_pervasives, ~runtime_mode, thunk) => { +let with_attribute_flags = + (~no_pervasives, ~runtime_mode, ~no_exception_mod, thunk) => { preserve_config(() => { - apply_attribute_flags(~no_pervasives, ~runtime_mode); + apply_attribute_flags(~no_pervasives, ~runtime_mode, ~no_exception_mod); thunk(); }); }; @@ -611,11 +618,13 @@ let get_implicit_opens = () => { if (compilation_mode^ == Runtime) { []; } else { + let ret = + if (no_exception_mod^) { + ret; + } else { + [Exception_mod, ...ret]; + }; // Pervasives goes first, just for good measure. - List.rev([ - Gc_mod, - Exception_mod, - ...ret, - ]); + List.rev([Gc_mod, ...ret]); }; }; diff --git a/compiler/src/utils/config.rei b/compiler/src/utils/config.rei index 7ea10bceee..c67c7ed79e 100644 --- a/compiler/src/utils/config.rei +++ b/compiler/src/utils/config.rei @@ -184,10 +184,17 @@ let with_cli_options: 'a => Cmdliner.Term.t('a); /** Applies compile flags provided as module attributes */ -let apply_attribute_flags: (~no_pervasives: bool, ~runtime_mode: bool) => unit; +let apply_attribute_flags: + (~no_pervasives: bool, ~runtime_mode: bool, ~no_exception_mod: bool) => unit; let with_attribute_flags: - (~no_pervasives: bool, ~runtime_mode: bool, unit => 'a) => 'a; + ( + ~no_pervasives: bool, + ~runtime_mode: bool, + ~no_exception_mod: bool, + unit => 'a + ) => + 'a; type implicit_opens = | Pervasives_mod diff --git a/compiler/test/suites/basic_functionality.re b/compiler/test/suites/basic_functionality.re index e29f856d99..83e3d05753 100644 --- a/compiler/test/suites/basic_functionality.re +++ b/compiler/test/suites/basic_functionality.re @@ -377,6 +377,6 @@ describe("basic functionality", ({test, testSkip}) => { ~config_fn=smallestFileConfig, "smallest_grain_program", "", - 6829, + 6507, ); }); diff --git a/stdlib/exception.gr b/stdlib/exception.gr index bdd9a4958b..da33b86636 100644 --- a/stdlib/exception.gr +++ b/stdlib/exception.gr @@ -12,8 +12,6 @@ */ module Exception -from "runtime/unsafe/wasmi32" include WasmI32 -from "runtime/unsafe/memory" include Memory from "runtime/exception" include Exception /** diff --git a/stdlib/runtime/exception.gr b/stdlib/runtime/exception.gr index 483d957bab..d5701b7791 100644 --- a/stdlib/runtime/exception.gr +++ b/stdlib/runtime/exception.gr @@ -1,4 +1,5 @@ @noPervasives +@exceptionMod module Exception from "runtime/unsafe/panic" include Panic From 209b9e4a380aded01dc70ff4834955cc13f31ca2 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 28 Dec 2024 17:04:31 -0600 Subject: [PATCH 17/20] fixed jsoo issue --- compiler/src/codegen/emitmod.re | 19 ++++++++++++------- compiler/src/typed/cmi_format.re | 12 ++++++++++-- compiler/src/typed/cmi_format.rei | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/compiler/src/codegen/emitmod.re b/compiler/src/codegen/emitmod.re index 5f69512e25..d07d708987 100644 --- a/compiler/src/codegen/emitmod.re +++ b/compiler/src/codegen/emitmod.re @@ -5,8 +5,8 @@ open Mashtree; /* Grain object files follow this layout: - | magic | version length | version | mash_code offset | cmi | mash_code | - | 0xF0 0x9F 0x8C 0xBE | 5 | 0.6.3 | 1024 | | | + | magic | version length | version | cmi length | cmi | mash_code | + | 0xF0 0x9F 0x8C 0xBE | 5 | 0.6.3 | 1024 | | | */ type bad_object = @@ -29,12 +29,12 @@ let emit_object = (mashed: mash_program, outfile) => { let oc = open_out_bin(outfile); - output_string(oc, Cmi_format.magic); + output_bytes(oc, Cmi_format.magic); let version_length = String.length(Config.version); output_binary_int(oc, version_length); output_string(oc, Config.version); let cmi = Marshal.to_bytes(mashed.signature, []); - output_binary_int(oc, Bytes.length(cmi) + version_length + 12); + output_binary_int(oc, Bytes.length(cmi)); output_bytes(oc, cmi); Marshal.to_channel(oc, mashed.mash_code, []); @@ -42,7 +42,8 @@ let emit_object = (mashed: mash_program, outfile) => { }; let load_object = (ic): mash_program => { - let read_magic = really_input_string(ic, 4); + let read_magic = Bytes.create(4); + really_input(ic, read_magic, 0, 4); if (read_magic != Cmi_format.magic) { raise(BadObject(InvalidMagic)); }; @@ -51,9 +52,13 @@ let load_object = (ic): mash_program => { if (read_version != Config.version) { raise(BadObject(InvalidVersion)); }; - let _ = input_binary_int(ic); + let cmi_length = input_binary_int(ic); + // JSOO messes up positioning when unmarshaling from a channel, so we read + // the CMI fully into memory to preserve the correct position for the code + let cmi_bytes = Bytes.create(cmi_length); + really_input(ic, cmi_bytes, 0, cmi_length); let signature: Cmi_format.cmi_infos = - try(input_value(ic)) { + try(Marshal.from_bytes(cmi_bytes, 0)) { | _ => raise(BadObject(Corrupted)) }; let mash_code: mash_code = diff --git a/compiler/src/typed/cmi_format.re b/compiler/src/typed/cmi_format.re index b842ed6437..3331e995fc 100644 --- a/compiler/src/typed/cmi_format.re +++ b/compiler/src/typed/cmi_format.re @@ -87,7 +87,14 @@ type cmi_infos = { type config_opt = | Cmi_config_opt('a): config_opt; -let magic = "\xF0\x9F\x8C\xBE"; +let magic = { + let bytes = Bytes.create(4); + Bytes.set_uint8(bytes, 0, 0xF0); + Bytes.set_uint8(bytes, 1, 0x9F); + Bytes.set_uint8(bytes, 2, 0x8C); + Bytes.set_uint8(bytes, 3, 0xBE); + bytes; +}; let config_sum = Config.get_root_config_digest; @@ -139,7 +146,8 @@ module CmiBinarySection = }); let read_cmi = (ic, filename): cmi_infos => { - let read_magic = really_input_string(ic, 4); + let read_magic = Bytes.create(4); + really_input(ic, read_magic, 0, 4); if (read_magic != magic) { raise(Error(Corrupted_interface(filename))); }; diff --git a/compiler/src/typed/cmi_format.rei b/compiler/src/typed/cmi_format.rei index b53fa47a0d..68930ff109 100644 --- a/compiler/src/typed/cmi_format.rei +++ b/compiler/src/typed/cmi_format.rei @@ -35,7 +35,7 @@ type cmi_infos = { cmi_config_sum: string, }; -let magic: string; +let magic: bytes; let config_sum: unit => string; From 2b205ef5da32777026d210026624076c9c0780fe Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 28 Dec 2024 17:14:57 -0600 Subject: [PATCH 18/20] update contributor docs --- docs/contributor/compiler_walkthrough.md | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/contributor/compiler_walkthrough.md b/docs/contributor/compiler_walkthrough.md index 02d2c5d4e1..78311303da 100644 --- a/docs/contributor/compiler_walkthrough.md +++ b/docs/contributor/compiler_walkthrough.md @@ -9,15 +9,17 @@ We'll largely be following the `next_state` function in [compile.re](https://git The Grain compiler is a [multi-stage](https://en.wikipedia.org/wiki/Multi-pass_compiler) compiler, which means instead of converting directly from Grain syntax into `wasm` code, we send the input program through multiple phases, transforming from one intermediate representation to the next until we get to the final output. This approach allows us to have a more maintainable compiler and perform deeper analysis of the source code, which lets us provide better errors and better code output. ## File Structure + All files directly related to the compiler can be found in `compiler/src` with a map of the sub-folders found below: -* `src/parsing` - all code related to parsing and lexing -* `src/typed` - all code related to typechecking and the typed phases of the compiler -* `src/codegen` - all code related to generating both the mashtree and final wasm output which is the last two compilation steps before linking -* `src/linking` - the grain linker and code responsible for linking the intermediate wasm modules into the final wasm output -* `src/diagnostics` - all code related to parsing and handling comments for `graindoc` -* `src/formatting` - all the relevant code to the grain formatter -* `src/language_server` - all relevant code to the language server -* `src/utils` - all of our common helpers used in various places throughout the compiler + +- `src/parsing` - all code related to parsing and lexing +- `src/typed` - all code related to typechecking and the typed phases of the compiler +- `src/codegen` - all code related to generating both the mashtree and final wasm output which is the last two compilation steps before linking +- `src/linking` - the grain linker and code responsible for linking the intermediate wasm modules into the final wasm output +- `src/diagnostics` - all code related to parsing and handling comments for `graindoc` +- `src/formatting` - all the relevant code to the grain formatter +- `src/language_server` - all relevant code to the language server +- `src/utils` - all of our common helpers used in various places throughout the compiler ## Lexing @@ -140,16 +142,16 @@ You can find the entrypoints into optimization in [middle_end/optimize.re](https We couldn't think of a better name for this stage, but it's (mostly) the last representation before outputting the actual WebAssembly instructions. It's here that we decide what actually gets allocated in memory and how we retrieve and change things in memory. You can find the mashtree [here](https://github.com/grain-lang/grain/blob/main/compiler/src/codegen/mashtree.re) and the conversion process from ANF in [codegen/transl_anf.re](https://github.com/grain-lang/grain/blob/main/compiler/src/codegen/transl_anf.re). +## Linking + +Each Grain source file is compiled to a Grain-specific object file containing the program signature and mashtree. To create the final program, we merge all of the programs together in a step known as linking. This takes place in [codegen/linkedtree.re](https://github.com/grain-lang/grain/blob/main/compiler/src/codegen/linkedtree.re) + ## Code generation The code generation (or codegen) step is where we generate the actual WebAssembly code for the program. By this point, we should have reduced the complexity of the original program down enough that there is a straightforward set of WebAssembly instructions for each action that needs to happen. We use a project called [Binaryen](https://github.com/WebAssembly/binaryen) to generate our wasm code, via [Binaryen.ml](https://github.com/grain-lang/binaryen.ml). You can get a general idea of how Binaryen works from the example in the [Binaryen.ml README](https://github.com/grain-lang/binaryen.ml/blob/main/README.md). You can then see how we use it in Grain in [codegen/compcore.re](https://github.com/grain-lang/grain/blob/main/compiler/src/codegen/compcore.re). If you're curious about the wasm spec in general, you can check it out [here](https://webassembly.github.io/spec/core/index.html). -## Linking - -Each Grain source file is compiled to a Grain-specific wasm file. To create the final program, we merge all of the files together in a step known as linking. This takes place in [linking/link.re](https://github.com/grain-lang/grain/blob/main/compiler/src/linking/link.re) - ## Emission Lastly, we write the wasm to a file. And that's it! If you want an in-depth dive into any of the stages of the compiler, feel free to ask in the Discord and someone will be more than happy to walk you through it. From e4a92c13fc6a7cef38a57fdae3d83d3fc27be664 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Sat, 28 Dec 2024 17:18:42 -0600 Subject: [PATCH 19/20] rename exceptionMod -> noExceptions --- compiler/src/compile.re | 2 +- compiler/src/parsing/driver.re | 2 +- compiler/src/parsing/well_formedness.re | 2 +- stdlib/runtime/exception.gr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/compile.re b/compiler/src/compile.re index 27887dd4af..e70dd5a949 100644 --- a/compiler/src/compile.re +++ b/compiler/src/compile.re @@ -149,7 +149,7 @@ let next_state = (~is_root_file=false, {cstate_desc, cstate_filename} as cs) => Grain_utils.Config.apply_attribute_flags( ~no_pervasives=has_attr("noPervasives"), ~runtime_mode=has_attr("runtimeMode"), - ~no_exception_mod=has_attr("exceptionMod"), + ~no_exception_mod=has_attr("noExceptions"), ); Well_formedness.check_well_formedness(p); diff --git a/compiler/src/parsing/driver.re b/compiler/src/parsing/driver.re index e6e600da31..35d8371197 100644 --- a/compiler/src/parsing/driver.re +++ b/compiler/src/parsing/driver.re @@ -161,7 +161,7 @@ let read_imports = (program: Parsetree.parsed_program) => { Grain_utils.Config.with_attribute_flags( ~no_pervasives=module_has_attr("noPervasives"), ~runtime_mode=module_has_attr("runtimeMode"), - ~no_exception_mod=module_has_attr("exceptionMod"), + ~no_exception_mod=module_has_attr("noExceptions"), Grain_utils.Config.get_implicit_opens, ), ); diff --git a/compiler/src/parsing/well_formedness.re b/compiler/src/parsing/well_formedness.re index 8eb34e8a7e..0843abdb74 100644 --- a/compiler/src/parsing/well_formedness.re +++ b/compiler/src/parsing/well_formedness.re @@ -402,7 +402,7 @@ let disallowed_attributes = (errs, super) => { let known_module_attributes = [ {name: "runtimeMode", arity: 0}, {name: "noPervasives", arity: 0}, - {name: "exceptionMod", arity: 0}, + {name: "noExceptions", arity: 0}, ]; validate_against_known(attributes, known_module_attributes, "module"); super.enter_parsed_program(prog); diff --git a/stdlib/runtime/exception.gr b/stdlib/runtime/exception.gr index d5701b7791..eaf95a8baf 100644 --- a/stdlib/runtime/exception.gr +++ b/stdlib/runtime/exception.gr @@ -1,5 +1,5 @@ @noPervasives -@exceptionMod +@noExceptions module Exception from "runtime/unsafe/panic" include Panic From eef00bd21bbb93f672f0d6d8e911fbdd58ab9392 Mon Sep 17 00:00:00 2001 From: Oscar Spencer Date: Thu, 2 Jan 2025 14:05:59 -0600 Subject: [PATCH 20/20] Update list snapshot --- .../__snapshots__/lists.4cfe47d3.0.snapshot | 5748 +++++------------ 1 file changed, 1556 insertions(+), 4192 deletions(-) diff --git a/compiler/test/__snapshots__/lists.4cfe47d3.0.snapshot b/compiler/test/__snapshots__/lists.4cfe47d3.0.snapshot index 3ef6e1b8d7..96b2ae2725 100644 --- a/compiler/test/__snapshots__/lists.4cfe47d3.0.snapshot +++ b/compiler/test/__snapshots__/lists.4cfe47d3.0.snapshot @@ -1,4193 +1,1557 @@ lists › list_large1 -(module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import \"_genv\" \"tbl\" (table $tbl 0 funcref)) - (import \"_genv\" \"relocBase\" (global $relocBase_0 i32)) - (import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) - (import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32)) - (import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32))) - (import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32)) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) - (import \"GRAIN$MODULE$runtime/gc.gr\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) - (global $GRAIN$TABLE_SIZE i32 (i32.const 0)) - (memory $0 0) - (elem $elem (global.get $relocBase_0)) - (export \"memory\" (memory $0)) - (export \"_gmain\" (func $_gmain)) - (export \"_start\" (func $_start)) - (export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) - (func $_gmain (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i32) - (local $27 i32) - (local $28 i32) - (local $29 i32) - (local $30 i32) - (local $31 i32) - (local $32 i32) - (local $33 i32) - (local $34 i32) - (local $35 i32) - (local $36 i32) - (local $37 i32) - (local $38 i32) - (local $39 i32) - (local $40 i32) - (local $41 i32) - (local $42 i32) - (local $43 i32) - (local $44 i32) - (local $45 i32) - (local $46 i32) - (local $47 i32) - (local $48 i32) - (local $49 i32) - (local $50 i32) - (local $51 i32) - (local $52 i32) - (local $53 i32) - (local $54 i32) - (local $55 i32) - (local $56 i32) - (local $57 i32) - (local $58 i32) - (local $59 i32) - (local $60 i32) - (local $61 i32) - (local $62 i32) - (local $63 i32) - (local $64 i32) - (local $65 i32) - (local $66 i32) - (local $67 i32) - (local $68 i32) - (local $69 i32) - (local $70 i32) - (local $71 i32) - (local $72 i32) - (local $73 i32) - (local $74 i32) - (local $75 i32) - (local $76 i32) - (local $77 i32) - (local $78 i32) - (local $79 i32) - (local $80 i32) - (local $81 i32) - (local $82 i32) - (local $83 i32) - (local $84 i32) - (local $85 i32) - (local $86 i32) - (local $87 i32) - (local $88 i32) - (local $89 i32) - (local $90 i32) - (local $91 i32) - (local $92 i32) - (local $93 i32) - (local $94 i32) - (local $95 i32) - (local $96 i32) - (local $97 i32) - (local $98 i32) - (local $99 i32) - (local $100 i32) - (local $101 i32) - (block $compile_block.290 (result i32) - (block $compile_store.3 - (local.set $6 - (block $allocate_adt.1 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 20) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 0) - ) - (local.get $0) - ) - ) - (block $do_backpatches.2 - ) - ) - (block $compile_store.6 - (local.set $7 - (block $allocate_adt.4 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 193) - ) - (i32.store offset=24 - (local.get $0) - (local.get $6) - ) - (local.get $0) - ) - ) - (block $do_backpatches.5 - ) - ) - (block $compile_store.9 - (local.set $8 - (block $allocate_adt.7 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 191) - ) - (i32.store offset=24 - (local.get $0) - (local.get $7) - ) - (local.get $0) - ) - ) - (block $do_backpatches.8 - ) - ) - (block $compile_store.12 - (local.set $9 - (block $allocate_adt.10 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 189) - ) - (i32.store offset=24 - (local.get $0) - (local.get $8) - ) - (local.get $0) - ) - ) - (block $do_backpatches.11 - ) - ) - (block $compile_store.15 - (local.set $10 - (block $allocate_adt.13 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 187) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) - ) - (local.get $0) - ) - ) - (block $do_backpatches.14 - ) - ) - (block $compile_store.18 - (local.set $11 - (block $allocate_adt.16 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 185) - ) - (i32.store offset=24 - (local.get $0) - (local.get $10) - ) - (local.get $0) - ) - ) - (block $do_backpatches.17 - ) - ) - (block $compile_store.21 - (local.set $12 - (block $allocate_adt.19 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 183) - ) - (i32.store offset=24 - (local.get $0) - (local.get $11) - ) - (local.get $0) - ) - ) - (block $do_backpatches.20 - ) - ) - (block $compile_store.24 - (local.set $13 - (block $allocate_adt.22 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 181) - ) - (i32.store offset=24 - (local.get $0) - (local.get $12) - ) - (local.get $0) - ) - ) - (block $do_backpatches.23 - ) - ) - (block $compile_store.27 - (local.set $14 - (block $allocate_adt.25 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 179) - ) - (i32.store offset=24 - (local.get $0) - (local.get $13) - ) - (local.get $0) - ) - ) - (block $do_backpatches.26 - ) - ) - (block $compile_store.30 - (local.set $15 - (block $allocate_adt.28 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 177) - ) - (i32.store offset=24 - (local.get $0) - (local.get $14) - ) - (local.get $0) - ) - ) - (block $do_backpatches.29 - ) - ) - (block $compile_store.33 - (local.set $16 - (block $allocate_adt.31 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 175) - ) - (i32.store offset=24 - (local.get $0) - (local.get $15) - ) - (local.get $0) - ) - ) - (block $do_backpatches.32 - ) - ) - (block $compile_store.36 - (local.set $17 - (block $allocate_adt.34 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 173) - ) - (i32.store offset=24 - (local.get $0) - (local.get $16) - ) - (local.get $0) - ) - ) - (block $do_backpatches.35 - ) - ) - (block $compile_store.39 - (local.set $18 - (block $allocate_adt.37 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 171) - ) - (i32.store offset=24 - (local.get $0) - (local.get $17) - ) - (local.get $0) - ) - ) - (block $do_backpatches.38 - ) - ) - (block $compile_store.42 - (local.set $19 - (block $allocate_adt.40 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 169) - ) - (i32.store offset=24 - (local.get $0) - (local.get $18) - ) - (local.get $0) - ) - ) - (block $do_backpatches.41 - ) - ) - (block $compile_store.45 - (local.set $20 - (block $allocate_adt.43 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 167) - ) - (i32.store offset=24 - (local.get $0) - (local.get $19) - ) - (local.get $0) - ) - ) - (block $do_backpatches.44 - ) - ) - (block $compile_store.48 - (local.set $21 - (block $allocate_adt.46 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 165) - ) - (i32.store offset=24 - (local.get $0) - (local.get $20) - ) - (local.get $0) - ) - ) - (block $do_backpatches.47 - ) - ) - (block $compile_store.51 - (local.set $22 - (block $allocate_adt.49 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 163) - ) - (i32.store offset=24 - (local.get $0) - (local.get $21) - ) - (local.get $0) - ) - ) - (block $do_backpatches.50 - ) - ) - (block $compile_store.54 - (local.set $23 - (block $allocate_adt.52 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 161) - ) - (i32.store offset=24 - (local.get $0) - (local.get $22) - ) - (local.get $0) - ) - ) - (block $do_backpatches.53 - ) - ) - (block $compile_store.57 - (local.set $24 - (block $allocate_adt.55 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 159) - ) - (i32.store offset=24 - (local.get $0) - (local.get $23) - ) - (local.get $0) - ) - ) - (block $do_backpatches.56 - ) - ) - (block $compile_store.60 - (local.set $25 - (block $allocate_adt.58 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 157) - ) - (i32.store offset=24 - (local.get $0) - (local.get $24) - ) - (local.get $0) - ) - ) - (block $do_backpatches.59 - ) - ) - (block $compile_store.63 - (local.set $26 - (block $allocate_adt.61 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 155) - ) - (i32.store offset=24 - (local.get $0) - (local.get $25) - ) - (local.get $0) - ) - ) - (block $do_backpatches.62 - ) - ) - (block $compile_store.66 - (local.set $27 - (block $allocate_adt.64 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 153) - ) - (i32.store offset=24 - (local.get $0) - (local.get $26) - ) - (local.get $0) - ) - ) - (block $do_backpatches.65 - ) - ) - (block $compile_store.69 - (local.set $28 - (block $allocate_adt.67 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 151) - ) - (i32.store offset=24 - (local.get $0) - (local.get $27) - ) - (local.get $0) - ) - ) - (block $do_backpatches.68 - ) - ) - (block $compile_store.72 - (local.set $29 - (block $allocate_adt.70 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 149) - ) - (i32.store offset=24 - (local.get $0) - (local.get $28) - ) - (local.get $0) - ) - ) - (block $do_backpatches.71 - ) - ) - (block $compile_store.75 - (local.set $30 - (block $allocate_adt.73 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 147) - ) - (i32.store offset=24 - (local.get $0) - (local.get $29) - ) - (local.get $0) - ) - ) - (block $do_backpatches.74 - ) - ) - (block $compile_store.78 - (local.set $31 - (block $allocate_adt.76 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 145) - ) - (i32.store offset=24 - (local.get $0) - (local.get $30) - ) - (local.get $0) - ) - ) - (block $do_backpatches.77 - ) - ) - (block $compile_store.81 - (local.set $32 - (block $allocate_adt.79 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 143) - ) - (i32.store offset=24 - (local.get $0) - (local.get $31) - ) - (local.get $0) - ) - ) - (block $do_backpatches.80 - ) - ) - (block $compile_store.84 - (local.set $33 - (block $allocate_adt.82 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 141) - ) - (i32.store offset=24 - (local.get $0) - (local.get $32) - ) - (local.get $0) - ) - ) - (block $do_backpatches.83 - ) - ) - (block $compile_store.87 - (local.set $34 - (block $allocate_adt.85 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 139) - ) - (i32.store offset=24 - (local.get $0) - (local.get $33) - ) - (local.get $0) - ) - ) - (block $do_backpatches.86 - ) - ) - (block $compile_store.90 - (local.set $35 - (block $allocate_adt.88 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 137) - ) - (i32.store offset=24 - (local.get $0) - (local.get $34) - ) - (local.get $0) - ) - ) - (block $do_backpatches.89 - ) - ) - (block $compile_store.93 - (local.set $36 - (block $allocate_adt.91 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 135) - ) - (i32.store offset=24 - (local.get $0) - (local.get $35) - ) - (local.get $0) - ) - ) - (block $do_backpatches.92 - ) - ) - (block $compile_store.96 - (local.set $37 - (block $allocate_adt.94 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 133) - ) - (i32.store offset=24 - (local.get $0) - (local.get $36) - ) - (local.get $0) - ) - ) - (block $do_backpatches.95 - ) - ) - (block $compile_store.99 - (local.set $38 - (block $allocate_adt.97 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 131) - ) - (i32.store offset=24 - (local.get $0) - (local.get $37) - ) - (local.get $0) - ) - ) - (block $do_backpatches.98 - ) - ) - (block $compile_store.102 - (local.set $39 - (block $allocate_adt.100 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 129) - ) - (i32.store offset=24 - (local.get $0) - (local.get $38) - ) - (local.get $0) - ) - ) - (block $do_backpatches.101 - ) - ) - (block $compile_store.105 - (local.set $40 - (block $allocate_adt.103 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 127) - ) - (i32.store offset=24 - (local.get $0) - (local.get $39) - ) - (local.get $0) - ) - ) - (block $do_backpatches.104 - ) - ) - (block $compile_store.108 - (local.set $41 - (block $allocate_adt.106 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 125) - ) - (i32.store offset=24 - (local.get $0) - (local.get $40) - ) - (local.get $0) - ) - ) - (block $do_backpatches.107 - ) - ) - (block $compile_store.111 - (local.set $42 - (block $allocate_adt.109 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 123) - ) - (i32.store offset=24 - (local.get $0) - (local.get $41) - ) - (local.get $0) - ) - ) - (block $do_backpatches.110 - ) - ) - (block $compile_store.114 - (local.set $43 - (block $allocate_adt.112 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 121) - ) - (i32.store offset=24 - (local.get $0) - (local.get $42) - ) - (local.get $0) - ) - ) - (block $do_backpatches.113 - ) - ) - (block $compile_store.117 - (local.set $44 - (block $allocate_adt.115 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 119) - ) - (i32.store offset=24 - (local.get $0) - (local.get $43) - ) - (local.get $0) - ) - ) - (block $do_backpatches.116 - ) - ) - (block $compile_store.120 - (local.set $45 - (block $allocate_adt.118 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 117) - ) - (i32.store offset=24 - (local.get $0) - (local.get $44) - ) - (local.get $0) - ) - ) - (block $do_backpatches.119 - ) - ) - (block $compile_store.123 - (local.set $46 - (block $allocate_adt.121 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 115) - ) - (i32.store offset=24 - (local.get $0) - (local.get $45) - ) - (local.get $0) - ) - ) - (block $do_backpatches.122 - ) - ) - (block $compile_store.126 - (local.set $47 - (block $allocate_adt.124 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 113) - ) - (i32.store offset=24 - (local.get $0) - (local.get $46) - ) - (local.get $0) - ) - ) - (block $do_backpatches.125 - ) - ) - (block $compile_store.129 - (local.set $48 - (block $allocate_adt.127 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 111) - ) - (i32.store offset=24 - (local.get $0) - (local.get $47) - ) - (local.get $0) - ) - ) - (block $do_backpatches.128 - ) - ) - (block $compile_store.132 - (local.set $49 - (block $allocate_adt.130 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 109) - ) - (i32.store offset=24 - (local.get $0) - (local.get $48) - ) - (local.get $0) - ) - ) - (block $do_backpatches.131 - ) - ) - (block $compile_store.135 - (local.set $50 - (block $allocate_adt.133 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 107) - ) - (i32.store offset=24 - (local.get $0) - (local.get $49) - ) - (local.get $0) - ) - ) - (block $do_backpatches.134 - ) - ) - (block $compile_store.138 - (local.set $51 - (block $allocate_adt.136 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 105) - ) - (i32.store offset=24 - (local.get $0) - (local.get $50) - ) - (local.get $0) - ) - ) - (block $do_backpatches.137 - ) - ) - (block $compile_store.141 - (local.set $52 - (block $allocate_adt.139 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 103) - ) - (i32.store offset=24 - (local.get $0) - (local.get $51) - ) - (local.get $0) - ) - ) - (block $do_backpatches.140 - ) - ) - (block $compile_store.144 - (local.set $53 - (block $allocate_adt.142 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 101) - ) - (i32.store offset=24 - (local.get $0) - (local.get $52) - ) - (local.get $0) - ) - ) - (block $do_backpatches.143 - ) - ) - (block $compile_store.147 - (local.set $54 - (block $allocate_adt.145 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 99) - ) - (i32.store offset=24 - (local.get $0) - (local.get $53) - ) - (local.get $0) - ) - ) - (block $do_backpatches.146 - ) - ) - (block $compile_store.150 - (local.set $55 - (block $allocate_adt.148 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 97) - ) - (i32.store offset=24 - (local.get $0) - (local.get $54) - ) - (local.get $0) - ) - ) - (block $do_backpatches.149 - ) - ) - (block $compile_store.153 - (local.set $56 - (block $allocate_adt.151 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 95) - ) - (i32.store offset=24 - (local.get $0) - (local.get $55) - ) - (local.get $0) - ) - ) - (block $do_backpatches.152 - ) - ) - (block $compile_store.156 - (local.set $57 - (block $allocate_adt.154 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 93) - ) - (i32.store offset=24 - (local.get $0) - (local.get $56) - ) - (local.get $0) - ) - ) - (block $do_backpatches.155 - ) - ) - (block $compile_store.159 - (local.set $58 - (block $allocate_adt.157 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 91) - ) - (i32.store offset=24 - (local.get $0) - (local.get $57) - ) - (local.get $0) - ) - ) - (block $do_backpatches.158 - ) - ) - (block $compile_store.162 - (local.set $59 - (block $allocate_adt.160 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 89) - ) - (i32.store offset=24 - (local.get $0) - (local.get $58) - ) - (local.get $0) - ) - ) - (block $do_backpatches.161 - ) - ) - (block $compile_store.165 - (local.set $60 - (block $allocate_adt.163 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 87) - ) - (i32.store offset=24 - (local.get $0) - (local.get $59) - ) - (local.get $0) - ) - ) - (block $do_backpatches.164 - ) - ) - (block $compile_store.168 - (local.set $61 - (block $allocate_adt.166 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 85) - ) - (i32.store offset=24 - (local.get $0) - (local.get $60) - ) - (local.get $0) - ) - ) - (block $do_backpatches.167 - ) - ) - (block $compile_store.171 - (local.set $62 - (block $allocate_adt.169 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 83) - ) - (i32.store offset=24 - (local.get $0) - (local.get $61) - ) - (local.get $0) - ) - ) - (block $do_backpatches.170 - ) - ) - (block $compile_store.174 - (local.set $63 - (block $allocate_adt.172 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 81) - ) - (i32.store offset=24 - (local.get $0) - (local.get $62) - ) - (local.get $0) - ) - ) - (block $do_backpatches.173 - ) - ) - (block $compile_store.177 - (local.set $64 - (block $allocate_adt.175 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 79) - ) - (i32.store offset=24 - (local.get $0) - (local.get $63) - ) - (local.get $0) - ) - ) - (block $do_backpatches.176 - ) - ) - (block $compile_store.180 - (local.set $65 - (block $allocate_adt.178 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 77) - ) - (i32.store offset=24 - (local.get $0) - (local.get $64) - ) - (local.get $0) - ) - ) - (block $do_backpatches.179 - ) - ) - (block $compile_store.183 - (local.set $66 - (block $allocate_adt.181 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 75) - ) - (i32.store offset=24 - (local.get $0) - (local.get $65) - ) - (local.get $0) - ) - ) - (block $do_backpatches.182 - ) - ) - (block $compile_store.186 - (local.set $67 - (block $allocate_adt.184 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 73) - ) - (i32.store offset=24 - (local.get $0) - (local.get $66) - ) - (local.get $0) - ) - ) - (block $do_backpatches.185 - ) - ) - (block $compile_store.189 - (local.set $68 - (block $allocate_adt.187 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 71) - ) - (i32.store offset=24 - (local.get $0) - (local.get $67) - ) - (local.get $0) - ) - ) - (block $do_backpatches.188 - ) - ) - (block $compile_store.192 - (local.set $69 - (block $allocate_adt.190 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 69) - ) - (i32.store offset=24 - (local.get $0) - (local.get $68) - ) - (local.get $0) - ) - ) - (block $do_backpatches.191 - ) - ) - (block $compile_store.195 - (local.set $70 - (block $allocate_adt.193 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 67) - ) - (i32.store offset=24 - (local.get $0) - (local.get $69) - ) - (local.get $0) - ) - ) - (block $do_backpatches.194 - ) - ) - (block $compile_store.198 - (local.set $71 - (block $allocate_adt.196 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 65) - ) - (i32.store offset=24 - (local.get $0) - (local.get $70) - ) - (local.get $0) - ) - ) - (block $do_backpatches.197 - ) - ) - (block $compile_store.201 - (local.set $72 - (block $allocate_adt.199 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 63) - ) - (i32.store offset=24 - (local.get $0) - (local.get $71) - ) - (local.get $0) - ) - ) - (block $do_backpatches.200 - ) - ) - (block $compile_store.204 - (local.set $73 - (block $allocate_adt.202 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 61) - ) - (i32.store offset=24 - (local.get $0) - (local.get $72) - ) - (local.get $0) - ) - ) - (block $do_backpatches.203 - ) - ) - (block $compile_store.207 - (local.set $74 - (block $allocate_adt.205 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 59) - ) - (i32.store offset=24 - (local.get $0) - (local.get $73) - ) - (local.get $0) - ) - ) - (block $do_backpatches.206 - ) - ) - (block $compile_store.210 - (local.set $75 - (block $allocate_adt.208 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 57) - ) - (i32.store offset=24 - (local.get $0) - (local.get $74) - ) - (local.get $0) - ) - ) - (block $do_backpatches.209 - ) - ) - (block $compile_store.213 - (local.set $76 - (block $allocate_adt.211 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 55) - ) - (i32.store offset=24 - (local.get $0) - (local.get $75) - ) - (local.get $0) - ) - ) - (block $do_backpatches.212 - ) - ) - (block $compile_store.216 - (local.set $77 - (block $allocate_adt.214 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 53) - ) - (i32.store offset=24 - (local.get $0) - (local.get $76) - ) - (local.get $0) - ) - ) - (block $do_backpatches.215 - ) - ) - (block $compile_store.219 - (local.set $78 - (block $allocate_adt.217 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 51) - ) - (i32.store offset=24 - (local.get $0) - (local.get $77) - ) - (local.get $0) - ) - ) - (block $do_backpatches.218 - ) - ) - (block $compile_store.222 - (local.set $79 - (block $allocate_adt.220 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 49) - ) - (i32.store offset=24 - (local.get $0) - (local.get $78) - ) - (local.get $0) - ) - ) - (block $do_backpatches.221 - ) - ) - (block $compile_store.225 - (local.set $80 - (block $allocate_adt.223 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 47) - ) - (i32.store offset=24 - (local.get $0) - (local.get $79) - ) - (local.get $0) - ) - ) - (block $do_backpatches.224 - ) - ) - (block $compile_store.228 - (local.set $81 - (block $allocate_adt.226 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 45) - ) - (i32.store offset=24 - (local.get $0) - (local.get $80) - ) - (local.get $0) - ) - ) - (block $do_backpatches.227 - ) - ) - (block $compile_store.231 - (local.set $82 - (block $allocate_adt.229 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 43) - ) - (i32.store offset=24 - (local.get $0) - (local.get $81) - ) - (local.get $0) - ) - ) - (block $do_backpatches.230 - ) - ) - (block $compile_store.234 - (local.set $83 - (block $allocate_adt.232 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 41) - ) - (i32.store offset=24 - (local.get $0) - (local.get $82) - ) - (local.get $0) - ) - ) - (block $do_backpatches.233 - ) - ) - (block $compile_store.237 - (local.set $84 - (block $allocate_adt.235 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 39) - ) - (i32.store offset=24 - (local.get $0) - (local.get $83) - ) - (local.get $0) - ) - ) - (block $do_backpatches.236 - ) - ) - (block $compile_store.240 - (local.set $85 - (block $allocate_adt.238 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 37) - ) - (i32.store offset=24 - (local.get $0) - (local.get $84) - ) - (local.get $0) - ) - ) - (block $do_backpatches.239 - ) - ) - (block $compile_store.243 - (local.set $86 - (block $allocate_adt.241 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 35) - ) - (i32.store offset=24 - (local.get $0) - (local.get $85) - ) - (local.get $0) - ) - ) - (block $do_backpatches.242 - ) - ) - (block $compile_store.246 - (local.set $87 - (block $allocate_adt.244 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 33) - ) - (i32.store offset=24 - (local.get $0) - (local.get $86) - ) - (local.get $0) - ) - ) - (block $do_backpatches.245 - ) - ) - (block $compile_store.249 - (local.set $88 - (block $allocate_adt.247 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 31) - ) - (i32.store offset=24 - (local.get $0) - (local.get $87) - ) - (local.get $0) - ) - ) - (block $do_backpatches.248 - ) - ) - (block $compile_store.252 - (local.set $89 - (block $allocate_adt.250 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 29) - ) - (i32.store offset=24 - (local.get $0) - (local.get $88) - ) - (local.get $0) - ) - ) - (block $do_backpatches.251 - ) - ) - (block $compile_store.255 - (local.set $90 - (block $allocate_adt.253 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 27) - ) - (i32.store offset=24 - (local.get $0) - (local.get $89) - ) - (local.get $0) - ) - ) - (block $do_backpatches.254 - ) - ) - (block $compile_store.258 - (local.set $91 - (block $allocate_adt.256 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 25) - ) - (i32.store offset=24 - (local.get $0) - (local.get $90) - ) - (local.get $0) - ) - ) - (block $do_backpatches.257 - ) - ) - (block $compile_store.261 - (local.set $92 - (block $allocate_adt.259 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 23) - ) - (i32.store offset=24 - (local.get $0) - (local.get $91) - ) - (local.get $0) - ) - ) - (block $do_backpatches.260 - ) - ) - (block $compile_store.264 - (local.set $93 - (block $allocate_adt.262 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 21) - ) - (i32.store offset=24 - (local.get $0) - (local.get $92) - ) - (local.get $0) - ) - ) - (block $do_backpatches.263 - ) - ) - (block $compile_store.267 - (local.set $94 - (block $allocate_adt.265 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 19) - ) - (i32.store offset=24 - (local.get $0) - (local.get $93) - ) - (local.get $0) - ) - ) - (block $do_backpatches.266 - ) - ) - (block $compile_store.270 - (local.set $95 - (block $allocate_adt.268 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 17) - ) - (i32.store offset=24 - (local.get $0) - (local.get $94) - ) - (local.get $0) - ) - ) - (block $do_backpatches.269 - ) - ) - (block $compile_store.273 - (local.set $96 - (block $allocate_adt.271 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 15) - ) - (i32.store offset=24 - (local.get $0) - (local.get $95) - ) - (local.get $0) - ) - ) - (block $do_backpatches.272 - ) - ) - (block $compile_store.276 - (local.set $97 - (block $allocate_adt.274 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 13) - ) - (i32.store offset=24 - (local.get $0) - (local.get $96) - ) - (local.get $0) - ) - ) - (block $do_backpatches.275 - ) - ) - (block $compile_store.279 - (local.set $98 - (block $allocate_adt.277 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=24 - (local.get $0) - (local.get $97) - ) - (local.get $0) - ) - ) - (block $do_backpatches.278 - ) - ) - (block $compile_store.282 - (local.set $99 - (block $allocate_adt.280 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 9) - ) - (i32.store offset=24 - (local.get $0) - (local.get $98) - ) - (local.get $0) - ) - ) - (block $do_backpatches.281 - ) - ) - (block $compile_store.285 - (local.set $100 - (block $allocate_adt.283 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 7) - ) - (i32.store offset=24 - (local.get $0) - (local.get $99) - ) - (local.get $0) - ) - ) - (block $do_backpatches.284 - ) - ) - (block $compile_store.288 - (local.set $101 - (block $allocate_adt.286 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 5) - ) - (i32.store offset=24 - (local.get $0) - (local.get $100) - ) - (local.get $0) - ) - ) - (block $do_backpatches.287 - ) - ) - (block $allocate_adt.289 (result i32) - (i32.store - (local.tee $0 - (call $malloc_0 - (global.get $GRAIN$EXPORT$malloc_0) - (i32.const 28) - ) - ) - (i32.const 2) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 1638603609) - ) - (i32.store offset=8 - (local.get $0) - (i32.const 11) - ) - (i32.store offset=12 - (local.get $0) - (i32.const 1) - ) - (i32.store offset=16 - (local.get $0) - (i32.const 2) - ) - (i32.store offset=20 - (local.get $0) - (i32.const 3) - ) - (i32.store offset=24 - (local.get $0) - (local.get $101) - ) - (local.get $0) - ) - ) - ) - (func $_start - (drop - (call $_gmain) - ) - ) - ;; custom section \"cmi\", size 368 -) +((mash_code + ((functions ()) (imports ()) (exports ()) + (main_body + (((instr_desc + (MStore + (((MLocalBind 0 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ()))))))))) + ((instr_desc + (MStore + (((MLocalBind 1 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 96))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 0 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 2 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 95))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 1 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 3 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 94))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 2 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 4 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 93))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 3 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 5 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 92))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 4 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 6 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 91))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 5 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 7 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 90))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 6 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 8 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 89))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 7 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 9 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 88))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 8 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 10 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 87))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 9 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 11 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 86))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 10 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 12 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 85))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 11 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 13 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 84))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 12 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 14 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 83))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 13 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 15 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 82))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 14 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 16 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 81))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 15 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 17 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 80))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 16 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 18 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 79))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 17 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 19 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 78))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 18 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 20 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 77))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 19 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 21 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 76))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 20 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 22 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 75))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 21 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 23 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 74))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 22 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 24 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 73))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 23 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 25 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 72))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 24 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 26 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 71))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 25 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 27 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 70))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 26 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 28 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 69))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 27 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 29 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 68))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 28 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 30 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 67))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 29 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 31 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 66))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 30 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 32 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 65))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 31 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 33 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 64))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 32 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 34 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 63))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 33 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 35 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 62))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 34 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 36 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 61))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 35 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 37 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 60))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 36 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 38 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 59))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 37 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 39 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 58))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 38 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 40 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 57))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 39 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 41 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 56))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 40 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 42 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 55))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 41 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 43 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 54))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 42 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 44 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 53))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 43 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 45 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 52))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 44 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 46 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 51))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 45 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 47 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 50))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 46 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 48 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 49))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 47 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 49 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 48))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 48 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 50 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 47))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 49 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 51 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 46))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 50 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 52 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 45))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 51 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 53 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 44))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 52 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 54 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 43))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 53 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 55 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 42))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 54 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 56 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 41))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 55 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 57 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 40))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 56 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 58 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 39))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 57 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 59 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 38))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 58 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 60 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 37))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 59 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 61 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 36))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 60 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 62 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 35))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 61 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 63 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 34))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 62 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 64 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 33))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 63 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 65 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 32))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 64 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 66 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 31))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 65 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 67 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 30))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 66 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 68 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 29))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 67 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 69 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 28))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 68 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 70 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 27))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 69 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 71 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 26))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 70 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 72 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 25))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 71 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 73 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 24))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 72 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 74 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 23))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 73 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 75 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 22))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 74 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 76 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 21))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 75 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 77 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 20))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 76 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 78 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 19))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 77 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 79 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 18))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 78 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 80 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 17))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 79 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 81 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 16))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 80 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 82 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 15))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 81 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 83 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 14))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 82 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 84 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 13))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 83 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 85 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 12))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 84 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 86 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 11))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 85 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 87 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 10))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 86 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 88 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 9))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 87 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 89 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 8))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 88 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 90 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 7))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 89 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 91 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 6))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 90 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 92 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 91 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 93 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 4))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 92 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 94 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 3))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 93 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MStore + (((MLocalBind 95 Managed) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 2))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 94 Managed))) + (immediate_analyses ((last_usage Last)))))))))))))) + ((instr_desc + (MAllocate + (MADT + ((immediate_desc (MImmConst (MConstI32 819301804))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 5))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmConst (MConstI32 0))) + (immediate_analyses ((last_usage Unknown)))) + (((immediate_desc (MImmConst (MConstI32 1))) + (immediate_analyses ((last_usage Unknown)))) + ((immediate_desc (MImmBinding (MLocalBind 95 Managed))) + (immediate_analyses ((last_usage Last))))))))))) + (main_body_stack_size + ((stack_size_ptr 96) (stack_size_i32 0) (stack_size_i64 0) + (stack_size_f32 0) (stack_size_f64 0))) + (globals ()) (function_table_elements ()) + (global_function_table_offset ((name function_table_global))) + (compilation_mode Normal) (type_metadata ))) + (signature ))