diff --git a/src/compiler.ts b/src/compiler.ts index c21f72f9..c6357e4e 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -286,7 +286,7 @@ export class Compiler extends DiagnosticEmitter { /** Map of already compiled static string segments. */ stringSegments: Map = new Map(); /** Function table being compiled. */ - functionTable: string[] = []; + functionTable: string[] = [ "null" ]; /** Argument count helper global. */ argcVar: GlobalRef = 0; /** Argument count helper setter. */ @@ -394,10 +394,13 @@ export class Compiler extends DiagnosticEmitter { var functionTable = this.functionTable; var functionTableSize = functionTable.length; var functionTableExported = false; - if (functionTableSize) { - module.setFunctionTable(functionTable); - module.addTableExport("0", "table"); - functionTableExported = true; + module.setFunctionTable(functionTable); + if (functionTableSize) { // index 0 is NULL + module.addFunction("null", this.ensureFunctionType(null, Type.void), null, module.createBlock(null, [])); + if (functionTableSize > 1) { + module.addTableExport("0", "table"); + functionTableExported = true; + } } // import table if requested (default table is named '0' by Binaryen) diff --git a/tests/compiler/abi.optimized.wat b/tests/compiler/abi.optimized.wat index b7e18517..4f5c5429 100644 --- a/tests/compiler/abi.optimized.wat +++ b/tests/compiler/abi.optimized.wat @@ -53,4 +53,7 @@ ) ) ) + (func $null (; 6 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index c384a93a..6140f069 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -6,6 +6,8 @@ (global $abi/condition (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 24)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s\00") (export "memory" (memory $0)) @@ -283,4 +285,6 @@ ) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/asc-constants.optimized.wat b/tests/compiler/asc-constants.optimized.wat index 23da3862..941ac1ce 100644 --- a/tests/compiler/asc-constants.optimized.wat +++ b/tests/compiler/asc-constants.optimized.wat @@ -1,4 +1,8 @@ (module + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) + (func $start (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index e8516c58..77b2e671 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -9,6 +9,8 @@ (global $ASC_FEATURE_MUTABLE_GLOBAL i32 (i32.const 0)) (global $ASC_FEATURE_SIGN_EXTENSION i32 (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -38,4 +40,6 @@ (i32.const 0) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/assert.optimized.wat b/tests/compiler/assert.optimized.wat index 6e116871..26f1d0c0 100644 --- a/tests/compiler/assert.optimized.wat +++ b/tests/compiler/assert.optimized.wat @@ -1,6 +1,10 @@ (module + (type $v (func)) (memory $0 1) (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s") (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") (export "memory" (memory $0)) + (func $start (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index fdf951bc..05aff3d9 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -3,6 +3,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 60)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") @@ -139,4 +141,6 @@ (unreachable) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/binary.optimized.wat b/tests/compiler/binary.optimized.wat index 4fb97653..982d9f4d 100644 --- a/tests/compiler/binary.optimized.wat +++ b/tests/compiler/binary.optimized.wat @@ -1148,4 +1148,7 @@ ) ) ) + (func $null (; 5 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index f5b035f9..39b82b2d 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -11,6 +11,8 @@ (global $binary/f (mut f32) (f32.const 0)) (global $binary/F (mut f64) (f64.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -4920,4 +4922,6 @@ ) ) ) + (func $null (; 7 ;) (type $v) + ) ) diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index 5772b54b..6f22228a 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -11,9 +11,9 @@ (global $builtins/u (mut i32) (i32.const 0)) (global $builtins/U (mut i64) (i64.const 0)) (global $builtins/s (mut i32) (i32.const 0)) - (global $builtins/fn (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $start~anonymous|0) + (global $builtins/fn (mut i32) (i32.const 1)) + (table 2 2 anyfunc) + (elem (i32.const 0) $builtins/test $start~anonymous|1) (memory $0 1) (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") (data (i32.const 40) "\01\00\00\001") @@ -21,7 +21,7 @@ (export "table" (table $0)) (export "test" (func $builtins/test)) (start $start) - (func $start~anonymous|0 (; 1 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) (nop) ) (func $builtins/test (; 2 ;) (; has Stack IR ;) (type $v) diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index 51e2ef7f..63d98c2b 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -14,7 +14,7 @@ (global $builtins/u (mut i32) (i32.const 0)) (global $builtins/U (mut i64) (i64.const 0)) (global $builtins/s (mut i32) (i32.const 0)) - (global $builtins/fn (mut i32) (i32.const 0)) + (global $builtins/fn (mut i32) (i32.const 1)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i16.MIN_VALUE i32 (i32.const -32768)) @@ -44,8 +44,8 @@ (global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) (global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16)) (global $HEAP_BASE i32 (i32.const 48)) - (table 1 1 anyfunc) - (elem (i32.const 0) $start~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1) (memory $0 1) (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") (data (i32.const 40) "\01\00\00\001\00") @@ -53,7 +53,7 @@ (export "table" (table $0)) (export "test" (func $builtins/test)) (start $start) - (func $start~anonymous|0 (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $start~anonymous|1 (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) (nop) ) (func $builtins/test (; 2 ;) (type $v) @@ -3123,4 +3123,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/call-inferred.optimized.wat b/tests/compiler/call-inferred.optimized.wat index 57605da0..60199ca5 100644 --- a/tests/compiler/call-inferred.optimized.wat +++ b/tests/compiler/call-inferred.optimized.wat @@ -80,4 +80,7 @@ ) ) ) + (func $null (; 5 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index 1d6d3eaf..76384dad 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -6,6 +6,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 44)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") (export "memory" (memory $0)) @@ -100,4 +102,6 @@ ) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index de689ded..53d83588 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -4,9 +4,9 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~argc (mut i32) (i32.const 0)) - (global $call-optional/optIndirect (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $call-optional/opt|trampoline) + (global $call-optional/optIndirect (mut i32) (i32.const 1)) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $call-optional/opt|trampoline) (memory $0 1) (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s") (export "memory" (memory $0)) @@ -177,4 +177,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/call-optional.untouched.wat b/tests/compiler/call-optional.untouched.wat index 6674ad76..c951c949 100644 --- a/tests/compiler/call-optional.untouched.wat +++ b/tests/compiler/call-optional.untouched.wat @@ -4,10 +4,10 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~argc (mut i32) (i32.const 0)) - (global $call-optional/optIndirect (mut i32) (i32.const 0)) + (global $call-optional/optIndirect (mut i32) (i32.const 1)) (global $HEAP_BASE i32 (i32.const 44)) - (table 1 1 anyfunc) - (elem (i32.const 0) $call-optional/opt|trampoline) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $call-optional/opt|trampoline) (memory $0 1) (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00") (export "memory" (memory $0)) @@ -206,4 +206,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/class-extends.optimized.wat b/tests/compiler/class-extends.optimized.wat index bc6332e6..eece3880 100644 --- a/tests/compiler/class-extends.optimized.wat +++ b/tests/compiler/class-extends.optimized.wat @@ -1,5 +1,6 @@ (module (type $iv (func (param i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $class-extends/test)) @@ -23,4 +24,7 @@ (i32.const 3) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/class-extends.untouched.wat b/tests/compiler/class-extends.untouched.wat index 41b70fc7..eda0c456 100644 --- a/tests/compiler/class-extends.untouched.wat +++ b/tests/compiler/class-extends.untouched.wat @@ -1,6 +1,9 @@ (module (type $iv (func (param i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $class-extends/test)) @@ -24,4 +27,6 @@ (i32.const 3) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index a07e8bbc..a70c5a33 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -17,4 +17,7 @@ (i32.const 0) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index de4434bd..3588c3c6 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -2,6 +2,8 @@ (type $iv (func (param i32))) (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $class-overloading/test)) @@ -19,4 +21,6 @@ (i32.const 0) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/class-with-boolean-field.optimized.wat b/tests/compiler/class-with-boolean-field.optimized.wat index f35180a3..00065b62 100644 --- a/tests/compiler/class-with-boolean-field.optimized.wat +++ b/tests/compiler/class-with-boolean-field.optimized.wat @@ -1,5 +1,6 @@ (module (type $i (func (result i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $class-with-boolean-field/test)) @@ -12,4 +13,7 @@ (i32.const 0) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/class-with-boolean-field.untouched.wat b/tests/compiler/class-with-boolean-field.untouched.wat index 12dfb9d5..7a3b5d0d 100644 --- a/tests/compiler/class-with-boolean-field.untouched.wat +++ b/tests/compiler/class-with-boolean-field.untouched.wat @@ -1,6 +1,9 @@ (module (type $i (func (result i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $class-with-boolean-field/test)) @@ -14,4 +17,6 @@ (get_local $0) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 808d7356..7331c2db 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -67,4 +67,7 @@ (call $class/Animal.sub) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index ae04d5bf..72dbf3ad 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -9,6 +9,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $class/Animal.ONE (mut i32) (i32.const 1)) (global $HEAP_BASE i32 (i32.const 28)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00") (export "memory" (memory $0)) @@ -152,4 +154,6 @@ ) ) ) + (func $null (; 7 ;) (type $v) + ) ) diff --git a/tests/compiler/closure.optimized.wat b/tests/compiler/closure.optimized.wat index 23da3862..39428b31 100644 --- a/tests/compiler/closure.optimized.wat +++ b/tests/compiler/closure.optimized.wat @@ -1,4 +1,8 @@ (module + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) + (func $null (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/closure.untouched.wat b/tests/compiler/closure.untouched.wat index 3b212aae..e1fc1aa2 100644 --- a/tests/compiler/closure.untouched.wat +++ b/tests/compiler/closure.untouched.wat @@ -1,5 +1,10 @@ (module + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) + (func $null (; 0 ;) (type $v) + ) ) diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 81522dce..26e4fce3 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -216,4 +216,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/comma.untouched.wat b/tests/compiler/comma.untouched.wat index 9b258c0c..cafd7f8c 100644 --- a/tests/compiler/comma.untouched.wat +++ b/tests/compiler/comma.untouched.wat @@ -5,6 +5,8 @@ (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 28)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00") (export "memory" (memory $0)) @@ -273,4 +275,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/declare.optimized.wat b/tests/compiler/declare.optimized.wat index dfa4bc9b..6ac6e3fd 100644 --- a/tests/compiler/declare.optimized.wat +++ b/tests/compiler/declare.optimized.wat @@ -44,4 +44,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/declare.untouched.wat b/tests/compiler/declare.untouched.wat index f649af00..1ca98e41 100644 --- a/tests/compiler/declare.untouched.wat +++ b/tests/compiler/declare.untouched.wat @@ -7,6 +7,8 @@ (import "my" "externalFunction" (func $declare/my.externalFunction)) (import "my" "externalConstant" (global $declare/my.externalConstant i32)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00") (export "memory" (memory $0)) @@ -49,4 +51,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 3430724e..0170d871 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -196,4 +196,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 1829db9d..7e3a8369 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -6,6 +6,8 @@ (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 24)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00") (export "memory" (memory $0)) @@ -240,4 +242,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/empty.optimized.wat b/tests/compiler/empty.optimized.wat index 23da3862..39428b31 100644 --- a/tests/compiler/empty.optimized.wat +++ b/tests/compiler/empty.optimized.wat @@ -1,4 +1,8 @@ (module + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) + (func $null (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index 3b212aae..e1fc1aa2 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -1,5 +1,10 @@ (module + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) + (func $null (; 0 ;) (type $v) + ) ) diff --git a/tests/compiler/enum.optimized.wat b/tests/compiler/enum.optimized.wat index e976f888..e0f438d1 100644 --- a/tests/compiler/enum.optimized.wat +++ b/tests/compiler/enum.optimized.wat @@ -48,4 +48,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/enum.untouched.wat b/tests/compiler/enum.untouched.wat index f24bb03f..b96869cc 100644 --- a/tests/compiler/enum.untouched.wat +++ b/tests/compiler/enum.untouched.wat @@ -19,6 +19,8 @@ (global $enum/SelfReference.ONE i32 (i32.const 1)) (global $enum/enumType (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "Implicit.ZERO" (global $enum/Implicit.ZERO)) @@ -56,4 +58,6 @@ (get_global $enum/NonConstant.ONE) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/export.untouched.wat b/tests/compiler/export.untouched.wat index 9eec390e..4dc03d7c 100644 --- a/tests/compiler/export.untouched.wat +++ b/tests/compiler/export.untouched.wat @@ -5,6 +5,8 @@ (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "add" (func $export/add)) @@ -35,4 +37,6 @@ (func $export/ns.two (; 3 ;) (type $v) (nop) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index c79e1595..e457b373 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -189,7 +189,10 @@ (get_global $~lib/allocator/arena/startOffset) ) ) - (func $exports/subOpt|trampoline (; 10 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $null (; 10 ;) (; has Stack IR ;) (type $v) + (nop) + ) + (func $exports/subOpt|trampoline (; 11 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (block $1of1 (block $0of1 (block $outOfRange @@ -211,12 +214,12 @@ (get_local $1) ) ) - (func $~setargc (; 11 ;) (; has Stack IR ;) (type $iv) (param $0 i32) + (func $~setargc (; 12 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (set_global $~argc (get_local $0) ) ) - (func $exports/Car#constructor|trampoline (; 12 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/Car#constructor|trampoline (; 13 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (block $1of1 (block $0of1 (block $outOfRange diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index 27d8c225..82b0d28d 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -20,6 +20,8 @@ (global $exports/outer.inner.a i32 (i32.const 42)) (global $HEAP_BASE i32 (i32.const 8)) (global $~argc (mut i32) (i32.const 0)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "add" (func $exports/add)) @@ -289,7 +291,9 @@ (get_global $~lib/allocator/arena/startOffset) ) ) - (func $exports/subOpt|trampoline (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $null (; 16 ;) (type $v) + ) + (func $exports/subOpt|trampoline (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (block $1of1 (block $0of1 (block $outOfRange @@ -311,12 +315,12 @@ (get_local $1) ) ) - (func $~setargc (; 17 ;) (type $iv) (param $0 i32) + (func $~setargc (; 18 ;) (type $iv) (param $0 i32) (set_global $~argc (get_local $0) ) ) - (func $exports/Car#constructor|trampoline (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/Car#constructor|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (block $1of1 (block $0of1 (block $outOfRange @@ -335,18 +339,18 @@ (get_local $1) ) ) - (func $Car#get:doors (; 19 ;) (type $ii) (param $0 i32) (result i32) + (func $Car#get:doors (; 20 ;) (type $ii) (param $0 i32) (result i32) (i32.load (get_local $0) ) ) - (func $Car#set:doors (; 20 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $Car#set:doors (; 21 ;) (type $iiv) (param $0 i32) (param $1 i32) (i32.store (get_local $0) (get_local $1) ) ) - (func $exports/vehicles.Car#constructor|trampoline (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/vehicles.Car#constructor|trampoline (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (block $1of1 (block $0of1 (block $outOfRange @@ -365,12 +369,12 @@ (get_local $1) ) ) - (func $vehicles.Car#get:doors (; 22 ;) (type $ii) (param $0 i32) (result i32) + (func $vehicles.Car#get:doors (; 23 ;) (type $ii) (param $0 i32) (result i32) (i32.load (get_local $0) ) ) - (func $vehicles.Car#set:doors (; 23 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $vehicles.Car#set:doors (; 24 ;) (type $iiv) (param $0 i32) (param $1 i32) (i32.store (get_local $0) (get_local $1) diff --git a/tests/compiler/external.optimized.wat b/tests/compiler/external.optimized.wat index 92f96cb4..fb98572f 100644 --- a/tests/compiler/external.optimized.wat +++ b/tests/compiler/external.optimized.wat @@ -12,4 +12,7 @@ (export "two" (func $external/two)) (export "three" (func $external/three)) (export "var_" (global $external/var_)) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/external.untouched.wat b/tests/compiler/external.untouched.wat index 65db8e44..3e88f4e1 100644 --- a/tests/compiler/external.untouched.wat +++ b/tests/compiler/external.untouched.wat @@ -6,6 +6,8 @@ (import "foo" "baz" (func $external/three)) (import "foo" "var" (global $external/var_ i32)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "foo.bar" (func $external/foo.bar)) @@ -13,4 +15,6 @@ (export "two" (func $external/two)) (export "three" (func $external/three)) (export "var_" (global $external/var_)) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 7c911171..ef4fb7dc 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -203,4 +203,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 443ad1be..dd0bb0aa 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -4,6 +4,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $for/i (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 24)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00") (export "memory" (memory $0)) @@ -257,4 +259,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index 24aa4542..c41c772a 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -4,25 +4,25 @@ (type $v (func)) (type $i (func (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (global $function-expression/f1 (mut i32) (i32.const 0)) + (global $function-expression/f1 (mut i32) (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) - (global $function-expression/f2 (mut i32) (i32.const 1)) - (global $function-expression/f3 (mut i32) (i32.const 2)) - (global $function-expression/f4 (mut i32) (i32.const 3)) - (table 4 4 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|0 $start~someName|2 $start~anonymous|3) + (global $function-expression/f2 (mut i32) (i32.const 2)) + (global $function-expression/f3 (mut i32) (i32.const 3)) + (global $function-expression/f4 (mut i32) (i32.const 4)) + (table 5 5 anyfunc) + (elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4) (memory $0 1) (data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $start~anonymous|0 (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) - (func $start~someName|2 (; 2 ;) (; has Stack IR ;) (type $v) + (func $start~someName|3 (; 2 ;) (; has Stack IR ;) (type $v) (nop) ) - (func $start~anonymous|3 (; 3 ;) (; has Stack IR ;) (type $i) (result i32) + (func $start~anonymous|4 (; 3 ;) (; has Stack IR ;) (type $i) (result i32) (i32.const 1) ) (func $start (; 4 ;) (; has Stack IR ;) (type $v) diff --git a/tests/compiler/function-expression.untouched.wat b/tests/compiler/function-expression.untouched.wat index dc8d8ce9..efc8ea7b 100644 --- a/tests/compiler/function-expression.untouched.wat +++ b/tests/compiler/function-expression.untouched.wat @@ -4,29 +4,29 @@ (type $v (func)) (type $i (func (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (global $function-expression/f1 (mut i32) (i32.const 0)) + (global $function-expression/f1 (mut i32) (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) - (global $function-expression/f2 (mut i32) (i32.const 1)) - (global $function-expression/f3 (mut i32) (i32.const 2)) - (global $function-expression/f4 (mut i32) (i32.const 3)) + (global $function-expression/f2 (mut i32) (i32.const 2)) + (global $function-expression/f3 (mut i32) (i32.const 3)) + (global $function-expression/f4 (mut i32) (i32.const 4)) (global $HEAP_BASE i32 (i32.const 56)) - (table 4 4 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~someName|2 $start~anonymous|3) + (table 5 5 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4) (memory $0 1) (data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $start~anonymous|0 (; 1 ;) (type $ii) (param $0 i32) (result i32) + (func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) - (func $start~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32) + (func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) - (func $start~someName|2 (; 3 ;) (type $v) + (func $start~someName|3 (; 3 ;) (type $v) (nop) ) - (func $start~anonymous|3 (; 4 ;) (type $i) (result i32) + (func $start~anonymous|4 (; 4 ;) (type $i) (result i32) (i32.const 1) ) (func $start (; 5 ;) (type $v) @@ -113,4 +113,6 @@ ) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index 877445aa..e04d4d96 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -11,39 +11,39 @@ (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0)) - (table 4 4 anyfunc) - (elem (i32.const 0) $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/makeAdder~anonymous|0) + (table 5 5 anyfunc) + (elem (i32.const 0) $null $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/makeAdder~anonymous|3 $function-types/makeAdder~anonymous|1) (memory $0 1) (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $function-types/makeAdder~anonymous|0 (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $function-types/makeAdder~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 2 ;) (; has Stack IR ;) (type $i) (result i32) - (i32.const 0) + (i32.const 1) ) - (func $function-types/makeAdder~anonymous|1 (; 3 ;) (; has Stack IR ;) (type $III) (param $0 i64) (param $1 i64) (result i64) + (func $function-types/makeAdder~anonymous|2 (; 3 ;) (; has Stack IR ;) (type $III) (param $0 i64) (param $1 i64) (result i64) (i64.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 4 ;) (; has Stack IR ;) (type $i) (result i32) - (i32.const 1) + (i32.const 2) ) - (func $function-types/makeAdder~anonymous|2 (; 5 ;) (; has Stack IR ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $function-types/makeAdder~anonymous|3 (; 5 ;) (; has Stack IR ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (f64.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 6 ;) (; has Stack IR ;) (type $i) (result i32) - (i32.const 2) + (i32.const 3) ) (func $function-types/doAddWithFn (; 7 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $~argc @@ -201,7 +201,7 @@ (call $function-types/doAddWithFn (i32.const 4) (i32.const 5) - (i32.const 3) + (i32.const 4) ) (i32.const 9) ) @@ -253,4 +253,7 @@ ) ) ) + (func $null (; 11 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/function-types.untouched.wat b/tests/compiler/function-types.untouched.wat index 60c412e3..82e8d6bf 100644 --- a/tests/compiler/function-types.untouched.wat +++ b/tests/compiler/function-types.untouched.wat @@ -11,39 +11,39 @@ (global $~argc (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 48)) - (table 4 4 anyfunc) - (elem (i32.const 0) $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/addI32) + (table 5 5 anyfunc) + (elem (i32.const 0) $null $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/makeAdder~anonymous|3 $function-types/addI32) (memory $0 1) (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $function-types/makeAdder~anonymous|0 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $function-types/makeAdder~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 2 ;) (type $i) (result i32) - (i32.const 0) + (i32.const 1) ) - (func $function-types/makeAdder~anonymous|1 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64) + (func $function-types/makeAdder~anonymous|2 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64) (i64.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 4 ;) (type $i) (result i32) - (i32.const 1) + (i32.const 2) ) - (func $function-types/makeAdder~anonymous|2 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $function-types/makeAdder~anonymous|3 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (f64.add (get_local $0) (get_local $1) ) ) (func $function-types/makeAdder (; 6 ;) (type $i) (result i32) - (i32.const 2) + (i32.const 3) ) (func $function-types/doAddWithFn (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $~argc @@ -237,7 +237,7 @@ (call $function-types/doAddWithFn (i32.const 4) (i32.const 5) - (i32.const 3) + (i32.const 4) ) (i32.const 9) ) @@ -300,4 +300,6 @@ ) ) ) + (func $null (; 13 ;) (type $v) + ) ) diff --git a/tests/compiler/function.untouched.wat b/tests/compiler/function.untouched.wat index 92ba38a9..2775f86a 100644 --- a/tests/compiler/function.untouched.wat +++ b/tests/compiler/function.untouched.wat @@ -15,6 +15,8 @@ (type $fff (func (param f32 f32) (result f32))) (type $FFF (func (param f64 f64) (result f64))) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -143,4 +145,6 @@ ) ) ) + (func $null (; 16 ;) (type $v) + ) ) diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index d3c8ff3d..0524f7a0 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -6,8 +6,8 @@ (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $getter-call/C#get:x~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (memory $0 0) (export "memory" (memory $0)) (export "table" (table $0)) @@ -103,11 +103,11 @@ (i32.const 0) ) ) - (func $getter-call/C#get:x~anonymous|0 (; 2 ;) (; has Stack IR ;) (type $i) (result i32) + (func $getter-call/C#get:x~anonymous|1 (; 2 ;) (; has Stack IR ;) (type $i) (result i32) (i32.const 42) ) (func $getter-call/C#get:x (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) - (i32.const 0) + (i32.const 1) ) (func $getter-call/test (; 4 ;) (; has Stack IR ;) (type $i) (result i32) (local $0 i32) @@ -129,4 +129,7 @@ (get_global $~lib/allocator/arena/startOffset) ) ) + (func $null (; 6 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index 40e11317..7e622dff 100644 --- a/tests/compiler/getter-call.untouched.wat +++ b/tests/compiler/getter-call.untouched.wat @@ -10,8 +10,8 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) - (table 1 1 anyfunc) - (elem (i32.const 0) $getter-call/C#get:x~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (memory $0 0) (export "memory" (memory $0)) (export "table" (table $0)) @@ -135,11 +135,11 @@ ) ) ) - (func $getter-call/C#get:x~anonymous|0 (; 2 ;) (type $i) (result i32) + (func $getter-call/C#get:x~anonymous|1 (; 2 ;) (type $i) (result i32) (i32.const 42) ) (func $getter-call/C#get:x (; 3 ;) (type $ii) (param $0 i32) (result i32) - (i32.const 0) + (i32.const 1) ) (func $getter-call/test (; 4 ;) (type $i) (result i32) (local $0 i32) @@ -179,4 +179,6 @@ (get_global $~lib/allocator/arena/startOffset) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/getter-setter.optimized.wat b/tests/compiler/getter-setter.optimized.wat index b8c2a524..1a7cce76 100644 --- a/tests/compiler/getter-setter.optimized.wat +++ b/tests/compiler/getter-setter.optimized.wat @@ -67,4 +67,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/getter-setter.untouched.wat b/tests/compiler/getter-setter.untouched.wat index 5248a25a..2d55d8f6 100644 --- a/tests/compiler/getter-setter.untouched.wat +++ b/tests/compiler/getter-setter.untouched.wat @@ -6,6 +6,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 44)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) @@ -79,4 +81,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/i64-polyfill.optimized.wat b/tests/compiler/i64-polyfill.optimized.wat index 5220e325..9857eb11 100644 --- a/tests/compiler/i64-polyfill.optimized.wat +++ b/tests/compiler/i64-polyfill.optimized.wat @@ -2,6 +2,7 @@ (type $i (func (result i32))) (type $iiv (func (param i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32))) + (type $v (func)) (global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0)) (global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0)) (memory $0 0) @@ -1054,4 +1055,7 @@ (i32.const 0) ) ) + (func $null (; 31 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/i64-polyfill.untouched.wat b/tests/compiler/i64-polyfill.untouched.wat index 7512dc00..67660dd8 100644 --- a/tests/compiler/i64-polyfill.untouched.wat +++ b/tests/compiler/i64-polyfill.untouched.wat @@ -2,11 +2,14 @@ (type $i (func (result i32))) (type $iiv (func (param i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32))) + (type $v (func)) (global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0)) (global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0)) (global $NaN f64 (f64.const nan:0x8000000000000)) (global $Infinity f64 (f64.const inf)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi)) @@ -1128,4 +1131,6 @@ (i32.const 0) ) ) + (func $null (; 31 ;) (type $v) + ) ) diff --git a/tests/compiler/if.optimized.wat b/tests/compiler/if.optimized.wat index 9246af52..0067522b 100644 --- a/tests/compiler/if.optimized.wat +++ b/tests/compiler/if.optimized.wat @@ -137,4 +137,7 @@ ) ) ) + (func $null (; 5 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/if.untouched.wat b/tests/compiler/if.untouched.wat index 261d5051..b074f3e3 100644 --- a/tests/compiler/if.untouched.wat +++ b/tests/compiler/if.untouched.wat @@ -4,6 +4,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 24)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00") (export "memory" (memory $0)) @@ -179,4 +181,6 @@ ) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/import.untouched.wat b/tests/compiler/import.untouched.wat index 719db233..71221c0b 100644 --- a/tests/compiler/import.untouched.wat +++ b/tests/compiler/import.untouched.wat @@ -5,6 +5,8 @@ (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -69,4 +71,6 @@ ) (call $export/ns.two) ) + (func $null (; 5 ;) (type $v) + ) ) diff --git a/tests/compiler/infer-type.untouched.wat b/tests/compiler/infer-type.untouched.wat index 9dd2cfa3..104ec522 100644 --- a/tests/compiler/infer-type.untouched.wat +++ b/tests/compiler/infer-type.untouched.wat @@ -16,6 +16,8 @@ (global $infer-type/inferi (mut i32) (i32.const -2147483648)) (global $infer-type/inferu (mut i32) (i32.const 2147483647)) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00") (export "memory" (memory $0)) @@ -154,4 +156,6 @@ ) ) ) + (func $null (; 7 ;) (type $v) + ) ) diff --git a/tests/compiler/inlining-recursive.optimized.wat b/tests/compiler/inlining-recursive.optimized.wat index e97d649c..2b40b68b 100644 --- a/tests/compiler/inlining-recursive.optimized.wat +++ b/tests/compiler/inlining-recursive.optimized.wat @@ -14,4 +14,7 @@ (func $inlining-recursive/bar (; 2 ;) (; has Stack IR ;) (type $v) (call $inlining-recursive/baz) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/inlining-recursive.untouched.wat b/tests/compiler/inlining-recursive.untouched.wat index 3499062f..27ebf66f 100644 --- a/tests/compiler/inlining-recursive.untouched.wat +++ b/tests/compiler/inlining-recursive.untouched.wat @@ -1,6 +1,8 @@ (module (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "foo" (func $inlining-recursive/foo)) @@ -21,4 +23,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index 3dad4982..5fcea4cd 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -5,8 +5,8 @@ (type $ii (func (param i32) (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~argc (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $inlining/test_funcs~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (memory $0 1) (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s") (export "memory" (memory $0)) @@ -16,7 +16,7 @@ (func $inlining/test (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (i32.const 3) ) - (func $inlining/test_funcs~anonymous|0 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $inlining/test_funcs~anonymous|1 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) (func $inlining/test_funcs (; 3 ;) (; has Stack IR ;) (type $v) @@ -27,7 +27,7 @@ (i32.ne (call_indirect (type $ii) (i32.const 2) - (i32.const 0) + (i32.const 1) ) (i32.const 2) ) @@ -60,4 +60,7 @@ ) (call $inlining/test_funcs) ) + (func $null (; 5 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index 526b757a..1df68205 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -7,8 +7,8 @@ (global $inlining/constantGlobal i32 (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 36)) - (table 1 1 anyfunc) - (elem (i32.const 0) $inlining/test_funcs~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (memory $0 1) (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00") (export "memory" (memory $0)) @@ -21,7 +21,7 @@ (i32.const 2) ) ) - (func $inlining/test_funcs~anonymous|0 (; 2 ;) (type $ii) (param $0 i32) (result i32) + (func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) (func $inlining/test_funcs (; 3 ;) (type $v) @@ -290,7 +290,7 @@ (call_indirect (type $ii) (i32.const 2) (block $inlining/func_fe|inlined.0 (result i32) - (i32.const 0) + (i32.const 1) ) ) ) @@ -384,4 +384,6 @@ ) (call $inlining/test_funcs) ) + (func $null (; 5 ;) (type $v) + ) ) diff --git a/tests/compiler/instanceof.optimized.wat b/tests/compiler/instanceof.optimized.wat index f8283ad3..b562e352 100644 --- a/tests/compiler/instanceof.optimized.wat +++ b/tests/compiler/instanceof.optimized.wat @@ -83,4 +83,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/instanceof.untouched.wat b/tests/compiler/instanceof.untouched.wat index 377ee9b0..f431919a 100644 --- a/tests/compiler/instanceof.untouched.wat +++ b/tests/compiler/instanceof.untouched.wat @@ -10,6 +10,8 @@ (global $instanceof/f (mut f32) (f32.const 0)) (global $instanceof/an (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00") (export "memory" (memory $0)) @@ -396,4 +398,6 @@ ) ) ) + (func $null (; 5 ;) (type $v) + ) ) diff --git a/tests/compiler/limits.optimized.wat b/tests/compiler/limits.optimized.wat index 23da3862..941ac1ce 100644 --- a/tests/compiler/limits.optimized.wat +++ b/tests/compiler/limits.optimized.wat @@ -1,4 +1,8 @@ (module + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) + (func $start (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/limits.untouched.wat b/tests/compiler/limits.untouched.wat index 0b04ce4d..25ea77cc 100644 --- a/tests/compiler/limits.untouched.wat +++ b/tests/compiler/limits.untouched.wat @@ -27,6 +27,8 @@ (global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991)) (global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -110,4 +112,6 @@ (get_global $~lib/builtins/f64.MAX_SAFE_INTEGER) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/literals.optimized.wat b/tests/compiler/literals.optimized.wat index 23da3862..941ac1ce 100644 --- a/tests/compiler/literals.optimized.wat +++ b/tests/compiler/literals.optimized.wat @@ -1,4 +1,8 @@ (module + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) + (func $start (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/literals.untouched.wat b/tests/compiler/literals.untouched.wat index e56f6953..bdb5dc7e 100644 --- a/tests/compiler/literals.untouched.wat +++ b/tests/compiler/literals.untouched.wat @@ -1,6 +1,8 @@ (module (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -138,4 +140,6 @@ (i32.const 0) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 02f35b8b..f6c2a63e 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -156,4 +156,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index 524598ca..6272083e 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -7,6 +7,8 @@ (global $logical/f (mut f32) (f32.const 0)) (global $logical/F (mut f64) (f64.const 0)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") (export "memory" (memory $0)) @@ -291,4 +293,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/main.optimized.wat b/tests/compiler/main.optimized.wat index bbebdeca..80c36433 100644 --- a/tests/compiler/main.optimized.wat +++ b/tests/compiler/main.optimized.wat @@ -25,4 +25,7 @@ (i32.const 1) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/main.untouched.wat b/tests/compiler/main.untouched.wat index 76d161e5..6a58f902 100644 --- a/tests/compiler/main.untouched.wat +++ b/tests/compiler/main.untouched.wat @@ -4,6 +4,8 @@ (global $main/code (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "main" (func $main/main)) @@ -26,4 +28,6 @@ (i32.const 1) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/mandelbrot.optimized.wat b/tests/compiler/mandelbrot.optimized.wat index bbd7cf7a..82542531 100644 --- a/tests/compiler/mandelbrot.optimized.wat +++ b/tests/compiler/mandelbrot.optimized.wat @@ -2,6 +2,7 @@ (type $iiiiv (func (param i32 i32 i32 i32))) (type $FF (func (param f64) (result f64))) (type $Fi (func (param f64) (result i32))) + (type $v (func)) (type $FUNCSIG$dd (func (param f64) (result f64))) (memory $0 0) (export "memory" (memory $0)) @@ -557,4 +558,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/mandelbrot.untouched.wat b/tests/compiler/mandelbrot.untouched.wat index 2aa859fe..dfce2403 100644 --- a/tests/compiler/mandelbrot.untouched.wat +++ b/tests/compiler/mandelbrot.untouched.wat @@ -3,9 +3,12 @@ (type $FF (func (param f64) (result f64))) (type $Fi (func (param f64) (result i32))) (type $FFFF (func (param f64 f64 f64) (result f64))) + (type $v (func)) (global $../../examples/mandelbrot/assembly/index/NUM_COLORS i32 (i32.const 2048)) (global $~lib/math/NativeMath.LN2 f64 (f64.const 0.6931471805599453)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine)) @@ -638,4 +641,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/many-locals.optimized.wat b/tests/compiler/many-locals.optimized.wat index 7a98b088..c7a9bcee 100644 --- a/tests/compiler/many-locals.optimized.wat +++ b/tests/compiler/many-locals.optimized.wat @@ -57,4 +57,7 @@ ) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/many-locals.untouched.wat b/tests/compiler/many-locals.untouched.wat index 4698a4c9..fadfab14 100644 --- a/tests/compiler/many-locals.untouched.wat +++ b/tests/compiler/many-locals.untouched.wat @@ -4,6 +4,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") (export "memory" (memory $0)) @@ -1086,4 +1088,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index a7d61167..bbc8be9c 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -1648,4 +1648,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/memcpy.untouched.wat b/tests/compiler/memcpy.untouched.wat index 7426f46c..6dc6ce68 100644 --- a/tests/compiler/memcpy.untouched.wat +++ b/tests/compiler/memcpy.untouched.wat @@ -6,6 +6,8 @@ (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00") (export "memory" (memory $0)) @@ -2132,4 +2134,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index 75dd360a..eb656242 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -524,4 +524,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/memmove.untouched.wat b/tests/compiler/memmove.untouched.wat index a90da823..686efb33 100644 --- a/tests/compiler/memmove.untouched.wat +++ b/tests/compiler/memmove.untouched.wat @@ -6,6 +6,8 @@ (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\n\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00") (export "memory" (memory $0)) @@ -628,4 +630,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index 32edee10..5f230e43 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -478,4 +478,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/memset.untouched.wat b/tests/compiler/memset.untouched.wat index 3e3b1a27..eb5a99fb 100644 --- a/tests/compiler/memset.untouched.wat +++ b/tests/compiler/memset.untouched.wat @@ -5,6 +5,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00") (export "memory" (memory $0)) @@ -526,4 +528,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/named-export-default.optimized.wat b/tests/compiler/named-export-default.optimized.wat index d0fc1f86..092989b9 100644 --- a/tests/compiler/named-export-default.optimized.wat +++ b/tests/compiler/named-export-default.optimized.wat @@ -1,9 +1,13 @@ (module (type $i (func (result i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "default" (func $named-export-default/get3)) (func $named-export-default/get3 (; 0 ;) (; has Stack IR ;) (type $i) (result i32) (i32.const 3) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/named-export-default.untouched.wat b/tests/compiler/named-export-default.untouched.wat index 25dae6f0..11e00889 100644 --- a/tests/compiler/named-export-default.untouched.wat +++ b/tests/compiler/named-export-default.untouched.wat @@ -1,10 +1,15 @@ (module (type $i (func (result i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "default" (func $named-export-default/get3)) (func $named-export-default/get3 (; 0 ;) (type $i) (result i32) (i32.const 3) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/named-import-default.optimized.wat b/tests/compiler/named-import-default.optimized.wat index 16858ae7..0c9998a5 100644 --- a/tests/compiler/named-import-default.optimized.wat +++ b/tests/compiler/named-import-default.optimized.wat @@ -1,5 +1,6 @@ (module (type $i (func (result i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "getValue" (func $named-import-default/getValue)) @@ -9,4 +10,7 @@ (func $named-import-default/getValue (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (call $named-export-default/get3) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/named-import-default.untouched.wat b/tests/compiler/named-import-default.untouched.wat index 2e9ffcb4..da8b5d31 100644 --- a/tests/compiler/named-import-default.untouched.wat +++ b/tests/compiler/named-import-default.untouched.wat @@ -1,6 +1,9 @@ (module (type $i (func (result i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "getValue" (func $named-import-default/getValue)) @@ -10,4 +13,6 @@ (func $named-import-default/getValue (; 1 ;) (type $i) (result i32) (call $named-export-default/get3) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/namespace.optimized.wat b/tests/compiler/namespace.optimized.wat index e3d45001..1e699cba 100644 --- a/tests/compiler/namespace.optimized.wat +++ b/tests/compiler/namespace.optimized.wat @@ -19,4 +19,7 @@ (call $namespace/Joined.anotherFunc) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/namespace.untouched.wat b/tests/compiler/namespace.untouched.wat index 2fe53477..9766b5e3 100644 --- a/tests/compiler/namespace.untouched.wat +++ b/tests/compiler/namespace.untouched.wat @@ -6,6 +6,8 @@ (global $namespace/Outer.Inner.anEnum.TWO i32 (i32.const 2)) (global $namespace/Joined.THREE i32 (i32.const 3)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -29,4 +31,6 @@ (call $namespace/Joined.anotherFunc) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/new-without-allocator.optimized.wat b/tests/compiler/new-without-allocator.optimized.wat index 9e7bb707..e0c338ca 100644 --- a/tests/compiler/new-without-allocator.optimized.wat +++ b/tests/compiler/new-without-allocator.optimized.wat @@ -1,5 +1,6 @@ (module (type $i (func (result i32))) + (type $v (func)) (type $FUNCSIG$i (func (result i32))) (memory $0 0) (export "memory" (memory $0)) @@ -13,4 +14,7 @@ ) (i32.const 3) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/new-without-allocator.untouched.wat b/tests/compiler/new-without-allocator.untouched.wat index 517133ed..49f85b8b 100644 --- a/tests/compiler/new-without-allocator.untouched.wat +++ b/tests/compiler/new-without-allocator.untouched.wat @@ -1,7 +1,10 @@ (module (type $i (func (result i32))) (type $ii (func (param i32) (result i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "test" (func $new-without-allocator/test)) @@ -23,4 +26,6 @@ ) (i32.const 3) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index aebb679e..9142c7e6 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -327,4 +327,7 @@ (get_local $0) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index fa02cdf5..d9fcb42a 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -14,6 +14,8 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) (global $HEAP_BASE i32 (i32.const 80)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00") (data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") @@ -413,4 +415,6 @@ ) ) ) + (func $null (; 9 ;) (type $v) + ) ) diff --git a/tests/compiler/overflow.optimized.wat b/tests/compiler/overflow.optimized.wat index c8996656..392e5f5d 100644 --- a/tests/compiler/overflow.optimized.wat +++ b/tests/compiler/overflow.optimized.wat @@ -1,5 +1,9 @@ (module + (type $v (func)) (memory $0 1) (data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s") (export "memory" (memory $0)) + (func $start (; 0 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/overflow.untouched.wat b/tests/compiler/overflow.untouched.wat index 82267388..dc59fd78 100644 --- a/tests/compiler/overflow.untouched.wat +++ b/tests/compiler/overflow.untouched.wat @@ -3,6 +3,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 36)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00") (export "memory" (memory $0)) @@ -1090,4 +1092,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/portable-conversions.optimized.wat b/tests/compiler/portable-conversions.optimized.wat index 253c22ae..f714e65e 100644 --- a/tests/compiler/portable-conversions.optimized.wat +++ b/tests/compiler/portable-conversions.optimized.wat @@ -117,4 +117,7 @@ ) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/portable-conversions.untouched.wat b/tests/compiler/portable-conversions.untouched.wat index 28172787..50b90cdb 100644 --- a/tests/compiler/portable-conversions.untouched.wat +++ b/tests/compiler/portable-conversions.untouched.wat @@ -5,6 +5,8 @@ (global $portable-conversions/f (mut f32) (f32.const 0)) (global $portable-conversions/F (mut f64) (f64.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -244,4 +246,6 @@ (get_global $portable-conversions/F) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/recursive.optimized.wat b/tests/compiler/recursive.optimized.wat index f0c9e5fb..08191d3b 100644 --- a/tests/compiler/recursive.optimized.wat +++ b/tests/compiler/recursive.optimized.wat @@ -1,5 +1,6 @@ (module (type $ii (func (param i32) (result i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "fib" (func $recursive/fib)) @@ -28,4 +29,7 @@ ) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/recursive.untouched.wat b/tests/compiler/recursive.untouched.wat index 92a85392..59a00e5c 100644 --- a/tests/compiler/recursive.untouched.wat +++ b/tests/compiler/recursive.untouched.wat @@ -1,6 +1,9 @@ (module (type $ii (func (param i32) (result i32))) + (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "fib" (func $recursive/fib)) @@ -29,4 +32,6 @@ ) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index 099943f9..aafc7919 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -5,6 +5,8 @@ (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "add" (func $export/add)) @@ -54,4 +56,6 @@ ) ) ) + (func $null (; 5 ;) (type $v) + ) ) diff --git a/tests/compiler/rereexport.optimized.wat b/tests/compiler/rereexport.optimized.wat index 2a571d42..11f93de6 100644 --- a/tests/compiler/rereexport.optimized.wat +++ b/tests/compiler/rereexport.optimized.wat @@ -24,4 +24,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index bf236b93..d1afd010 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -5,6 +5,8 @@ (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "a" (global $export/a)) @@ -38,4 +40,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/retain-i32.optimized.wat b/tests/compiler/retain-i32.optimized.wat index 3d5a3803..6cbda101 100644 --- a/tests/compiler/retain-i32.optimized.wat +++ b/tests/compiler/retain-i32.optimized.wat @@ -388,4 +388,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/retain-i32.untouched.wat b/tests/compiler/retain-i32.untouched.wat index fd09652f..24385668 100644 --- a/tests/compiler/retain-i32.untouched.wat +++ b/tests/compiler/retain-i32.untouched.wat @@ -15,6 +15,8 @@ (global $retain-i32/si (mut i32) (i32.const 0)) (global $retain-i32/ui (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0d\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00") (export "memory" (memory $0)) @@ -1116,4 +1118,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index 64610f08..ca8a2e68 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -48,4 +48,7 @@ ) (call $scoped/fn) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/scoped.untouched.wat b/tests/compiler/scoped.untouched.wat index eaf5ed93..2275066b 100644 --- a/tests/compiler/scoped.untouched.wat +++ b/tests/compiler/scoped.untouched.wat @@ -5,6 +5,8 @@ (global $scoped/aConstant i32 (i32.const 3)) (global $scoped/aStartFunctionLocal (mut i32) (i32.const 2)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -82,4 +84,6 @@ (i32.const 42) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/static-this.optimized.wat b/tests/compiler/static-this.optimized.wat index 8073aff6..11e29c43 100644 --- a/tests/compiler/static-this.optimized.wat +++ b/tests/compiler/static-this.optimized.wat @@ -28,4 +28,7 @@ ) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index 8263dfad..a94a906e 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -5,6 +5,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0e\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") (export "memory" (memory $0)) @@ -31,4 +33,6 @@ ) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/std/allocator_arena.optimized.wat b/tests/compiler/std/allocator_arena.optimized.wat index afc7cd96..c1e9bf3f 100644 --- a/tests/compiler/std/allocator_arena.optimized.wat +++ b/tests/compiler/std/allocator_arena.optimized.wat @@ -2279,4 +2279,7 @@ ) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/allocator_arena.untouched.wat b/tests/compiler/std/allocator_arena.untouched.wat index 45f15d6f..5d6a3718 100644 --- a/tests/compiler/std/allocator_arena.untouched.wat +++ b/tests/compiler/std/allocator_arena.untouched.wat @@ -17,6 +17,8 @@ (global $std/allocator_arena/ptr2 (mut i32) (i32.const 0)) (global $std/allocator_arena/i (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 56)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\16\00\00\00s\00t\00d\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00_\00a\00r\00e\00n\00a\00.\00t\00s\00") (export "memory" (memory $0)) @@ -2961,4 +2963,6 @@ ) ) ) + (func $null (; 9 ;) (type $v) + ) ) diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index c11c6958..0bd96712 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -2,6 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $iii (func (param i32 i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) + (type $v (func)) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) @@ -202,4 +203,7 @@ ) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 82dd181c..6ddf2457 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -4,6 +4,7 @@ (type $iiii (func (param i32 i32 i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -11,6 +12,8 @@ (global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8)) (global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) (global $HEAP_BASE i32 (i32.const 60)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\00\00\00\00") (data (i32.const 16) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") @@ -361,4 +364,6 @@ (i32.const 0) ) ) + (func $null (; 12 ;) (type $v) + ) ) diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 59c6cdc8..d72c093e 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -991,4 +991,7 @@ ) ) ) + (func $null (; 13 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 6cfdf25b..fee97183 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -20,6 +20,8 @@ (global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 228)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\03\00\00\00\00\00\00\00\00\01\02\00\00\00\00\00") (data (i32.const 24) "\08\00\00\00\03\00\00\00") @@ -1322,4 +1324,6 @@ ) ) ) + (func $null (; 13 ;) (type $v) + ) ) diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index c167785b..1f2e9374 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -64,8 +64,8 @@ (global $std/array/randomStringsActual (mut i32) (i32.const 1216)) (global $std/array/randomStringsExpected (mut i32) (i32.const 1288)) (global $std/array/randomStrings400 (mut i32) (i32.const 0)) - (table 55 55 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|2 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|16 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $~lib/array/Array#sort|trampoline~anonymous|42 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|44 $start~anonymous|48 $~lib/array/Array#sort|trampoline~anonymous|44 $start~anonymous|48 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|53) + (table 56 56 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|3 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|17 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|29 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|29 $start~anonymous|35 $start~anonymous|29 $start~anonymous|29 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|29 $start~anonymous|35 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|46 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|45 $start~anonymous|49 $~lib/array/Array#sort|trampoline~anonymous|45 $start~anonymous|49 $start~anonymous|52 $start~anonymous|53 $start~anonymous|54 $start~anonymous|54) (memory $0 1) (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") @@ -3133,7 +3133,7 @@ (get_local $2) ) ) - (func $start~anonymous|0 (; 22 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|1 (; 22 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eqz (get_local $0) ) @@ -3214,19 +3214,19 @@ ) (i32.const -1) ) - (func $start~anonymous|1 (; 24 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|2 (; 24 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 1) ) ) - (func $start~anonymous|2 (; 25 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|3 (; 25 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|3 (; 26 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|4 (; 26 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3238,7 +3238,7 @@ (i32.const 100) ) ) - (func $start~anonymous|5 (; 27 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|6 (; 27 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3249,7 +3249,7 @@ (i32.const 100) ) ) - (func $start~anonymous|6 (; 28 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|7 (; 28 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 0) @@ -3331,13 +3331,13 @@ ) (i32.const 1) ) - (func $start~anonymous|7 (; 30 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|8 (; 30 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const 0) ) ) - (func $start~anonymous|8 (; 31 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|9 (; 31 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3349,13 +3349,13 @@ (i32.const 10) ) ) - (func $start~anonymous|9 (; 32 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|10 (; 32 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.lt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|10 (; 33 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|11 (; 33 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3366,7 +3366,7 @@ (i32.const 3) ) ) - (func $start~anonymous|11 (; 34 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|12 (; 34 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 3) @@ -3448,13 +3448,13 @@ ) (i32.const 0) ) - (func $start~anonymous|12 (; 36 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|13 (; 36 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const -1) ) ) - (func $start~anonymous|13 (; 37 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|14 (; 37 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3466,13 +3466,13 @@ (i32.const 10) ) ) - (func $start~anonymous|14 (; 38 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|15 (; 38 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.gt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|15 (; 39 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|16 (; 39 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3483,7 +3483,7 @@ (i32.const 3) ) ) - (func $start~anonymous|16 (; 40 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|17 (; 40 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3556,7 +3556,7 @@ ) ) ) - (func $start~anonymous|17 (; 42 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|18 (; 42 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3570,7 +3570,7 @@ ) ) ) - (func $start~anonymous|19 (; 43 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|20 (; 43 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3583,7 +3583,7 @@ ) ) ) - (func $start~anonymous|20 (; 44 ;) (; has Stack IR ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start~anonymous|21 (; 44 ;) (; has Stack IR ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (f32.convert_s/i32 (get_local $0) ) @@ -3658,7 +3658,7 @@ ) (get_local $1) (get_local $0) - (i32.const 20) + (i32.const 21) ) ) (set_local $1 @@ -3699,7 +3699,7 @@ (unreachable) ) ) - (func $start~anonymous|21 (; 47 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|22 (; 47 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3799,7 +3799,7 @@ ) (get_local $6) ) - (func $start~anonymous|22 (; 49 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|23 (; 49 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3808,7 +3808,7 @@ ) (get_local $0) ) - (func $start~anonymous|23 (; 50 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|24 (; 50 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3822,7 +3822,7 @@ ) (get_local $0) ) - (func $start~anonymous|24 (; 51 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|25 (; 51 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 2) @@ -3914,7 +3914,7 @@ ) (get_local $4) ) - (func $start~anonymous|25 (; 53 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|26 (; 53 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3932,7 +3932,7 @@ (i32.const 2) ) ) - (func $start~anonymous|26 (; 54 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|27 (; 54 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3944,7 +3944,7 @@ (i32.const 2) ) ) - (func $start~anonymous|27 (; 55 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|28 (; 55 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3961,7 +3961,7 @@ (i32.const 2) ) ) - (func $start~anonymous|28 (; 56 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|29 (; 56 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) @@ -4036,7 +4036,7 @@ ) (get_local $2) ) - (func $start~anonymous|30 (; 58 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|31 (; 58 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -4049,7 +4049,7 @@ ) ) ) - (func $start~anonymous|31 (; 59 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|32 (; 59 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -4062,7 +4062,7 @@ ) ) ) - (func $start~anonymous|32 (; 60 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|33 (; 60 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -4074,7 +4074,7 @@ (get_local $1) ) ) - (func $start~anonymous|34 (; 61 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|35 (; 61 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -4804,7 +4804,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#sort|trampoline~anonymous|42 (; 69 ;) (; has Stack IR ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 69 ;) (; has Stack IR ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) (i32.sub @@ -4860,7 +4860,7 @@ (unreachable) ) (set_local $1 - (i32.const 42) + (i32.const 43) ) ) (call $~lib/array/Array#sort @@ -5562,7 +5562,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 76 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 76 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) (i32.sub @@ -5618,7 +5618,7 @@ (unreachable) ) (set_local $1 - (i32.const 43) + (i32.const 44) ) ) (call $~lib/array/Array#sort @@ -6349,7 +6349,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 84 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 84 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) @@ -6367,7 +6367,7 @@ (unreachable) ) (set_local $1 - (i32.const 44) + (i32.const 45) ) ) (call $~lib/array/Array#sort @@ -6438,7 +6438,7 @@ ) (i32.const 1) ) - (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 87 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|46 (; 87 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.gt_u (get_local $0) @@ -6462,7 +6462,7 @@ (unreachable) ) (set_local $1 - (i32.const 45) + (i32.const 46) ) ) (call $~lib/array/Array#sort @@ -6707,10 +6707,10 @@ (func $std/array/assertSortedDefault (; 94 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (call $std/array/assertSorted (get_local $0) - (i32.const 46) + (i32.const 47) ) ) - (func $start~anonymous|48 (; 95 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|49 (; 95 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) @@ -6768,7 +6768,7 @@ ) (get_local $1) ) - (func $start~anonymous|51 (; 97 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|52 (; 97 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/array/Array#__get (get_local $0) @@ -6951,7 +6951,7 @@ ) (get_local $1) ) - (func $start~anonymous|52 (; 102 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|53 (; 102 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.load (get_local $0) @@ -7162,7 +7162,7 @@ (i32.const 0) ) ) - (func $start~anonymous|53 (; 106 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|54 (; 106 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -9041,7 +9041,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 0) + (i32.const 1) ) ) (if @@ -9059,7 +9059,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 1) + (i32.const 2) ) ) (if @@ -9080,7 +9080,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 2) + (i32.const 3) ) ) (if @@ -9101,7 +9101,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 3) + (i32.const 4) ) ) (if @@ -9139,7 +9139,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 4) + (i32.const 5) ) ) (if @@ -9180,7 +9180,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 5) + (i32.const 6) ) ) (if @@ -9230,7 +9230,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 6) + (i32.const 7) ) ) (if @@ -9251,7 +9251,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 7) + (i32.const 8) ) ) (if @@ -9269,7 +9269,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 8) + (i32.const 9) ) ) (if @@ -9307,7 +9307,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 9) + (i32.const 10) ) ) (if @@ -9345,7 +9345,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 10) + (i32.const 11) ) ) (if @@ -9395,7 +9395,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 11) + (i32.const 12) ) ) (if @@ -9416,7 +9416,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 12) + (i32.const 13) ) ) (if @@ -9434,7 +9434,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 13) + (i32.const 14) ) ) (if @@ -9469,7 +9469,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 14) + (i32.const 15) ) ) (if @@ -9510,7 +9510,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 15) + (i32.const 16) ) ) (if @@ -9559,7 +9559,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 16) + (i32.const 17) ) (if (i32.ne @@ -9581,7 +9581,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 17) + (i32.const 18) ) (if (i32.ne @@ -9620,7 +9620,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 18) + (i32.const 19) ) (if (i32.ne @@ -9662,7 +9662,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 19) + (i32.const 20) ) (if (i32.ne @@ -9759,7 +9759,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 21) + (i32.const 22) ) ) (if @@ -9800,7 +9800,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 22) + (i32.const 23) ) ) (if @@ -9844,7 +9844,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 23) + (i32.const 24) ) ) (if @@ -9894,7 +9894,7 @@ (set_global $std/array/filteredArr (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 24) + (i32.const 25) ) ) (if @@ -9920,7 +9920,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 25) + (i32.const 26) ) ) (if @@ -9961,7 +9961,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 26) + (i32.const 27) ) ) (if @@ -10005,7 +10005,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 27) + (i32.const 28) ) ) (if @@ -10055,7 +10055,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 28) + (i32.const 29) (i32.const 0) ) ) @@ -10077,7 +10077,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 29) + (i32.const 30) (i32.const 4) ) ) @@ -10100,7 +10100,7 @@ (i32.and (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 30) + (i32.const 31) (i32.const 0) ) (i32.const 1) @@ -10125,7 +10125,7 @@ (i32.and (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 31) + (i32.const 32) (i32.const 0) ) (i32.const 1) @@ -10146,7 +10146,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 32) + (i32.const 33) (i32.const 0) ) ) @@ -10185,7 +10185,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 33) + (i32.const 34) (i32.const 0) ) ) @@ -10227,7 +10227,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 34) + (i32.const 35) (i32.const 0) ) ) @@ -10278,7 +10278,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 35) + (i32.const 36) (i32.const 0) ) ) @@ -10300,7 +10300,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 36) + (i32.const 37) (i32.const 4) ) ) @@ -10323,7 +10323,7 @@ (i32.and (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 37) + (i32.const 38) (i32.const 0) ) (i32.const 1) @@ -10348,7 +10348,7 @@ (i32.and (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 38) + (i32.const 39) (i32.const 0) ) (i32.const 1) @@ -10369,7 +10369,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 39) + (i32.const 40) (i32.const 0) ) ) @@ -10408,7 +10408,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 40) + (i32.const 41) (i32.const 0) ) ) @@ -10450,7 +10450,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 41) + (i32.const 42) (i32.const 0) ) ) @@ -10800,39 +10800,39 @@ (i32.const 257) ) ) - (call $std/array/assertSorted - (get_global $std/array/randomized64) - (i32.const 47) - ) (call $std/array/assertSorted (get_global $std/array/randomized64) (i32.const 48) ) (call $std/array/assertSorted - (get_global $std/array/randomized257) + (get_global $std/array/randomized64) (i32.const 49) ) (call $std/array/assertSorted (get_global $std/array/randomized257) (i32.const 50) ) + (call $std/array/assertSorted + (get_global $std/array/randomized257) + (i32.const 51) + ) (set_global $std/array/reversedNested512 (call $std/array/createReverseOrderedNestedArray) ) (call $std/array/assertSorted> (get_global $std/array/reversedNested512) - (i32.const 51) + (i32.const 52) ) (set_global $std/array/reversedElements512 (call $std/array/createReverseOrderedElementsArray) ) (call $std/array/assertSorted> (get_global $std/array/reversedElements512) - (i32.const 52) + (i32.const 53) ) (call $std/array/assertSorted> (get_global $std/array/randomStringsActual) - (i32.const 53) + (i32.const 54) ) (if (i32.eqz @@ -10856,7 +10856,10 @@ ) (call $std/array/assertSorted> (get_global $std/array/randomStrings400) - (i32.const 54) + (i32.const 55) ) ) + (func $null (; 118 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 98121ae8..8cda71f3 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -69,8 +69,8 @@ (global $std/array/randomStringsExpected (mut i32) (i32.const 1288)) (global $std/array/randomStrings400 (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 1396)) - (table 55 55 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|35 $start~anonymous|36 $start~anonymous|37 $start~anonymous|38 $start~anonymous|39 $start~anonymous|40 $start~anonymous|41 $~lib/array/Array#sort|trampoline~anonymous|42 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $std/array/assertSortedDefault~anonymous|46 $start~anonymous|47 $start~anonymous|48 $start~anonymous|49 $start~anonymous|50 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|54) + (table 56 56 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|35 $start~anonymous|36 $start~anonymous|37 $start~anonymous|38 $start~anonymous|39 $start~anonymous|40 $start~anonymous|41 $start~anonymous|42 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|46 $std/array/assertSortedDefault~anonymous|47 $start~anonymous|48 $start~anonymous|49 $start~anonymous|50 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|54 $start~anonymous|55) (memory $0 1) (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") @@ -3923,7 +3923,7 @@ ) ) ) - (func $start~anonymous|0 (; 22 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|1 (; 22 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 0) @@ -4010,19 +4010,19 @@ ) (i32.const -1) ) - (func $start~anonymous|1 (; 24 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|2 (; 24 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 1) ) ) - (func $start~anonymous|2 (; 25 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|3 (; 25 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|3 (; 26 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|4 (; 26 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4034,13 +4034,13 @@ (i32.const 100) ) ) - (func $start~anonymous|4 (; 27 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|5 (; 27 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|5 (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|6 (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4051,7 +4051,7 @@ (i32.const 100) ) ) - (func $start~anonymous|6 (; 29 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|7 (; 29 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 0) @@ -4140,13 +4140,13 @@ ) (i32.const 1) ) - (func $start~anonymous|7 (; 31 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|8 (; 31 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const 0) ) ) - (func $start~anonymous|8 (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|9 (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4158,13 +4158,13 @@ (i32.const 10) ) ) - (func $start~anonymous|9 (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|10 (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.lt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|10 (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|11 (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4175,7 +4175,7 @@ (i32.const 3) ) ) - (func $start~anonymous|11 (; 35 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|12 (; 35 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 3) @@ -4262,13 +4262,13 @@ ) (i32.const 0) ) - (func $start~anonymous|12 (; 37 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|13 (; 37 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const -1) ) ) - (func $start~anonymous|13 (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|14 (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4280,13 +4280,13 @@ (i32.const 10) ) ) - (func $start~anonymous|14 (; 39 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|15 (; 39 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.gt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|15 (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|16 (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4297,7 +4297,7 @@ (i32.const 3) ) ) - (func $start~anonymous|16 (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|17 (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4377,7 +4377,7 @@ ) ) ) - (func $start~anonymous|17 (; 43 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|18 (; 43 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4391,7 +4391,7 @@ ) ) ) - (func $start~anonymous|18 (; 44 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|19 (; 44 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4399,7 +4399,7 @@ ) ) ) - (func $start~anonymous|19 (; 45 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|20 (; 45 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4412,7 +4412,7 @@ ) ) ) - (func $start~anonymous|20 (; 46 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start~anonymous|21 (; 46 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (f32.convert_s/i32 (get_local $0) ) @@ -4627,7 +4627,7 @@ (unreachable) ) ) - (func $start~anonymous|21 (; 50 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|22 (; 50 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4740,7 +4740,7 @@ ) (get_local $4) ) - (func $start~anonymous|22 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|23 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4749,7 +4749,7 @@ ) (get_local $0) ) - (func $start~anonymous|23 (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|24 (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4763,7 +4763,7 @@ ) (get_local $0) ) - (func $start~anonymous|24 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|25 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 2) @@ -4863,7 +4863,7 @@ ) (get_local $4) ) - (func $start~anonymous|25 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|26 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4881,7 +4881,7 @@ (i32.const 2) ) ) - (func $start~anonymous|26 (; 57 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|27 (; 57 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4893,7 +4893,7 @@ (i32.const 2) ) ) - (func $start~anonymous|27 (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|28 (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4910,7 +4910,7 @@ (i32.const 2) ) ) - (func $start~anonymous|28 (; 59 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|29 (; 59 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) @@ -4996,13 +4996,13 @@ ) (get_local $3) ) - (func $start~anonymous|29 (; 61 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|30 (; 61 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|30 (; 62 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|31 (; 62 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5095,7 +5095,7 @@ ) (get_local $3) ) - (func $start~anonymous|31 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|32 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5108,7 +5108,7 @@ ) ) ) - (func $start~anonymous|32 (; 65 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|33 (; 65 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -5120,13 +5120,13 @@ (get_local $1) ) ) - (func $start~anonymous|33 (; 66 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|34 (; 66 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|34 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|35 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -5137,7 +5137,7 @@ (get_local $1) ) ) - (func $start~anonymous|35 (; 68 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|36 (; 68 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) @@ -5208,13 +5208,13 @@ ) (get_local $3) ) - (func $start~anonymous|36 (; 70 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|37 (; 70 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|37 (; 71 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|38 (; 71 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5292,7 +5292,7 @@ ) (get_local $3) ) - (func $start~anonymous|38 (; 73 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|39 (; 73 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5305,7 +5305,7 @@ ) ) ) - (func $start~anonymous|39 (; 74 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|40 (; 74 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -5317,13 +5317,13 @@ (get_local $1) ) ) - (func $start~anonymous|40 (; 75 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|41 (; 75 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|41 (; 76 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|42 (; 76 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -6310,7 +6310,7 @@ (get_local $0) ) ) - (func $~lib/array/Array#sort|trampoline~anonymous|42 (; 83 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 83 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) (set_local $2 @@ -6371,7 +6371,7 @@ (set_local $1 (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) (br $~lib/internal/array/defaultComparator|inlined.0 - (i32.const 42) + (i32.const 43) ) ) ) @@ -7394,7 +7394,7 @@ (get_local $0) ) ) - (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 90 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 90 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) (set_local $2 @@ -7455,7 +7455,7 @@ (set_local $1 (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) (br $~lib/internal/array/defaultComparator|inlined.0 - (i32.const 43) + (i32.const 44) ) ) ) @@ -8509,7 +8509,7 @@ (get_local $0) ) ) - (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 98 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 98 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) @@ -8528,7 +8528,7 @@ (set_local $1 (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) (br $~lib/internal/array/defaultComparator|inlined.0 - (i32.const 44) + (i32.const 45) ) ) ) @@ -9512,7 +9512,7 @@ (get_local $0) ) ) - (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 104 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|46 (; 104 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.gt_u (get_local $0) @@ -9537,7 +9537,7 @@ (set_local $1 (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) (br $~lib/internal/array/defaultComparator|inlined.0 - (i32.const 45) + (i32.const 46) ) ) ) @@ -9837,7 +9837,7 @@ ) (get_local $1) ) - (func $std/array/assertSortedDefault~anonymous|46 (; 111 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/assertSortedDefault~anonymous|47 (; 111 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) @@ -9933,30 +9933,30 @@ (get_local $0) (block $~lib/internal/array/defaultComparator|inlined.1 (result i32) (br $~lib/internal/array/defaultComparator|inlined.1 - (i32.const 46) + (i32.const 47) ) ) ) ) - (func $start~anonymous|47 (; 115 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|48 (; 115 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) ) ) - (func $start~anonymous|48 (; 116 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|49 (; 116 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) ) ) - (func $start~anonymous|49 (; 117 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|50 (; 117 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) ) ) - (func $start~anonymous|50 (; 118 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|51 (; 118 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) @@ -10213,7 +10213,7 @@ ) (get_local $1) ) - (func $start~anonymous|51 (; 123 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|52 (; 123 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/array/Array#__get (get_local $0) @@ -10835,7 +10835,7 @@ ) (get_local $1) ) - (func $start~anonymous|52 (; 132 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|53 (; 132 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.load (get_local $0) @@ -11493,7 +11493,7 @@ (i32.const 0) ) ) - (func $start~anonymous|53 (; 141 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|54 (; 141 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -12544,7 +12544,7 @@ ) (get_local $1) ) - (func $start~anonymous|54 (; 159 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|55 (; 159 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -14282,7 +14282,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 0) + (i32.const 1) ) ) (if @@ -14305,7 +14305,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 1) + (i32.const 2) ) ) (if @@ -14328,7 +14328,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 2) + (i32.const 3) ) ) (if @@ -14351,7 +14351,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 3) + (i32.const 4) ) ) (if @@ -14398,7 +14398,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 4) + (i32.const 5) ) ) (if @@ -14441,7 +14441,7 @@ (set_global $std/array/i (call $~lib/array/Array#findIndex (get_global $std/array/arr) - (i32.const 5) + (i32.const 6) ) ) (if @@ -14500,7 +14500,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 6) + (i32.const 7) ) ) (if @@ -14523,7 +14523,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 7) + (i32.const 8) ) ) (if @@ -14546,7 +14546,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 8) + (i32.const 9) ) ) (if @@ -14593,7 +14593,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 9) + (i32.const 10) ) ) (if @@ -14636,7 +14636,7 @@ (set_global $std/array/every (call $~lib/array/Array#every (get_global $std/array/arr) - (i32.const 10) + (i32.const 11) ) ) (if @@ -14695,7 +14695,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 11) + (i32.const 12) ) ) (if @@ -14718,7 +14718,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 12) + (i32.const 13) ) ) (if @@ -14741,7 +14741,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 13) + (i32.const 14) ) ) (if @@ -14788,7 +14788,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 14) + (i32.const 15) ) ) (if @@ -14831,7 +14831,7 @@ (set_global $std/array/some (call $~lib/array/Array#some (get_global $std/array/arr) - (i32.const 15) + (i32.const 16) ) ) (if @@ -14892,7 +14892,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 16) + (i32.const 17) ) (if (i32.eqz @@ -14916,7 +14916,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 17) + (i32.const 18) ) (if (i32.eqz @@ -14964,7 +14964,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 18) + (i32.const 19) ) (if (i32.eqz @@ -15008,7 +15008,7 @@ ) (call $~lib/array/Array#forEach (get_global $std/array/arr) - (i32.const 19) + (i32.const 20) ) (if (i32.eqz @@ -15066,7 +15066,7 @@ (set_global $std/array/newArr (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 20) + (i32.const 21) ) ) (if @@ -15124,7 +15124,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 21) + (i32.const 22) ) ) (if @@ -15174,7 +15174,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 22) + (i32.const 23) ) ) (if @@ -15220,7 +15220,7 @@ (drop (call $~lib/array/Array#map (get_global $std/array/arr) - (i32.const 23) + (i32.const 24) ) ) (if @@ -15279,7 +15279,7 @@ (set_global $std/array/filteredArr (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 24) + (i32.const 25) ) ) (if @@ -15312,7 +15312,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 25) + (i32.const 26) ) ) (if @@ -15362,7 +15362,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 26) + (i32.const 27) ) ) (if @@ -15408,7 +15408,7 @@ (drop (call $~lib/array/Array#filter (get_global $std/array/arr) - (i32.const 27) + (i32.const 28) ) ) (if @@ -15467,7 +15467,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 28) + (i32.const 29) (i32.const 0) ) ) @@ -15491,7 +15491,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 29) + (i32.const 30) (i32.const 4) ) ) @@ -15516,7 +15516,7 @@ (i32.and (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 30) + (i32.const 31) (i32.const 0) ) (i32.const 1) @@ -15543,7 +15543,7 @@ (i32.and (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 31) + (i32.const 32) (i32.const 0) ) (i32.const 1) @@ -15569,7 +15569,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 32) + (i32.const 33) (i32.const 0) ) ) @@ -15617,7 +15617,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 33) + (i32.const 34) (i32.const 0) ) ) @@ -15661,7 +15661,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduce (get_global $std/array/arr) - (i32.const 34) + (i32.const 35) (i32.const 0) ) ) @@ -15721,7 +15721,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 35) + (i32.const 36) (i32.const 0) ) ) @@ -15745,7 +15745,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 36) + (i32.const 37) (i32.const 4) ) ) @@ -15770,7 +15770,7 @@ (i32.and (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 37) + (i32.const 38) (i32.const 0) ) (i32.const 1) @@ -15797,7 +15797,7 @@ (i32.and (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 38) + (i32.const 39) (i32.const 0) ) (i32.const 1) @@ -15823,7 +15823,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 39) + (i32.const 40) (i32.const 0) ) ) @@ -15871,7 +15871,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 40) + (i32.const 41) (i32.const 0) ) ) @@ -15915,7 +15915,7 @@ (set_global $std/array/i (call $~lib/array/Array#reduceRight (get_global $std/array/arr) - (i32.const 41) + (i32.const 42) (i32.const 0) ) ) @@ -16293,22 +16293,22 @@ (i32.const 257) ) ) - (call $std/array/assertSorted - (get_global $std/array/randomized64) - (i32.const 47) - ) (call $std/array/assertSorted (get_global $std/array/randomized64) (i32.const 48) ) (call $std/array/assertSorted - (get_global $std/array/randomized257) + (get_global $std/array/randomized64) (i32.const 49) ) (call $std/array/assertSorted (get_global $std/array/randomized257) (i32.const 50) ) + (call $std/array/assertSorted + (get_global $std/array/randomized257) + (i32.const 51) + ) (set_global $std/array/reversedNested512 (call $std/array/createReverseOrderedNestedArray (i32.const 512) @@ -16316,7 +16316,7 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedNested512) - (i32.const 51) + (i32.const 52) ) (set_global $std/array/reversedElements512 (call $std/array/createReverseOrderedElementsArray @@ -16325,11 +16325,11 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedElements512) - (i32.const 52) + (i32.const 53) ) (call $std/array/assertSorted (get_global $std/array/randomStringsActual) - (i32.const 53) + (i32.const 54) ) (if (i32.eqz @@ -16356,7 +16356,9 @@ ) (call $std/array/assertSorted (get_global $std/array/randomStrings400) - (i32.const 54) + (i32.const 55) ) ) + (func $null (; 161 ;) (type $v) + ) ) diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index cf19515c..0ae32c04 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -2530,4 +2530,7 @@ ) ) ) + (func $null (; 11 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 723db616..cc0281d3 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -17,6 +17,8 @@ (global $~argc (mut i32) (i32.const 0)) (global $std/arraybuffer/sliced (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 160)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") @@ -3174,4 +3176,6 @@ ) ) ) + (func $null (; 11 ;) (type $v) + ) ) diff --git a/tests/compiler/std/constructor.optimized.wat b/tests/compiler/std/constructor.optimized.wat index bb52720c..38e0b9fc 100644 --- a/tests/compiler/std/constructor.optimized.wat +++ b/tests/compiler/std/constructor.optimized.wat @@ -234,4 +234,7 @@ (call $std/constructor/CtorConditionallyAllocates#constructor) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/constructor.untouched.wat b/tests/compiler/std/constructor.untouched.wat index 435580c0..435bc0d2 100644 --- a/tests/compiler/std/constructor.untouched.wat +++ b/tests/compiler/std/constructor.untouched.wat @@ -19,6 +19,8 @@ (global $std/constructor/ctorAllocates (mut i32) (i32.const 0)) (global $std/constructor/ctorConditionallyAllocates (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -405,4 +407,6 @@ ) ) ) + (func $null (; 10 ;) (type $v) + ) ) diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat index fc635243..b802ffb5 100644 --- a/tests/compiler/std/gc-array.optimized.wat +++ b/tests/compiler/std/gc-array.optimized.wat @@ -20,12 +20,13 @@ (global $std/gc-array/arr (mut i32) (i32.const 48)) (global $~argc (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) - (table 6 6 anyfunc) - (elem (i32.const 0) $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $~lib/arraybuffer/ArrayBuffer~gc $~lib/arraybuffer/ArrayBuffer~gc $~lib/allocator/arena/__memory_free) + (table 7 7 anyfunc) + (elem (i32.const 0) $null $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $~lib/arraybuffer/ArrayBuffer~gc $~lib/arraybuffer/ArrayBuffer~gc $~lib/allocator/arena/__memory_free) (memory $0 1) - (data (i32.const 40) "\01\00\00\00\00\00\00\00\18") - (data (i32.const 64) "\04\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 112) "\04\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 16) "\01") + (data (i32.const 40) "\02\00\00\00\00\00\00\00\18") + (data (i32.const 64) "\05\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 112) "\05\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $std/gc-array/main)) @@ -902,7 +903,7 @@ (call $~lib/internal/arraybuffer/computeSize (get_local $0) ) - (i32.const 5) + (i32.const 6) ) ) (get_local $0) @@ -2847,7 +2848,7 @@ (i32.const 0) (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (call $~lib/gc/gc.collect) @@ -2856,7 +2857,7 @@ (i32.const 1) (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (call $~lib/gc/gc.collect) @@ -2865,15 +2866,18 @@ (i32.const 0) (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 28 ;) (; has Stack IR ;) (type $FUNCSIG$v) + (func $null (; 28 ;) (; has Stack IR ;) (type $v) + (nop) + ) + (func $~iterateRoots (; 29 ;) (; has Stack IR ;) (type $FUNCSIG$v) (call_indirect (type $iv) (get_global $std/gc-array/arr) - (i32.const 2) + (i32.const 3) ) ) ) diff --git a/tests/compiler/std/gc-array.untouched.wat b/tests/compiler/std/gc-array.untouched.wat index 23a84174..ec50f287 100644 --- a/tests/compiler/std/gc-array.untouched.wat +++ b/tests/compiler/std/gc-array.untouched.wat @@ -31,13 +31,13 @@ (global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816)) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 180)) - (table 6 6 anyfunc) - (elem (i32.const 0) $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $std/gc-array/Foo~gc $~lib/string/String~gc $~lib/internal/arraybuffer/__gc) + (table 7 7 anyfunc) + (elem (i32.const 0) $null $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $std/gc-array/Foo~gc $~lib/string/String~gc $~lib/internal/arraybuffer/__gc) (memory $0 1) - (data (i32.const 8) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 32) "\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\00\00\00\00") - (data (i32.const 56) "\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 104) "\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 32) "\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\18\00\00\00\00\00\00\00") + (data (i32.const 56) "\00\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 104) "\00\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $std/gc-array/main)) @@ -473,7 +473,7 @@ ) (block (call $~iterateRoots - (i32.const 2) + (i32.const 3) ) (set_global $~lib/collector/itcm/state (get_global $~lib/collector/itcm/State.MARK) @@ -519,7 +519,7 @@ ) (block (call $~iterateRoots - (i32.const 2) + (i32.const 3) ) (set_local $0 (call $~lib/collector/itcm/ManagedObject#get:next @@ -1114,7 +1114,7 @@ (call $~lib/internal/arraybuffer/computeSize (get_local $0) ) - (i32.const 5) + (i32.const 6) ) ) (i32.store @@ -3570,7 +3570,7 @@ (set_local $0 (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (get_local $0) @@ -3584,7 +3584,7 @@ (set_local $1 (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (get_local $1) @@ -3598,7 +3598,7 @@ (set_local $2 (call $~lib/collector/itcm/__gc_allocate (i32.const 0) - (i32.const 3) + (i32.const 4) ) ) (get_local $2) @@ -3606,7 +3606,9 @@ ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 31 ;) (type $iv) (param $0 i32) + (func $null (; 31 ;) (type $v) + ) + (func $~iterateRoots (; 32 ;) (type $iv) (param $0 i32) (call_indirect (type $iv) (get_global $std/gc-array/arr) (get_local $0) diff --git a/tests/compiler/std/gc-basics.optimized.wat b/tests/compiler/std/gc-basics.optimized.wat index 3f85be27..c6b4bd74 100644 --- a/tests/compiler/std/gc-basics.optimized.wat +++ b/tests/compiler/std/gc-basics.optimized.wat @@ -19,10 +19,10 @@ (global $std/gc-basics/obj (mut i32) (i32.const 0)) (global $std/gc-basics/obj2 (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) - (table 3 3 anyfunc) - (elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) + (table 4 4 anyfunc) + (elem (i32.const 0) $null $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) (memory $0 1) - (data (i32.const 16) "\02\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s") + (data (i32.const 16) "\03\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s") (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $std/gc-basics/main)) @@ -441,7 +441,7 @@ (i32.const 20) ) ) - (i32.const 0) + (i32.const 1) ) (call $~lib/collector/itcm/ManagedObject#set:color (get_local $0) @@ -594,8 +594,11 @@ ) ) (if - (i32.load offset=8 - (get_local $0) + (i32.ne + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) ) (block (call $~lib/env/abort @@ -644,14 +647,17 @@ ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 19 ;) (; has Stack IR ;) (type $FUNCSIG$v) + (func $null (; 19 ;) (; has Stack IR ;) (type $v) + (nop) + ) + (func $~iterateRoots (; 20 ;) (; has Stack IR ;) (type $FUNCSIG$v) (call_indirect (type $iv) (get_global $std/gc-basics/obj) - (i32.const 1) + (i32.const 2) ) (call_indirect (type $iv) (get_global $std/gc-basics/obj2) - (i32.const 1) + (i32.const 2) ) ) ) diff --git a/tests/compiler/std/gc-basics.untouched.wat b/tests/compiler/std/gc-basics.untouched.wat index 59de91db..93acf95c 100644 --- a/tests/compiler/std/gc-basics.untouched.wat +++ b/tests/compiler/std/gc-basics.untouched.wat @@ -29,10 +29,10 @@ (global $std/gc-basics/obj2 (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 60)) - (table 3 3 anyfunc) - (elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) + (table 4 4 anyfunc) + (elem (i32.const 0) $null $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) (memory $0 1) - (data (i32.const 8) "\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s\00") + (data (i32.const 8) "\00\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s\00") (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $std/gc-basics/main)) @@ -407,7 +407,7 @@ ) (block (call $~iterateRoots - (i32.const 1) + (i32.const 2) ) (set_global $~lib/collector/itcm/state (get_global $~lib/collector/itcm/State.MARK) @@ -453,7 +453,7 @@ ) (block (call $~iterateRoots - (i32.const 1) + (i32.const 2) ) (set_local $0 (call $~lib/collector/itcm/ManagedObject#get:next @@ -683,7 +683,7 @@ (set_global $std/gc-basics/obj (call $~lib/collector/itcm/__gc_allocate (i32.const 4) - (i32.const 0) + (i32.const 1) ) ) (i32.store @@ -757,7 +757,7 @@ (i32.eqz (i32.eq (get_local $3) - (i32.const 0) + (i32.const 1) ) ) (block @@ -821,7 +821,9 @@ ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 20 ;) (type $iv) (param $0 i32) + (func $null (; 20 ;) (type $v) + ) + (func $~iterateRoots (; 21 ;) (type $iv) (param $0 i32) (call_indirect (type $iv) (get_global $std/gc-basics/obj) (get_local $0) diff --git a/tests/compiler/std/gc-integration.optimized.wat b/tests/compiler/std/gc-integration.optimized.wat index 85e216ff..9bb3a89a 100644 --- a/tests/compiler/std/gc-integration.optimized.wat +++ b/tests/compiler/std/gc-integration.optimized.wat @@ -8,14 +8,14 @@ (global $std/gc-integration/a_ref (mut i32) (i32.const 24)) (global $std/gc-integration/b_ref (mut i32) (i32.const 32)) (global $std/gc-integration/i (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $start~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1) (memory $0 1) (data (i32.const 8) "\15\00\00\00s\00t\00d\00/\00g\00c\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $start~anonymous|0 (; 1 ;) (; has Stack IR ;) (type $iv) (param $0 i32) + (func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (set_global $std/gc-integration/i (i32.add (get_global $std/gc-integration/i) @@ -59,22 +59,25 @@ ) ) ) - (func $~iterateRoots (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) + (func $~iterateRoots (; 4 ;) (; has Stack IR ;) (type $FUNCSIG$v) (call_indirect (type $iv) (i32.const 8) - (i32.const 0) + (i32.const 1) ) (call_indirect (type $iv) (get_global $std/gc-integration/B.d) - (i32.const 0) + (i32.const 1) ) (call_indirect (type $iv) (get_global $std/gc-integration/a_ref) - (i32.const 0) + (i32.const 1) ) (call_indirect (type $iv) (get_global $std/gc-integration/b_ref) - (i32.const 0) + (i32.const 1) ) ) ) diff --git a/tests/compiler/std/gc-integration.untouched.wat b/tests/compiler/std/gc-integration.untouched.wat index 7553ebe0..19b0963f 100644 --- a/tests/compiler/std/gc-integration.untouched.wat +++ b/tests/compiler/std/gc-integration.untouched.wat @@ -10,14 +10,14 @@ (global $std/gc-integration/b_ref (mut i32) (i32.const 32)) (global $std/gc-integration/i (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 56)) - (table 1 1 anyfunc) - (elem (i32.const 0) $start~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $start~anonymous|1) (memory $0 1) (data (i32.const 8) "\15\00\00\00s\00t\00d\00/\00g\00c\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s\00") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $start~anonymous|0 (; 1 ;) (type $iv) (param $0 i32) + (func $start~anonymous|1 (; 1 ;) (type $iv) (param $0 i32) (if (i32.eqz (i32.eq @@ -55,7 +55,7 @@ (get_global $std/gc-integration/B.d) ) (call $~iterateRoots - (i32.const 0) + (i32.const 1) ) (if (i32.eqz @@ -75,7 +75,9 @@ ) ) ) - (func $~iterateRoots (; 3 ;) (type $iv) (param $0 i32) + (func $null (; 3 ;) (type $v) + ) + (func $~iterateRoots (; 4 ;) (type $iv) (param $0 i32) (call_indirect (type $iv) (get_global $std/gc-integration/B.c) (get_local $0) diff --git a/tests/compiler/std/gc-object.optimized.wat b/tests/compiler/std/gc-object.optimized.wat index 58a76677..d8d2a71d 100644 --- a/tests/compiler/std/gc-object.optimized.wat +++ b/tests/compiler/std/gc-object.optimized.wat @@ -15,8 +15,8 @@ (global $~argc (mut i32) (i32.const 0)) (global $std/gc-object/obj (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) - (table 3 3 anyfunc) - (elem (i32.const 0) $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc) + (table 4 4 anyfunc) + (elem (i32.const 0) $null $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc) (memory $0 0) (export "memory" (memory $0)) (export "table" (table $0)) @@ -434,7 +434,7 @@ (i32.const 24) ) ) - (i32.const 1) + (i32.const 2) ) (call $~lib/collector/itcm/ManagedObject#set:color (get_local $0) @@ -469,7 +469,7 @@ ) (call_indirect (type $iv) (get_local $0) - (i32.const 2) + (i32.const 3) ) (call $~lib/collector/itcm/__gc_mark (i32.load @@ -567,10 +567,13 @@ ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 19 ;) (; has Stack IR ;) (type $FUNCSIG$v) + (func $null (; 19 ;) (; has Stack IR ;) (type $v) + (nop) + ) + (func $~iterateRoots (; 20 ;) (; has Stack IR ;) (type $FUNCSIG$v) (call_indirect (type $iv) (get_global $std/gc-object/obj) - (i32.const 0) + (i32.const 1) ) ) ) diff --git a/tests/compiler/std/gc-object.untouched.wat b/tests/compiler/std/gc-object.untouched.wat index 39199d3e..85c34723 100644 --- a/tests/compiler/std/gc-object.untouched.wat +++ b/tests/compiler/std/gc-object.untouched.wat @@ -25,8 +25,8 @@ (global $std/gc-object/obj (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) - (table 3 3 anyfunc) - (elem (i32.const 0) $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc) + (table 4 4 anyfunc) + (elem (i32.const 0) $null $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc) (memory $0 0) (export "memory" (memory $0)) (export "table" (table $0)) @@ -399,7 +399,7 @@ ) (block (call $~iterateRoots - (i32.const 0) + (i32.const 1) ) (set_global $~lib/collector/itcm/state (get_global $~lib/collector/itcm/State.MARK) @@ -445,7 +445,7 @@ ) (block (call $~iterateRoots - (i32.const 0) + (i32.const 1) ) (set_local $0 (call $~lib/collector/itcm/ManagedObject#get:next @@ -598,7 +598,7 @@ ) (call_indirect (type $iv) (get_local $0) - (i32.const 2) + (i32.const 3) ) (call $~lib/collector/itcm/__gc_mark (i32.load @@ -693,7 +693,7 @@ (set_local $0 (call $~lib/collector/itcm/__gc_allocate (i32.const 8) - (i32.const 1) + (i32.const 2) ) ) (i32.store @@ -718,7 +718,9 @@ ) (call $~lib/gc/gc.collect) ) - (func $~iterateRoots (; 19 ;) (type $iv) (param $0 i32) + (func $null (; 19 ;) (type $v) + ) + (func $~iterateRoots (; 20 ;) (type $iv) (param $0 i32) (call_indirect (type $iv) (get_global $std/gc-object/obj) (get_local $0) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 4d91b885..ce01dbe9 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -324,4 +324,7 @@ ) ) ) + (func $null (; 5 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 398ccec9..22f042d8 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -13,6 +13,8 @@ (global $Infinity f64 (f64.const inf)) (global $NaN f64 (f64.const nan:0x8000000000000)) (global $HEAP_BASE i32 (i32.const 44)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\00\00\00\00") (data (i32.const 16) "\01\00\00\00a\00") @@ -536,4 +538,6 @@ ) ) ) + (func $null (; 5 ;) (type $v) + ) ) diff --git a/tests/compiler/std/libm.optimized.wat b/tests/compiler/std/libm.optimized.wat index f6724e9d..6ad6f38d 100644 --- a/tests/compiler/std/libm.optimized.wat +++ b/tests/compiler/std/libm.optimized.wat @@ -4,6 +4,7 @@ (type $FFF (func (param f64 f64) (result f64))) (type $FiF (func (param f64 i32) (result f64))) (type $Ff (func (param f64) (result f32))) + (type $v (func)) (type $FUNCSIG$d (func (result f64))) (global $std/libm/E f64 (f64.const 2.718281828459045)) (global $std/libm/LN10 f64 (f64.const 2.302585092994046)) @@ -6050,4 +6051,7 @@ (get_local $0) ) ) + (func $null (; 58 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/libm.untouched.wat b/tests/compiler/std/libm.untouched.wat index 8980d416..289dd870 100644 --- a/tests/compiler/std/libm.untouched.wat +++ b/tests/compiler/std/libm.untouched.wat @@ -4,6 +4,7 @@ (type $FFF (func (param f64 f64) (result f64))) (type $FiF (func (param f64 i32) (result f64))) (type $Ff (func (param f64) (result f32))) + (type $v (func)) (global $~lib/math/NativeMath.E f64 (f64.const 2.718281828459045)) (global $std/libm/E f64 (f64.const 2.718281828459045)) (global $~lib/math/NativeMath.LN10 f64 (f64.const 2.302585092994046)) @@ -23,6 +24,8 @@ (global $NaN f64 (f64.const nan:0x8000000000000)) (global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "E" (global $std/libm/E)) @@ -6915,4 +6918,6 @@ ) ) ) + (func $null (; 62 ;) (type $v) + ) ) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index f43cae64..57dfe14b 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -9322,4 +9322,7 @@ (call $std/map/test) (call $std/map/test) ) + (func $null (; 73 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index ccc23d32..622ee5a3 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -34,6 +34,8 @@ (global $~lib/map/FREE_FACTOR f64 (f64.const 0.75)) (global $~lib/map/FILL_FACTOR f64 (f64.const 2.6666666666666665)) (global $HEAP_BASE i32 (i32.const 144)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") @@ -12521,4 +12523,6 @@ (call $std/map/test) (call $std/map/test) ) + (func $null (; 112 ;) (type $v) + ) ) diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 8e177a07..2639a6db 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -52633,4 +52633,7 @@ ) ) ) + (func $null (; 160 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index 75390db9..be0360be 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -88,6 +88,8 @@ (global $~lib/builtins/f32.EPSILON f32 (f32.const 1.1920928955078125e-07)) (global $ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $HEAP_BASE i32 (i32.const 68)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00") (data (i32.const 40) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") @@ -57013,4 +57015,6 @@ ) ) ) + (func $null (; 160 ;) (type $v) + ) ) diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index 3fbb0003..3f6852c2 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -3285,4 +3285,7 @@ ) ) ) + (func $null (; 11 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index cc7feea2..8eb35312 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -15,6 +15,8 @@ (global $NaN f64 (f64.const nan:0x8000000000000)) (global $Infinity f64 (f64.const inf)) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\n\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") (export "memory" (memory $0)) @@ -3509,4 +3511,6 @@ ) ) ) + (func $null (; 11 ;) (type $v) + ) ) diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index f89881b4..b4e6d1ef 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -136,4 +136,7 @@ (call $std/new/AClass#constructor) ) ) + (func $null (; 4 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 3117dc6d..7ae1c7ad 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -10,6 +10,8 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/new/aClass (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -194,4 +196,6 @@ ) ) ) + (func $null (; 4 ;) (type $v) + ) ) diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 01989f65..62e26fd1 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -3474,4 +3474,7 @@ ) ) ) + (func $null (; 31 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 5071adf6..98e750f0 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -81,6 +81,8 @@ (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 68)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\1b\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00") (export "memory" (memory $0)) @@ -3763,4 +3765,6 @@ ) ) ) + (func $null (; 33 ;) (type $v) + ) ) diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index f5f98e4b..670108fc 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -2336,4 +2336,7 @@ ) ) ) + (func $null (; 10 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index 90b099e7..8be657f1 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -15,6 +15,8 @@ (global $std/pointer/nextOne (mut i32) (i32.const 0)) (global $std/pointer/buf (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 40)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0e\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) @@ -3353,4 +3355,6 @@ ) ) ) + (func $null (; 11 ;) (type $v) + ) ) diff --git a/tests/compiler/std/polyfills.optimized.wat b/tests/compiler/std/polyfills.optimized.wat index 38372eb9..63f385b4 100644 --- a/tests/compiler/std/polyfills.optimized.wat +++ b/tests/compiler/std/polyfills.optimized.wat @@ -344,4 +344,7 @@ ) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/polyfills.untouched.wat b/tests/compiler/std/polyfills.untouched.wat index 35b4ac2d..92634d49 100644 --- a/tests/compiler/std/polyfills.untouched.wat +++ b/tests/compiler/std/polyfills.untouched.wat @@ -5,6 +5,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 84)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\11\00\00\00~\00l\00i\00b\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00") (data (i32.const 48) "\10\00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00") @@ -1157,4 +1159,6 @@ ) ) ) + (func $null (; 14 ;) (type $v) + ) ) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 243c490f..d6215410 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -7873,4 +7873,7 @@ (call $std/set/test) (call $std/set/test) ) + (func $null (; 73 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index d4204ed8..8e5bc866 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -36,6 +36,8 @@ (global $~lib/set/FREE_FACTOR f64 (f64.const 0.75)) (global $~lib/set/FILL_FACTOR f64 (f64.const 2.6666666666666665)) (global $HEAP_BASE i32 (i32.const 144)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") @@ -10897,4 +10899,6 @@ (call $std/set/test) (call $std/set/test) ) + (func $null (; 112 ;) (type $v) + ) ) diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 0ba6a6e3..702fcb82 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -2808,4 +2808,7 @@ ) ) ) + (func $null (; 17 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 67b8c31d..4aafc7b8 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -24,6 +24,8 @@ (global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8)) (global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816)) (global $HEAP_BASE i32 (i32.const 276)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") (data (i32.const 24) "\08\00\00\00\02\00\00\00") @@ -3639,4 +3641,6 @@ ) ) ) + (func $null (; 17 ;) (type $v) + ) ) diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index 5284096f..70792f21 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -752,4 +752,7 @@ ) (call $~lib/allocator/arena/__memory_free) ) + (func $null (; 6 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index f29c6f31..a624c0da 100644 --- a/tests/compiler/std/string-utf8.untouched.wat +++ b/tests/compiler/std/string-utf8.untouched.wat @@ -15,6 +15,8 @@ (global $std/string-utf8/len (mut i32) (i32.const 0)) (global $std/string-utf8/ptr (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 64)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\06\00\00\00\01\d87\dch\00i\00R\d8b\df") (data (i32.const 24) "\12\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s\00") @@ -875,4 +877,6 @@ ) ) ) + (func $null (; 6 ;) (type $v) + ) ) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 28fc491f..75c2842a 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -7349,4 +7349,7 @@ ) ) ) + (func $null (; 44 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 8dfe615c..e4e9a585 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -62,6 +62,8 @@ (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) (global $~lib/builtins/i64.MIN_VALUE i64 (i64.const -9223372036854775808)) (global $HEAP_BASE i32 (i32.const 2796)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\10\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g\00") (data (i32.const 48) "\0d\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") @@ -8570,4 +8572,6 @@ ) ) ) + (func $null (; 44 ;) (type $v) + ) ) diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 17544330..7b3dafa7 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -1780,4 +1780,7 @@ ) ) ) + (func $null (; 27 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 09e4b2bc..5d2441c1 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -39,6 +39,8 @@ (global $~lib/symbol/Symbol.hasInstance i32 (i32.const 1)) (global $~lib/symbol/Symbol.concatSpreadable i32 (i32.const 2)) (global $HEAP_BASE i32 (i32.const 164)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\03\00\00\001\002\003\00") (data (i32.const 24) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s\00") @@ -2220,4 +2222,6 @@ (get_global $~lib/symbol/Symbol.concatSpreadable) ) ) + (func $null (; 29 ;) (type $v) + ) ) diff --git a/tests/compiler/std/trace.optimized.wat b/tests/compiler/std/trace.optimized.wat index b79c83f6..02720d03 100644 --- a/tests/compiler/std/trace.optimized.wat +++ b/tests/compiler/std/trace.optimized.wat @@ -101,4 +101,7 @@ (f64.const 5.5) ) ) + (func $null (; 3 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/trace.untouched.wat b/tests/compiler/std/trace.untouched.wat index 9a19ff10..cb994611 100644 --- a/tests/compiler/std/trace.untouched.wat +++ b/tests/compiler/std/trace.untouched.wat @@ -4,6 +4,8 @@ (import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 212)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\0d\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t\00") (data (i32.const 40) "\0d\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t\00") @@ -102,4 +104,6 @@ (f64.const 5.5) ) ) + (func $null (; 3 ;) (type $v) + ) ) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 6acbe10c..4dfd75bf 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -19,8 +19,8 @@ (global $std/typedarray/af64 (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) - (table 1 1 anyfunc) - (elem (i32.const 0) $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1) (memory $0 1) (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") @@ -2346,7 +2346,7 @@ ) (get_local $0) ) - (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0 (; 20 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 (; 20 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) (i32.sub @@ -2391,6 +2391,7 @@ ) ) (func $~lib/internal/typedarray/TypedArray#sort|trampoline (; 21 ;) (; has Stack IR ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (block $1of1 (block $0of1 (block $outOfRange @@ -2400,10 +2401,13 @@ ) (unreachable) ) + (set_local $1 + (i32.const 1) + ) ) (call $~lib/internal/typedarray/TypedArray#sort (get_local $0) - (i32.const 0) + (get_local $1) ) ) (func $~lib/internal/typedarray/TypedArray#__get (; 22 ;) (; has Stack IR ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) @@ -3010,4 +3014,7 @@ ) ) ) + (func $null (; 27 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 38b114cb..11f29640 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -35,8 +35,8 @@ (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) (global $std/typedarray/MAX_F64LENGTH i32 (i32.const 134217727)) (global $HEAP_BASE i32 (i32.const 172)) - (table 1 1 anyfunc) - (elem (i32.const 0) $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0) + (table 2 2 anyfunc) + (elem (i32.const 0) $null $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1) (memory $0 1) (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") @@ -3666,7 +3666,7 @@ (get_local $0) ) ) - (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0 (; 26 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 (; 26 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) (set_local $2 @@ -3727,7 +3727,7 @@ (set_local $1 (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) (br $~lib/internal/array/defaultComparator|inlined.0 - (i32.const 0) + (i32.const 1) ) ) ) @@ -4650,4 +4650,6 @@ ) ) ) + (func $null (; 33 ;) (type $v) + ) ) diff --git a/tests/compiler/switch.optimized.wat b/tests/compiler/switch.optimized.wat index 27ebf93a..6ee7aa5d 100644 --- a/tests/compiler/switch.optimized.wat +++ b/tests/compiler/switch.optimized.wat @@ -632,4 +632,7 @@ ) ) ) + (func $null (; 9 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index 2341b6d2..a4329dde 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -4,6 +4,8 @@ (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $HEAP_BASE i32 (i32.const 32)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\t\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") (export "memory" (memory $0)) @@ -773,4 +775,6 @@ ) ) ) + (func $null (; 9 ;) (type $v) + ) ) diff --git a/tests/compiler/ternary.optimized.wat b/tests/compiler/ternary.optimized.wat index 78da9422..46b8f34c 100644 --- a/tests/compiler/ternary.optimized.wat +++ b/tests/compiler/ternary.optimized.wat @@ -15,4 +15,7 @@ (i32.const 1) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/ternary.untouched.wat b/tests/compiler/ternary.untouched.wat index aedebd54..e56ae79f 100644 --- a/tests/compiler/ternary.untouched.wat +++ b/tests/compiler/ternary.untouched.wat @@ -2,6 +2,8 @@ (type $v (func)) (global $ternary/a (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -25,4 +27,6 @@ (i32.const 1) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/typealias.optimized.wat b/tests/compiler/typealias.optimized.wat index 3d5784e2..a1487511 100644 --- a/tests/compiler/typealias.optimized.wat +++ b/tests/compiler/typealias.optimized.wat @@ -1,9 +1,13 @@ (module (type $ii (func (param i32) (result i32))) + (type $v (func)) (memory $0 0) (export "memory" (memory $0)) (export "alias" (func $typealias/alias)) (func $typealias/alias (; 0 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (get_local $0) ) + (func $start (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/typealias.untouched.wat b/tests/compiler/typealias.untouched.wat index b18bf6fb..fee8f60f 100644 --- a/tests/compiler/typealias.untouched.wat +++ b/tests/compiler/typealias.untouched.wat @@ -2,6 +2,8 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (export "alias" (func $typealias/alias)) @@ -12,4 +14,6 @@ (func $start (; 1 ;) (type $v) (nop) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/unary.optimized.wat b/tests/compiler/unary.optimized.wat index cb5cd1c3..db0d1d60 100644 --- a/tests/compiler/unary.optimized.wat +++ b/tests/compiler/unary.optimized.wat @@ -347,4 +347,7 @@ (get_local $3) ) ) + (func $null (; 1 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/unary.untouched.wat b/tests/compiler/unary.untouched.wat index b7d25b37..bd4c6d4f 100644 --- a/tests/compiler/unary.untouched.wat +++ b/tests/compiler/unary.untouched.wat @@ -5,6 +5,8 @@ (global $unary/f (mut f32) (f32.const 0)) (global $unary/F (mut f64) (f64.const 0)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -541,4 +543,6 @@ ) ) ) + (func $null (; 1 ;) (type $v) + ) ) diff --git a/tests/compiler/void.optimized.wat b/tests/compiler/void.optimized.wat index f3bad575..d4eb19aa 100644 --- a/tests/compiler/void.optimized.wat +++ b/tests/compiler/void.optimized.wat @@ -12,4 +12,7 @@ (call $void/anInt) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/void.untouched.wat b/tests/compiler/void.untouched.wat index e31e7ca5..753ecb84 100644 --- a/tests/compiler/void.untouched.wat +++ b/tests/compiler/void.untouched.wat @@ -4,6 +4,8 @@ (global $void/u8Val1 (mut i32) (i32.const 1)) (global $void/u8Val2 (mut i32) (i32.const 255)) (global $HEAP_BASE i32 (i32.const 8)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 0) (export "memory" (memory $0)) (start $start) @@ -24,4 +26,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) ) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 57e89b2c..565450bc 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -237,4 +237,7 @@ ) ) ) + (func $null (; 2 ;) (; has Stack IR ;) (type $v) + (nop) + ) ) diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 22c3e576..3ce17686 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -6,6 +6,8 @@ (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 28)) + (table 1 1 anyfunc) + (elem (i32.const 0) $null) (memory $0 1) (data (i32.const 8) "\08\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") (export "memory" (memory $0)) @@ -286,4 +288,6 @@ ) ) ) + (func $null (; 2 ;) (type $v) + ) )