From e92d362336353011566920fad52ad4846443edf0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 16 Feb 2023 22:38:37 +0800 Subject: [PATCH 1/4] fix: addMemory does not support 65536pages --- std/assembly/rt/tlsf.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index df437b82cb..d7efcce560 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -374,7 +374,7 @@ function prepareBlock(root: Root, block: Block, size: usize): void { /** Adds more memory to the pool. */ function addMemory(root: Root, start: usize, end: usize): bool { - if (DEBUG) assert(start <= end); // must be valid + if (DEBUG) assert(start <= end || end == 0); // must be valid start = ((start + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD; end &= ~AL_MASK; From c0e45cde170c777de761afaa4409ec32f06d749b Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 16 Feb 2023 22:43:06 +0800 Subject: [PATCH 2/4] update test --- tests/compiler/bindings/esm.debug.wat | 7 ++ tests/compiler/bindings/esm.release.wat | 6 +- .../bindings/noExportRuntime.debug.wat | 7 ++ .../bindings/noExportRuntime.release.wat | 6 +- tests/compiler/bindings/raw.debug.wat | 7 ++ tests/compiler/bindings/raw.release.wat | 6 +- tests/compiler/call-super.debug.wat | 7 ++ tests/compiler/call-super.release.wat | 6 +- tests/compiler/class-implements.debug.wat | 7 ++ tests/compiler/class-implements.release.wat | 6 +- .../compiler/class-overloading-cast.debug.wat | 7 ++ .../class-overloading-cast.release.wat | 6 +- tests/compiler/class-overloading.debug.wat | 7 ++ tests/compiler/class-overloading.release.wat | 6 +- tests/compiler/class.debug.wat | 7 ++ tests/compiler/class.release.wat | 6 +- tests/compiler/constructor.debug.wat | 7 ++ tests/compiler/constructor.release.wat | 6 +- tests/compiler/do.debug.wat | 7 ++ tests/compiler/do.release.wat | 6 +- tests/compiler/duplicate-fields.debug.wat | 7 ++ tests/compiler/duplicate-fields.release.wat | 6 +- tests/compiler/empty-exportruntime.debug.wat | 7 ++ .../compiler/empty-exportruntime.release.wat | 6 +- tests/compiler/empty-new.debug.wat | 7 ++ tests/compiler/empty-new.release.wat | 6 +- .../compiler/exportstar-rereexport.debug.wat | 7 ++ .../exportstar-rereexport.release.wat | 6 +- .../compiler/extends-baseaggregate.debug.wat | 7 ++ .../extends-baseaggregate.release.wat | 6 +- tests/compiler/extends-recursive.debug.wat | 7 ++ tests/compiler/extends-recursive.release.wat | 6 +- tests/compiler/field-initialization.debug.wat | 7 ++ .../compiler/field-initialization.release.wat | 6 +- tests/compiler/field.debug.wat | 7 ++ tests/compiler/field.release.wat | 6 +- tests/compiler/for.debug.wat | 7 ++ tests/compiler/for.release.wat | 6 +- tests/compiler/function-call.debug.wat | 7 ++ tests/compiler/function-call.release.wat | 6 +- tests/compiler/function-expression.debug.wat | 7 ++ .../compiler/function-expression.release.wat | 6 +- tests/compiler/getter-call.debug.wat | 7 ++ tests/compiler/getter-call.release.wat | 6 +- tests/compiler/heap.debug.wat | 7 ++ tests/compiler/heap.release.wat | 6 +- tests/compiler/infer-array.debug.wat | 7 ++ tests/compiler/infer-array.release.wat | 6 +- tests/compiler/infer-generic.debug.wat | 7 ++ tests/compiler/infer-generic.release.wat | 6 +- tests/compiler/inlining.debug.wat | 7 ++ tests/compiler/inlining.release.wat | 6 +- tests/compiler/instanceof.debug.wat | 7 ++ tests/compiler/instanceof.release.wat | 6 +- tests/compiler/issues/1095.debug.wat | 7 ++ tests/compiler/issues/1095.release.wat | 6 +- tests/compiler/issues/1225.debug.wat | 7 ++ tests/compiler/issues/1225.release.wat | 6 +- tests/compiler/issues/1699.debug.wat | 7 ++ tests/compiler/issues/1699.release.wat | 6 +- tests/compiler/issues/2166.debug.wat | 7 ++ tests/compiler/issues/2166.release.wat | 6 +- tests/compiler/issues/2322/index.debug.wat | 7 ++ tests/compiler/issues/2322/index.release.wat | 6 +- tests/compiler/issues/2622.debug.wat | 7 ++ tests/compiler/issues/2622.release.wat | 6 +- tests/compiler/logical.debug.wat | 7 ++ tests/compiler/logical.release.wat | 6 +- tests/compiler/managed-cast.debug.wat | 7 ++ tests/compiler/managed-cast.release.wat | 6 +- tests/compiler/new.debug.wat | 7 ++ tests/compiler/new.release.wat | 6 +- tests/compiler/object-literal.debug.wat | 7 ++ tests/compiler/object-literal.release.wat | 6 +- .../optional-typeparameters.debug.wat | 7 ++ .../optional-typeparameters.release.wat | 6 +- tests/compiler/reexport.debug.wat | 7 ++ tests/compiler/reexport.release.wat | 6 +- tests/compiler/rereexport.debug.wat | 7 ++ tests/compiler/rereexport.release.wat | 6 +- tests/compiler/resolve-access.debug.wat | 7 ++ tests/compiler/resolve-access.release.wat | 6 +- tests/compiler/resolve-binary.debug.wat | 7 ++ tests/compiler/resolve-binary.release.wat | 6 +- .../compiler/resolve-elementaccess.debug.wat | 7 ++ .../resolve-elementaccess.release.wat | 6 +- .../resolve-function-expression.debug.wat | 7 ++ .../resolve-function-expression.release.wat | 6 +- tests/compiler/resolve-new.debug.wat | 7 ++ tests/compiler/resolve-new.release.wat | 6 +- .../compiler/resolve-propertyaccess.debug.wat | 7 ++ .../resolve-propertyaccess.release.wat | 6 +- tests/compiler/resolve-ternary.debug.wat | 7 ++ tests/compiler/resolve-ternary.release.wat | 6 +- tests/compiler/resolve-unary.debug.wat | 7 ++ tests/compiler/resolve-unary.release.wat | 6 +- tests/compiler/return-unreachable.debug.wat | 7 ++ tests/compiler/return-unreachable.release.wat | 6 +- tests/compiler/rt/finalize.debug.wat | 7 ++ tests/compiler/rt/finalize.release.wat | 6 +- .../rt/runtime-incremental-export.debug.wat | 7 ++ .../rt/runtime-incremental-export.release.wat | 6 +- .../rt/runtime-minimal-export.debug.wat | 7 ++ .../rt/runtime-minimal-export.release.wat | 6 +- tests/compiler/simd.debug.wat | 7 ++ tests/compiler/simd.release.wat | 6 +- tests/compiler/std/array-literal.debug.wat | 7 ++ tests/compiler/std/array-literal.release.wat | 6 +- tests/compiler/std/array.debug.wat | 7 ++ tests/compiler/std/array.release.wat | 6 +- tests/compiler/std/arraybuffer.debug.wat | 7 ++ tests/compiler/std/arraybuffer.release.wat | 6 +- tests/compiler/std/dataview.debug.wat | 7 ++ tests/compiler/std/dataview.release.wat | 6 +- tests/compiler/std/date.debug.wat | 7 ++ tests/compiler/std/date.release.wat | 6 +- tests/compiler/std/map.debug.wat | 7 ++ tests/compiler/std/map.release.wat | 6 +- tests/compiler/std/new.debug.wat | 7 ++ tests/compiler/std/new.release.wat | 6 +- .../std/operator-overloading.debug.wat | 7 ++ .../std/operator-overloading.release.wat | 6 +- tests/compiler/std/set.debug.wat | 7 ++ tests/compiler/std/set.release.wat | 6 +- tests/compiler/std/static-array.debug.wat | 7 ++ tests/compiler/std/static-array.release.wat | 6 +- tests/compiler/std/staticarray.debug.wat | 7 ++ tests/compiler/std/staticarray.release.wat | 6 +- .../compiler/std/string-casemapping.debug.wat | 7 ++ .../std/string-casemapping.release.wat | 6 +- tests/compiler/std/string-encoding.debug.wat | 7 ++ .../compiler/std/string-encoding.release.wat | 6 +- tests/compiler/std/string.debug.wat | 7 ++ tests/compiler/std/string.release.wat | 6 +- tests/compiler/std/symbol.debug.wat | 7 ++ tests/compiler/std/symbol.release.wat | 6 +- tests/compiler/std/typedarray.debug.wat | 7 ++ tests/compiler/std/typedarray.release.wat | 6 +- tests/compiler/std/uri.debug.wat | 7 ++ tests/compiler/std/uri.release.wat | 6 +- tests/compiler/super-inline.debug.wat | 7 ++ tests/compiler/super-inline.release.wat | 6 +- tests/compiler/templateliteral.debug.wat | 7 ++ tests/compiler/templateliteral.release.wat | 6 +- tests/compiler/throw.debug.wat | 7 ++ tests/compiler/throw.release.wat | 99 ++++++++++--------- tests/compiler/typeof.debug.wat | 7 ++ tests/compiler/typeof.release.wat | 6 +- tests/compiler/while.debug.wat | 7 ++ tests/compiler/while.release.wat | 6 +- 150 files changed, 945 insertions(+), 123 deletions(-) diff --git a/tests/compiler/bindings/esm.debug.wat b/tests/compiler/bindings/esm.debug.wat index 361c0f6b46..03e27b3dba 100644 --- a/tests/compiler/bindings/esm.debug.wat +++ b/tests/compiler/bindings/esm.debug.wat @@ -1137,6 +1137,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/bindings/esm.release.wat b/tests/compiler/bindings/esm.release.wat index f611ce3b6d..b0e00dbe1d 100644 --- a/tests/compiler/bindings/esm.release.wat +++ b/tests/compiler/bindings/esm.release.wat @@ -734,9 +734,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1696 diff --git a/tests/compiler/bindings/noExportRuntime.debug.wat b/tests/compiler/bindings/noExportRuntime.debug.wat index 336022a818..4960f8fc61 100644 --- a/tests/compiler/bindings/noExportRuntime.debug.wat +++ b/tests/compiler/bindings/noExportRuntime.debug.wat @@ -1052,6 +1052,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/bindings/noExportRuntime.release.wat b/tests/compiler/bindings/noExportRuntime.release.wat index 9cea61fa38..173f60717e 100644 --- a/tests/compiler/bindings/noExportRuntime.release.wat +++ b/tests/compiler/bindings/noExportRuntime.release.wat @@ -667,9 +667,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1536 diff --git a/tests/compiler/bindings/raw.debug.wat b/tests/compiler/bindings/raw.debug.wat index 518563de8b..32a5b7f4ce 100644 --- a/tests/compiler/bindings/raw.debug.wat +++ b/tests/compiler/bindings/raw.debug.wat @@ -1140,6 +1140,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/bindings/raw.release.wat b/tests/compiler/bindings/raw.release.wat index d5f87d12e3..f1b7aa128e 100644 --- a/tests/compiler/bindings/raw.release.wat +++ b/tests/compiler/bindings/raw.release.wat @@ -734,9 +734,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1696 diff --git a/tests/compiler/call-super.debug.wat b/tests/compiler/call-super.debug.wat index cc484ae977..5aa2abfd02 100644 --- a/tests/compiler/call-super.debug.wat +++ b/tests/compiler/call-super.debug.wat @@ -1028,6 +1028,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/call-super.release.wat b/tests/compiler/call-super.release.wat index 654836a62c..1ce46c171a 100644 --- a/tests/compiler/call-super.release.wat +++ b/tests/compiler/call-super.release.wat @@ -614,9 +614,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/class-implements.debug.wat b/tests/compiler/class-implements.debug.wat index 1f9202b68d..ef19e9d227 100644 --- a/tests/compiler/class-implements.debug.wat +++ b/tests/compiler/class-implements.debug.wat @@ -1031,6 +1031,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/class-implements.release.wat b/tests/compiler/class-implements.release.wat index 5108fb86d9..19ab9e6870 100644 --- a/tests/compiler/class-implements.release.wat +++ b/tests/compiler/class-implements.release.wat @@ -663,9 +663,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class-overloading-cast.debug.wat b/tests/compiler/class-overloading-cast.debug.wat index e11e750dd1..1c26806065 100644 --- a/tests/compiler/class-overloading-cast.debug.wat +++ b/tests/compiler/class-overloading-cast.debug.wat @@ -1037,6 +1037,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/class-overloading-cast.release.wat b/tests/compiler/class-overloading-cast.release.wat index f4b22fd84b..35b6cbb524 100644 --- a/tests/compiler/class-overloading-cast.release.wat +++ b/tests/compiler/class-overloading-cast.release.wat @@ -651,9 +651,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class-overloading.debug.wat b/tests/compiler/class-overloading.debug.wat index 134d29c2f3..7cbbda6acf 100644 --- a/tests/compiler/class-overloading.debug.wat +++ b/tests/compiler/class-overloading.debug.wat @@ -1041,6 +1041,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/class-overloading.release.wat b/tests/compiler/class-overloading.release.wat index 659e74f377..5a61f57076 100644 --- a/tests/compiler/class-overloading.release.wat +++ b/tests/compiler/class-overloading.release.wat @@ -673,9 +673,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/class.debug.wat b/tests/compiler/class.debug.wat index 595d2b753a..a42e787e3d 100644 --- a/tests/compiler/class.debug.wat +++ b/tests/compiler/class.debug.wat @@ -1108,6 +1108,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/class.release.wat b/tests/compiler/class.release.wat index 96578864a3..c86e991cc1 100644 --- a/tests/compiler/class.release.wat +++ b/tests/compiler/class.release.wat @@ -620,9 +620,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/constructor.debug.wat b/tests/compiler/constructor.debug.wat index 2b344933c3..ca32016f80 100644 --- a/tests/compiler/constructor.debug.wat +++ b/tests/compiler/constructor.debug.wat @@ -1036,6 +1036,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/constructor.release.wat b/tests/compiler/constructor.release.wat index 93e6e8b185..89ed17f28e 100644 --- a/tests/compiler/constructor.release.wat +++ b/tests/compiler/constructor.release.wat @@ -677,9 +677,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/do.debug.wat b/tests/compiler/do.debug.wat index c6ad44feb3..05542539a8 100644 --- a/tests/compiler/do.debug.wat +++ b/tests/compiler/do.debug.wat @@ -1432,6 +1432,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/do.release.wat b/tests/compiler/do.release.wat index eb0cb5c902..3e0176701c 100644 --- a/tests/compiler/do.release.wat +++ b/tests/compiler/do.release.wat @@ -613,9 +613,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/duplicate-fields.debug.wat b/tests/compiler/duplicate-fields.debug.wat index 993ef325d3..163aae9ca1 100644 --- a/tests/compiler/duplicate-fields.debug.wat +++ b/tests/compiler/duplicate-fields.debug.wat @@ -1031,6 +1031,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/duplicate-fields.release.wat b/tests/compiler/duplicate-fields.release.wat index f968972323..cf8f5bc2e0 100644 --- a/tests/compiler/duplicate-fields.release.wat +++ b/tests/compiler/duplicate-fields.release.wat @@ -627,9 +627,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-exportruntime.debug.wat b/tests/compiler/empty-exportruntime.debug.wat index 50847867ba..19aebb2f07 100644 --- a/tests/compiler/empty-exportruntime.debug.wat +++ b/tests/compiler/empty-exportruntime.debug.wat @@ -1030,6 +1030,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/empty-exportruntime.release.wat b/tests/compiler/empty-exportruntime.release.wat index e5173b207f..9effd21443 100644 --- a/tests/compiler/empty-exportruntime.release.wat +++ b/tests/compiler/empty-exportruntime.release.wat @@ -628,9 +628,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-new.debug.wat b/tests/compiler/empty-new.debug.wat index e18fdac218..f80e2d0577 100644 --- a/tests/compiler/empty-new.debug.wat +++ b/tests/compiler/empty-new.debug.wat @@ -1023,6 +1023,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/empty-new.release.wat b/tests/compiler/empty-new.release.wat index 10432c3a21..6ec33486f3 100644 --- a/tests/compiler/empty-new.release.wat +++ b/tests/compiler/empty-new.release.wat @@ -610,9 +610,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/exportstar-rereexport.debug.wat b/tests/compiler/exportstar-rereexport.debug.wat index b6004df7ca..88315555c7 100644 --- a/tests/compiler/exportstar-rereexport.debug.wat +++ b/tests/compiler/exportstar-rereexport.debug.wat @@ -1063,6 +1063,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/exportstar-rereexport.release.wat b/tests/compiler/exportstar-rereexport.release.wat index 52423aaf4f..03bbac5a18 100644 --- a/tests/compiler/exportstar-rereexport.release.wat +++ b/tests/compiler/exportstar-rereexport.release.wat @@ -644,9 +644,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/extends-baseaggregate.debug.wat b/tests/compiler/extends-baseaggregate.debug.wat index 9cd56928f4..a255f27e4d 100644 --- a/tests/compiler/extends-baseaggregate.debug.wat +++ b/tests/compiler/extends-baseaggregate.debug.wat @@ -1033,6 +1033,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/extends-baseaggregate.release.wat b/tests/compiler/extends-baseaggregate.release.wat index c64210dd0d..1ad5c2deee 100644 --- a/tests/compiler/extends-baseaggregate.release.wat +++ b/tests/compiler/extends-baseaggregate.release.wat @@ -630,9 +630,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1552 diff --git a/tests/compiler/extends-recursive.debug.wat b/tests/compiler/extends-recursive.debug.wat index 6dad1f6cd6..75731d285b 100644 --- a/tests/compiler/extends-recursive.debug.wat +++ b/tests/compiler/extends-recursive.debug.wat @@ -1023,6 +1023,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/extends-recursive.release.wat b/tests/compiler/extends-recursive.release.wat index 32acf70d3f..73b4e52c52 100644 --- a/tests/compiler/extends-recursive.release.wat +++ b/tests/compiler/extends-recursive.release.wat @@ -611,9 +611,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/field-initialization.debug.wat b/tests/compiler/field-initialization.debug.wat index 51376fcc81..0c58397882 100644 --- a/tests/compiler/field-initialization.debug.wat +++ b/tests/compiler/field-initialization.debug.wat @@ -1034,6 +1034,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/field-initialization.release.wat b/tests/compiler/field-initialization.release.wat index e847de464b..09309044c6 100644 --- a/tests/compiler/field-initialization.release.wat +++ b/tests/compiler/field-initialization.release.wat @@ -631,9 +631,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/field.debug.wat b/tests/compiler/field.debug.wat index 8877fb1237..fb7e16580d 100644 --- a/tests/compiler/field.debug.wat +++ b/tests/compiler/field.debug.wat @@ -1025,6 +1025,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/field.release.wat b/tests/compiler/field.release.wat index 8554a903a1..9efe273400 100644 --- a/tests/compiler/field.release.wat +++ b/tests/compiler/field.release.wat @@ -614,9 +614,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/for.debug.wat b/tests/compiler/for.debug.wat index dde2f7854f..c5cea01699 100644 --- a/tests/compiler/for.debug.wat +++ b/tests/compiler/for.debug.wat @@ -1413,6 +1413,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/for.release.wat b/tests/compiler/for.release.wat index 379c0dfa73..da19dcee11 100644 --- a/tests/compiler/for.release.wat +++ b/tests/compiler/for.release.wat @@ -613,9 +613,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/function-call.debug.wat b/tests/compiler/function-call.debug.wat index 5bfb3b9008..1778e7fa7c 100644 --- a/tests/compiler/function-call.debug.wat +++ b/tests/compiler/function-call.debug.wat @@ -1061,6 +1061,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/function-call.release.wat b/tests/compiler/function-call.release.wat index 76437e09d9..e8f1a6e75b 100644 --- a/tests/compiler/function-call.release.wat +++ b/tests/compiler/function-call.release.wat @@ -652,9 +652,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/function-expression.debug.wat b/tests/compiler/function-expression.debug.wat index e4f42b00f5..190a17fcff 100644 --- a/tests/compiler/function-expression.debug.wat +++ b/tests/compiler/function-expression.debug.wat @@ -1219,6 +1219,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/function-expression.release.wat b/tests/compiler/function-expression.release.wat index 7094f39992..6cc059c855 100644 --- a/tests/compiler/function-expression.release.wat +++ b/tests/compiler/function-expression.release.wat @@ -678,9 +678,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1936 diff --git a/tests/compiler/getter-call.debug.wat b/tests/compiler/getter-call.debug.wat index 4bbd7a4898..94c719dd8f 100644 --- a/tests/compiler/getter-call.debug.wat +++ b/tests/compiler/getter-call.debug.wat @@ -1026,6 +1026,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/getter-call.release.wat b/tests/compiler/getter-call.release.wat index 7f0831295c..2dc93630a7 100644 --- a/tests/compiler/getter-call.release.wat +++ b/tests/compiler/getter-call.release.wat @@ -616,9 +616,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/heap.debug.wat b/tests/compiler/heap.debug.wat index 30f6593795..03bbdf925e 100644 --- a/tests/compiler/heap.debug.wat +++ b/tests/compiler/heap.debug.wat @@ -671,6 +671,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/heap.release.wat b/tests/compiler/heap.release.wat index 6e94f90a88..02881148bb 100644 --- a/tests/compiler/heap.release.wat +++ b/tests/compiler/heap.release.wat @@ -417,9 +417,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1056 diff --git a/tests/compiler/infer-array.debug.wat b/tests/compiler/infer-array.debug.wat index 0f9f87e280..41b69c90bb 100644 --- a/tests/compiler/infer-array.debug.wat +++ b/tests/compiler/infer-array.debug.wat @@ -1044,6 +1044,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/infer-array.release.wat b/tests/compiler/infer-array.release.wat index 457300ae59..ca83e42920 100644 --- a/tests/compiler/infer-array.release.wat +++ b/tests/compiler/infer-array.release.wat @@ -652,9 +652,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/infer-generic.debug.wat b/tests/compiler/infer-generic.debug.wat index 7a4dbd0678..dc3f288429 100644 --- a/tests/compiler/infer-generic.debug.wat +++ b/tests/compiler/infer-generic.debug.wat @@ -1071,6 +1071,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/infer-generic.release.wat b/tests/compiler/infer-generic.release.wat index f0bd800340..f046ee0c95 100644 --- a/tests/compiler/infer-generic.release.wat +++ b/tests/compiler/infer-generic.release.wat @@ -640,9 +640,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1568 diff --git a/tests/compiler/inlining.debug.wat b/tests/compiler/inlining.debug.wat index f055c78df0..d01f86fbba 100644 --- a/tests/compiler/inlining.debug.wat +++ b/tests/compiler/inlining.debug.wat @@ -1291,6 +1291,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/inlining.release.wat b/tests/compiler/inlining.release.wat index d6193de63a..c70c8ada59 100644 --- a/tests/compiler/inlining.release.wat +++ b/tests/compiler/inlining.release.wat @@ -626,9 +626,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1472 diff --git a/tests/compiler/instanceof.debug.wat b/tests/compiler/instanceof.debug.wat index 9a8bd95d04..5cee12228e 100644 --- a/tests/compiler/instanceof.debug.wat +++ b/tests/compiler/instanceof.debug.wat @@ -1047,6 +1047,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/instanceof.release.wat b/tests/compiler/instanceof.release.wat index da77b80092..98178bebc1 100644 --- a/tests/compiler/instanceof.release.wat +++ b/tests/compiler/instanceof.release.wat @@ -718,9 +718,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1095.debug.wat b/tests/compiler/issues/1095.debug.wat index 8ab7464d91..8b47853a21 100644 --- a/tests/compiler/issues/1095.debug.wat +++ b/tests/compiler/issues/1095.debug.wat @@ -1026,6 +1026,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/1095.release.wat b/tests/compiler/issues/1095.release.wat index 42ab6eb81f..9716be30ff 100644 --- a/tests/compiler/issues/1095.release.wat +++ b/tests/compiler/issues/1095.release.wat @@ -617,9 +617,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1225.debug.wat b/tests/compiler/issues/1225.debug.wat index 73a7192646..05f0fa10f3 100644 --- a/tests/compiler/issues/1225.debug.wat +++ b/tests/compiler/issues/1225.debug.wat @@ -1041,6 +1041,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/1225.release.wat b/tests/compiler/issues/1225.release.wat index 2302f147cc..548acd53d9 100644 --- a/tests/compiler/issues/1225.release.wat +++ b/tests/compiler/issues/1225.release.wat @@ -622,9 +622,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1699.debug.wat b/tests/compiler/issues/1699.debug.wat index cdbddc8ed4..0b59c7f09c 100644 --- a/tests/compiler/issues/1699.debug.wat +++ b/tests/compiler/issues/1699.debug.wat @@ -1028,6 +1028,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/1699.release.wat b/tests/compiler/issues/1699.release.wat index 1eb8f533ac..8b22fd9923 100644 --- a/tests/compiler/issues/1699.release.wat +++ b/tests/compiler/issues/1699.release.wat @@ -623,9 +623,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1488 diff --git a/tests/compiler/issues/2166.debug.wat b/tests/compiler/issues/2166.debug.wat index f3e871b082..8dba63b0a4 100644 --- a/tests/compiler/issues/2166.debug.wat +++ b/tests/compiler/issues/2166.debug.wat @@ -1030,6 +1030,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/2166.release.wat b/tests/compiler/issues/2166.release.wat index 31a2a7fdb5..511d21db73 100644 --- a/tests/compiler/issues/2166.release.wat +++ b/tests/compiler/issues/2166.release.wat @@ -622,9 +622,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/2322/index.debug.wat b/tests/compiler/issues/2322/index.debug.wat index 2fe39f45c6..5a7e54a9ac 100644 --- a/tests/compiler/issues/2322/index.debug.wat +++ b/tests/compiler/issues/2322/index.debug.wat @@ -1024,6 +1024,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/2322/index.release.wat b/tests/compiler/issues/2322/index.release.wat index a84de7287d..41aadb5d85 100644 --- a/tests/compiler/issues/2322/index.release.wat +++ b/tests/compiler/issues/2322/index.release.wat @@ -612,9 +612,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/2622.debug.wat b/tests/compiler/issues/2622.debug.wat index a4fc16b0bf..518e16b83d 100644 --- a/tests/compiler/issues/2622.debug.wat +++ b/tests/compiler/issues/2622.debug.wat @@ -1027,6 +1027,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/issues/2622.release.wat b/tests/compiler/issues/2622.release.wat index e82f215f98..f1ad5c79db 100644 --- a/tests/compiler/issues/2622.release.wat +++ b/tests/compiler/issues/2622.release.wat @@ -651,9 +651,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/logical.debug.wat b/tests/compiler/logical.debug.wat index ca58a0e096..09dc5e0849 100644 --- a/tests/compiler/logical.debug.wat +++ b/tests/compiler/logical.debug.wat @@ -1053,6 +1053,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/logical.release.wat b/tests/compiler/logical.release.wat index 276476f81f..0b92fa8d46 100644 --- a/tests/compiler/logical.release.wat +++ b/tests/compiler/logical.release.wat @@ -627,9 +627,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/managed-cast.debug.wat b/tests/compiler/managed-cast.debug.wat index 6637b9e9c6..1186dbbbf8 100644 --- a/tests/compiler/managed-cast.debug.wat +++ b/tests/compiler/managed-cast.debug.wat @@ -1026,6 +1026,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/managed-cast.release.wat b/tests/compiler/managed-cast.release.wat index bbdb8cca74..193feabe15 100644 --- a/tests/compiler/managed-cast.release.wat +++ b/tests/compiler/managed-cast.release.wat @@ -617,9 +617,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/new.debug.wat b/tests/compiler/new.debug.wat index 2832610c28..776e3e24ec 100644 --- a/tests/compiler/new.debug.wat +++ b/tests/compiler/new.debug.wat @@ -1029,6 +1029,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/new.release.wat b/tests/compiler/new.release.wat index d921f7bf03..72c7e35eda 100644 --- a/tests/compiler/new.release.wat +++ b/tests/compiler/new.release.wat @@ -653,9 +653,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/object-literal.debug.wat b/tests/compiler/object-literal.debug.wat index 223d9d3447..9a31a33122 100644 --- a/tests/compiler/object-literal.debug.wat +++ b/tests/compiler/object-literal.debug.wat @@ -1120,6 +1120,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/object-literal.release.wat b/tests/compiler/object-literal.release.wat index 5bce6bbc54..8dd4739af3 100644 --- a/tests/compiler/object-literal.release.wat +++ b/tests/compiler/object-literal.release.wat @@ -627,9 +627,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/optional-typeparameters.debug.wat b/tests/compiler/optional-typeparameters.debug.wat index 097d8acc99..40be808299 100644 --- a/tests/compiler/optional-typeparameters.debug.wat +++ b/tests/compiler/optional-typeparameters.debug.wat @@ -1036,6 +1036,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/optional-typeparameters.release.wat b/tests/compiler/optional-typeparameters.release.wat index f6138f81b7..8ed9b7e499 100644 --- a/tests/compiler/optional-typeparameters.release.wat +++ b/tests/compiler/optional-typeparameters.release.wat @@ -639,9 +639,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/reexport.debug.wat b/tests/compiler/reexport.debug.wat index d7ce6546cf..e038e8ea57 100644 --- a/tests/compiler/reexport.debug.wat +++ b/tests/compiler/reexport.debug.wat @@ -1070,6 +1070,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/reexport.release.wat b/tests/compiler/reexport.release.wat index 96e3e9f5d5..d6091d1ac5 100644 --- a/tests/compiler/reexport.release.wat +++ b/tests/compiler/reexport.release.wat @@ -646,9 +646,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rereexport.debug.wat b/tests/compiler/rereexport.debug.wat index a75174e783..d2742f5251 100644 --- a/tests/compiler/rereexport.debug.wat +++ b/tests/compiler/rereexport.debug.wat @@ -1063,6 +1063,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/rereexport.release.wat b/tests/compiler/rereexport.release.wat index c4eb86455e..f02fc42b88 100644 --- a/tests/compiler/rereexport.release.wat +++ b/tests/compiler/rereexport.release.wat @@ -644,9 +644,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/resolve-access.debug.wat b/tests/compiler/resolve-access.debug.wat index 91ba75d1c2..994159c4f5 100644 --- a/tests/compiler/resolve-access.debug.wat +++ b/tests/compiler/resolve-access.debug.wat @@ -1044,6 +1044,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-access.release.wat b/tests/compiler/resolve-access.release.wat index 77d2aa64be..b17de4fab5 100644 --- a/tests/compiler/resolve-access.release.wat +++ b/tests/compiler/resolve-access.release.wat @@ -634,9 +634,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/resolve-binary.debug.wat b/tests/compiler/resolve-binary.debug.wat index a22a00efc1..8cef9d7888 100644 --- a/tests/compiler/resolve-binary.debug.wat +++ b/tests/compiler/resolve-binary.debug.wat @@ -1264,6 +1264,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-binary.release.wat b/tests/compiler/resolve-binary.release.wat index 0932a96a49..0835b4cfb4 100644 --- a/tests/compiler/resolve-binary.release.wat +++ b/tests/compiler/resolve-binary.release.wat @@ -843,9 +843,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1744 diff --git a/tests/compiler/resolve-elementaccess.debug.wat b/tests/compiler/resolve-elementaccess.debug.wat index 3e4c403ab9..a5ce7426ab 100644 --- a/tests/compiler/resolve-elementaccess.debug.wat +++ b/tests/compiler/resolve-elementaccess.debug.wat @@ -1067,6 +1067,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-elementaccess.release.wat b/tests/compiler/resolve-elementaccess.release.wat index 9134de7305..8c569dfc68 100644 --- a/tests/compiler/resolve-elementaccess.release.wat +++ b/tests/compiler/resolve-elementaccess.release.wat @@ -686,9 +686,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/resolve-function-expression.debug.wat b/tests/compiler/resolve-function-expression.debug.wat index 6f69ba9536..82683c31a3 100644 --- a/tests/compiler/resolve-function-expression.debug.wat +++ b/tests/compiler/resolve-function-expression.debug.wat @@ -1111,6 +1111,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-function-expression.release.wat b/tests/compiler/resolve-function-expression.release.wat index 51d67b82c2..01dcc2860b 100644 --- a/tests/compiler/resolve-function-expression.release.wat +++ b/tests/compiler/resolve-function-expression.release.wat @@ -654,9 +654,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1792 diff --git a/tests/compiler/resolve-new.debug.wat b/tests/compiler/resolve-new.debug.wat index 9eda71d034..867908c1a7 100644 --- a/tests/compiler/resolve-new.debug.wat +++ b/tests/compiler/resolve-new.debug.wat @@ -1024,6 +1024,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-new.release.wat b/tests/compiler/resolve-new.release.wat index 034458d330..33dc3e6c0c 100644 --- a/tests/compiler/resolve-new.release.wat +++ b/tests/compiler/resolve-new.release.wat @@ -618,9 +618,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/resolve-propertyaccess.debug.wat b/tests/compiler/resolve-propertyaccess.debug.wat index 9cc6d4635d..86bd4819cc 100644 --- a/tests/compiler/resolve-propertyaccess.debug.wat +++ b/tests/compiler/resolve-propertyaccess.debug.wat @@ -1111,6 +1111,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-propertyaccess.release.wat b/tests/compiler/resolve-propertyaccess.release.wat index 5b4de87cd2..d3d380ac1c 100644 --- a/tests/compiler/resolve-propertyaccess.release.wat +++ b/tests/compiler/resolve-propertyaccess.release.wat @@ -653,9 +653,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/resolve-ternary.debug.wat b/tests/compiler/resolve-ternary.debug.wat index d87cb1bb36..c26d7579c0 100644 --- a/tests/compiler/resolve-ternary.debug.wat +++ b/tests/compiler/resolve-ternary.debug.wat @@ -1118,6 +1118,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-ternary.release.wat b/tests/compiler/resolve-ternary.release.wat index 45c76465da..6e4587a7d2 100644 --- a/tests/compiler/resolve-ternary.release.wat +++ b/tests/compiler/resolve-ternary.release.wat @@ -658,9 +658,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/resolve-unary.debug.wat b/tests/compiler/resolve-unary.debug.wat index 0e9e365700..0c320f6ec8 100644 --- a/tests/compiler/resolve-unary.debug.wat +++ b/tests/compiler/resolve-unary.debug.wat @@ -1111,6 +1111,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/resolve-unary.release.wat b/tests/compiler/resolve-unary.release.wat index deb8c2ad5e..e79a5049af 100644 --- a/tests/compiler/resolve-unary.release.wat +++ b/tests/compiler/resolve-unary.release.wat @@ -679,9 +679,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/return-unreachable.debug.wat b/tests/compiler/return-unreachable.debug.wat index 36a3e60ed0..484ee54a4b 100644 --- a/tests/compiler/return-unreachable.debug.wat +++ b/tests/compiler/return-unreachable.debug.wat @@ -1027,6 +1027,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/return-unreachable.release.wat b/tests/compiler/return-unreachable.release.wat index 2aa1b0654c..556e651b83 100644 --- a/tests/compiler/return-unreachable.release.wat +++ b/tests/compiler/return-unreachable.release.wat @@ -619,9 +619,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1488 diff --git a/tests/compiler/rt/finalize.debug.wat b/tests/compiler/rt/finalize.debug.wat index 3120ff98cd..b84bbcd2b7 100644 --- a/tests/compiler/rt/finalize.debug.wat +++ b/tests/compiler/rt/finalize.debug.wat @@ -1043,6 +1043,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/rt/finalize.release.wat b/tests/compiler/rt/finalize.release.wat index 57655f0663..1421fd86cf 100644 --- a/tests/compiler/rt/finalize.release.wat +++ b/tests/compiler/rt/finalize.release.wat @@ -616,9 +616,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rt/runtime-incremental-export.debug.wat b/tests/compiler/rt/runtime-incremental-export.debug.wat index 50847867ba..19aebb2f07 100644 --- a/tests/compiler/rt/runtime-incremental-export.debug.wat +++ b/tests/compiler/rt/runtime-incremental-export.debug.wat @@ -1030,6 +1030,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/rt/runtime-incremental-export.release.wat b/tests/compiler/rt/runtime-incremental-export.release.wat index e5173b207f..9effd21443 100644 --- a/tests/compiler/rt/runtime-incremental-export.release.wat +++ b/tests/compiler/rt/runtime-incremental-export.release.wat @@ -628,9 +628,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/rt/runtime-minimal-export.debug.wat b/tests/compiler/rt/runtime-minimal-export.debug.wat index d3a1d72a38..08a64fb2bc 100644 --- a/tests/compiler/rt/runtime-minimal-export.debug.wat +++ b/tests/compiler/rt/runtime-minimal-export.debug.wat @@ -686,6 +686,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/rt/runtime-minimal-export.release.wat b/tests/compiler/rt/runtime-minimal-export.release.wat index 6fc83cd5ae..1d2a716de4 100644 --- a/tests/compiler/rt/runtime-minimal-export.release.wat +++ b/tests/compiler/rt/runtime-minimal-export.release.wat @@ -435,9 +435,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1184 diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index d87774a37c..bac19bf5fc 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -1062,6 +1062,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index 780bde5cc6..da7e4d3194 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -644,9 +644,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/std/array-literal.debug.wat b/tests/compiler/std/array-literal.debug.wat index 2874205105..b736993aa7 100644 --- a/tests/compiler/std/array-literal.debug.wat +++ b/tests/compiler/std/array-literal.debug.wat @@ -1058,6 +1058,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/array-literal.release.wat b/tests/compiler/std/array-literal.release.wat index f62ec51b13..accd1042fe 100644 --- a/tests/compiler/std/array-literal.release.wat +++ b/tests/compiler/std/array-literal.release.wat @@ -673,9 +673,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1744 diff --git a/tests/compiler/std/array.debug.wat b/tests/compiler/std/array.debug.wat index 7242a92bad..7fcab89607 100644 --- a/tests/compiler/std/array.debug.wat +++ b/tests/compiler/std/array.debug.wat @@ -1367,6 +1367,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/array.release.wat b/tests/compiler/std/array.release.wat index 953facc96e..b9876c8850 100644 --- a/tests/compiler/std/array.release.wat +++ b/tests/compiler/std/array.release.wat @@ -1268,9 +1268,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1488 diff --git a/tests/compiler/std/arraybuffer.debug.wat b/tests/compiler/std/arraybuffer.debug.wat index 4fce3f16bc..abc218b660 100644 --- a/tests/compiler/std/arraybuffer.debug.wat +++ b/tests/compiler/std/arraybuffer.debug.wat @@ -1031,6 +1031,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/arraybuffer.release.wat b/tests/compiler/std/arraybuffer.release.wat index 5f1be1403b..22c7fa7b92 100644 --- a/tests/compiler/std/arraybuffer.release.wat +++ b/tests/compiler/std/arraybuffer.release.wat @@ -625,9 +625,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/dataview.debug.wat b/tests/compiler/std/dataview.debug.wat index 1d7d0e450c..3b19178e5e 100644 --- a/tests/compiler/std/dataview.debug.wat +++ b/tests/compiler/std/dataview.debug.wat @@ -1037,6 +1037,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/dataview.release.wat b/tests/compiler/std/dataview.release.wat index cc738af467..5707da84a2 100644 --- a/tests/compiler/std/dataview.release.wat +++ b/tests/compiler/std/dataview.release.wat @@ -632,9 +632,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/date.debug.wat b/tests/compiler/std/date.debug.wat index 95caccfcbf..24edf3b56e 100644 --- a/tests/compiler/std/date.debug.wat +++ b/tests/compiler/std/date.debug.wat @@ -1415,6 +1415,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/date.release.wat b/tests/compiler/std/date.release.wat index 71dfd66635..294fdcc7bd 100644 --- a/tests/compiler/std/date.release.wat +++ b/tests/compiler/std/date.release.wat @@ -998,9 +998,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1536 diff --git a/tests/compiler/std/map.debug.wat b/tests/compiler/std/map.debug.wat index 5f8c1cb164..c706959ea1 100644 --- a/tests/compiler/std/map.debug.wat +++ b/tests/compiler/std/map.debug.wat @@ -1054,6 +1054,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/map.release.wat b/tests/compiler/std/map.release.wat index 93d398cae5..ed39c0634d 100644 --- a/tests/compiler/std/map.release.wat +++ b/tests/compiler/std/map.release.wat @@ -645,9 +645,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/new.debug.wat b/tests/compiler/std/new.debug.wat index ed1ac9c7ad..86a580cb1f 100644 --- a/tests/compiler/std/new.debug.wat +++ b/tests/compiler/std/new.debug.wat @@ -1041,6 +1041,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/new.release.wat b/tests/compiler/std/new.release.wat index 5570b1aec5..3001001489 100644 --- a/tests/compiler/std/new.release.wat +++ b/tests/compiler/std/new.release.wat @@ -618,9 +618,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index 447b7a7649..ef54d3cd4e 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -1096,6 +1096,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/operator-overloading.release.wat b/tests/compiler/std/operator-overloading.release.wat index 530113f4cc..8190cc2223 100644 --- a/tests/compiler/std/operator-overloading.release.wat +++ b/tests/compiler/std/operator-overloading.release.wat @@ -550,9 +550,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/set.debug.wat b/tests/compiler/std/set.debug.wat index 3bb3a490ec..0f609905e1 100644 --- a/tests/compiler/std/set.debug.wat +++ b/tests/compiler/std/set.debug.wat @@ -1049,6 +1049,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/set.release.wat b/tests/compiler/std/set.release.wat index d46d1adb80..98aecb4643 100644 --- a/tests/compiler/std/set.release.wat +++ b/tests/compiler/std/set.release.wat @@ -636,9 +636,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/static-array.debug.wat b/tests/compiler/std/static-array.debug.wat index 139a8a5582..8cd10c67ad 100644 --- a/tests/compiler/std/static-array.debug.wat +++ b/tests/compiler/std/static-array.debug.wat @@ -1066,6 +1066,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/static-array.release.wat b/tests/compiler/std/static-array.release.wat index f23b702535..a3d44e9573 100644 --- a/tests/compiler/std/static-array.release.wat +++ b/tests/compiler/std/static-array.release.wat @@ -648,9 +648,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1904 diff --git a/tests/compiler/std/staticarray.debug.wat b/tests/compiler/std/staticarray.debug.wat index f29bd7de23..cc9e272749 100644 --- a/tests/compiler/std/staticarray.debug.wat +++ b/tests/compiler/std/staticarray.debug.wat @@ -1126,6 +1126,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/staticarray.release.wat b/tests/compiler/std/staticarray.release.wat index a8a47548df..65af6fcbe3 100644 --- a/tests/compiler/std/staticarray.release.wat +++ b/tests/compiler/std/staticarray.release.wat @@ -761,9 +761,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/std/string-casemapping.debug.wat b/tests/compiler/std/string-casemapping.debug.wat index 66fdb1b674..90ae9edfd0 100644 --- a/tests/compiler/std/string-casemapping.debug.wat +++ b/tests/compiler/std/string-casemapping.debug.wat @@ -1218,6 +1218,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/string-casemapping.release.wat b/tests/compiler/std/string-casemapping.release.wat index 3ec9b038f1..d296aa00f9 100644 --- a/tests/compiler/std/string-casemapping.release.wat +++ b/tests/compiler/std/string-casemapping.release.wat @@ -1066,9 +1066,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/std/string-encoding.debug.wat b/tests/compiler/std/string-encoding.debug.wat index 126e2da10d..7ed6df3291 100644 --- a/tests/compiler/std/string-encoding.debug.wat +++ b/tests/compiler/std/string-encoding.debug.wat @@ -1056,6 +1056,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/string-encoding.release.wat b/tests/compiler/std/string-encoding.release.wat index afdc7fb2ff..1c6215ae19 100644 --- a/tests/compiler/std/string-encoding.release.wat +++ b/tests/compiler/std/string-encoding.release.wat @@ -654,9 +654,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1488 diff --git a/tests/compiler/std/string.debug.wat b/tests/compiler/std/string.debug.wat index 48917acc15..1d6aae6937 100644 --- a/tests/compiler/std/string.debug.wat +++ b/tests/compiler/std/string.debug.wat @@ -1647,6 +1647,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/string.release.wat b/tests/compiler/std/string.release.wat index 431fe8fa42..0726dc2849 100644 --- a/tests/compiler/std/string.release.wat +++ b/tests/compiler/std/string.release.wat @@ -1645,9 +1645,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1648 diff --git a/tests/compiler/std/symbol.debug.wat b/tests/compiler/std/symbol.debug.wat index 8f56d78a6d..5ebbdf6fa4 100644 --- a/tests/compiler/std/symbol.debug.wat +++ b/tests/compiler/std/symbol.debug.wat @@ -1085,6 +1085,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/symbol.release.wat b/tests/compiler/std/symbol.release.wat index e2fca67e1c..b79779652b 100644 --- a/tests/compiler/std/symbol.release.wat +++ b/tests/compiler/std/symbol.release.wat @@ -716,9 +716,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1472 diff --git a/tests/compiler/std/typedarray.debug.wat b/tests/compiler/std/typedarray.debug.wat index f3a666fa2f..bc5e36428e 100644 --- a/tests/compiler/std/typedarray.debug.wat +++ b/tests/compiler/std/typedarray.debug.wat @@ -1394,6 +1394,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/typedarray.release.wat b/tests/compiler/std/typedarray.release.wat index 6af4e94d3e..32229e77fc 100644 --- a/tests/compiler/std/typedarray.release.wat +++ b/tests/compiler/std/typedarray.release.wat @@ -1278,9 +1278,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/uri.debug.wat b/tests/compiler/std/uri.debug.wat index 9ca1e4f80d..6d8952cba8 100644 --- a/tests/compiler/std/uri.debug.wat +++ b/tests/compiler/std/uri.debug.wat @@ -1099,6 +1099,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/std/uri.release.wat b/tests/compiler/std/uri.release.wat index 6e74491090..1eb030c2ff 100644 --- a/tests/compiler/std/uri.release.wat +++ b/tests/compiler/std/uri.release.wat @@ -734,9 +734,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1520 diff --git a/tests/compiler/super-inline.debug.wat b/tests/compiler/super-inline.debug.wat index 4f10edf7b0..ea15d504a7 100644 --- a/tests/compiler/super-inline.debug.wat +++ b/tests/compiler/super-inline.debug.wat @@ -1025,6 +1025,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/super-inline.release.wat b/tests/compiler/super-inline.release.wat index 0339c1195a..10e908df64 100644 --- a/tests/compiler/super-inline.release.wat +++ b/tests/compiler/super-inline.release.wat @@ -625,9 +625,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/templateliteral.debug.wat b/tests/compiler/templateliteral.debug.wat index d9cb714f0a..dd65372618 100644 --- a/tests/compiler/templateliteral.debug.wat +++ b/tests/compiler/templateliteral.debug.wat @@ -1205,6 +1205,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/templateliteral.release.wat b/tests/compiler/templateliteral.release.wat index e4f2f461ef..209c431e5b 100644 --- a/tests/compiler/templateliteral.release.wat +++ b/tests/compiler/templateliteral.release.wat @@ -713,9 +713,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1552 diff --git a/tests/compiler/throw.debug.wat b/tests/compiler/throw.debug.wat index 34e785c62f..45688f81a9 100644 --- a/tests/compiler/throw.debug.wat +++ b/tests/compiler/throw.debug.wat @@ -1137,6 +1137,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/throw.release.wat b/tests/compiler/throw.release.wat index b2716bd1b3..862246bd8c 100644 --- a/tests/compiler/throw.release.wat +++ b/tests/compiler/throw.release.wat @@ -786,19 +786,19 @@ return end global.get $~lib/rt/itcms/iter - local.tee $0 + local.tee $1 global.get $~lib/rt/itcms/toSpace i32.ne if - local.get $0 + local.get $1 i32.load $0 offset=4 - local.tee $2 + local.tee $3 i32.const -4 i32.and global.set $~lib/rt/itcms/iter global.get $~lib/rt/itcms/white i32.eqz - local.get $2 + local.get $3 i32.const 3 i32.and i32.ne @@ -810,19 +810,19 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 34516 i32.lt_u if - local.get $0 + local.get $1 i32.const 0 i32.store $0 offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store $0 offset=8 else global.get $~lib/rt/itcms/total - local.get $0 + local.get $1 i32.load $0 i32.const -4 i32.and @@ -830,10 +830,10 @@ i32.add i32.sub global.set $~lib/rt/itcms/total - local.get $0 + local.get $1 i32.const 4 i32.add - local.tee $2 + local.tee $3 i32.const 34516 i32.ge_u if @@ -841,12 +841,12 @@ i32.eqz if memory.size $0 - local.tee $0 + local.tee $1 i32.const 0 i32.le_s if (result i32) i32.const 1 - local.get $0 + local.get $1 i32.sub memory.grow $0 i32.const 0 @@ -864,11 +864,11 @@ i32.const 0 i32.store $0 loop $for-loop|0 - local.get $1 + local.get $0 i32.const 23 i32.lt_u if - local.get $1 + local.get $0 i32.const 2 i32.shl i32.const 34528 @@ -876,16 +876,16 @@ i32.const 0 i32.store $0 offset=4 i32.const 0 - local.set $0 + local.set $1 loop $for-loop|1 - local.get $0 + local.get $1 i32.const 16 i32.lt_u if - local.get $1 + local.get $0 i32.const 4 i32.shl - local.get $0 + local.get $1 i32.add i32.const 2 i32.shl @@ -893,26 +893,30 @@ i32.add i32.const 0 i32.store $0 offset=96 - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|1 end end - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|0 end end memory.size $0 i32.const 16 i32.shl - local.tee $3 + local.tee $0 + i32.eqz + local.get $0 i32.const 36100 - i32.lt_u + i32.ge_u + i32.or + i32.eqz if i32.const 0 i32.const 1632 @@ -921,8 +925,9 @@ call $~lib/builtins/abort unreachable end - i32.const 36108 - local.set $1 + local.get $0 + i32.const -16 + i32.and i32.const 36096 i32.load $0 local.tee $0 @@ -944,57 +949,53 @@ i32.const 36092 i32.eq if (result i32) - i32.const 36092 - local.set $1 local.get $0 i32.load $0 + local.set $2 + i32.const 36092 else - i32.const 0 + i32.const 36108 end else - i32.const 0 + i32.const 36108 end - local.set $0 - local.get $3 - i32.const -16 - i32.and - local.get $1 + local.tee $0 i32.sub - local.tee $3 + local.tee $1 i32.const 20 i32.ge_u if - local.get $1 local.get $0 + local.get $2 i32.const 2 i32.and - local.get $3 + local.get $1 i32.const 8 i32.sub - local.tee $0 + local.tee $1 i32.const 1 i32.or i32.or i32.store $0 - local.get $1 + local.get $0 i32.const 0 i32.store $0 offset=4 - local.get $1 + local.get $0 i32.const 0 i32.store $0 offset=8 - local.get $1 + local.get $0 i32.const 4 i32.add - local.get $0 + local.get $1 i32.add - local.tee $0 + local.tee $1 i32.const 2 i32.store $0 i32.const 36096 - local.get $0 + local.get $1 i32.store $0 i32.const 34528 - local.get $1 + local.get $0 call $~lib/rt/tlsf/insertBlock end i32.const 34528 @@ -1002,15 +1003,15 @@ end global.get $~lib/rt/tlsf/ROOT local.set $0 - local.get $2 + local.get $3 i32.const 4 i32.sub local.set $1 - local.get $2 + local.get $3 i32.const 15 i32.and i32.const 1 - local.get $2 + local.get $3 select if (result i32) i32.const 1 diff --git a/tests/compiler/typeof.debug.wat b/tests/compiler/typeof.debug.wat index 9efabbef50..69c0f89ca3 100644 --- a/tests/compiler/typeof.debug.wat +++ b/tests/compiler/typeof.debug.wat @@ -1164,6 +1164,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/typeof.release.wat b/tests/compiler/typeof.release.wat index 1cd89f4638..0e12ebbd4b 100644 --- a/tests/compiler/typeof.release.wat +++ b/tests/compiler/typeof.release.wat @@ -641,9 +641,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1696 diff --git a/tests/compiler/while.debug.wat b/tests/compiler/while.debug.wat index d286cbe269..627f78ab66 100644 --- a/tests/compiler/while.debug.wat +++ b/tests/compiler/while.debug.wat @@ -1447,6 +1447,13 @@ local.get $start local.get $end i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end i32.eqz if i32.const 0 diff --git a/tests/compiler/while.release.wat b/tests/compiler/while.release.wat index 3b27da0ae7..93203cc24a 100644 --- a/tests/compiler/while.release.wat +++ b/tests/compiler/while.release.wat @@ -613,9 +613,13 @@ (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + local.get $2 + i32.eqz local.get $1 local.get $2 - i32.gt_u + i32.le_u + i32.or + i32.eqz if i32.const 0 i32.const 1440 From 0dbf650e4f0cbdaefcf0c7151f39df33e31bcc62 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 16 Feb 2023 22:46:22 +0800 Subject: [PATCH 3/4] add testcase --- .../compiler/rt/alloc-large-memory.debug.wat | 1539 +++++++++++++++++ tests/compiler/rt/alloc-large-memory.json | 3 + .../rt/alloc-large-memory.release.wat | 959 ++++++++++ tests/compiler/rt/alloc-large-memory.ts | 7 + 4 files changed, 2508 insertions(+) create mode 100644 tests/compiler/rt/alloc-large-memory.debug.wat create mode 100644 tests/compiler/rt/alloc-large-memory.json create mode 100644 tests/compiler/rt/alloc-large-memory.release.wat create mode 100644 tests/compiler/rt/alloc-large-memory.ts diff --git a/tests/compiler/rt/alloc-large-memory.debug.wat b/tests/compiler/rt/alloc-large-memory.debug.wat new file mode 100644 index 0000000000..b21bddbf59 --- /dev/null +++ b/tests/compiler/rt/alloc-large-memory.debug.wat @@ -0,0 +1,1539 @@ +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) + (global $~lib/memory/__data_end i32 (i32.const 140)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 32908)) + (global $~lib/memory/__heap_base i32 (i32.const 32908)) + (memory $0 1) + (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") + (table $0 1 1 funcref) + (elem $0 (i32.const 1)) + (export "memory" (memory $0)) + (start $~start) + (func $~lib/rt/tlsf/Root#set:flMap (param $this i32) (param $flMap i32) + local.get $this + local.get $flMap + i32.store $0 + ) + (func $~lib/rt/common/BLOCK#get:mmInfo (param $this i32) (result i32) + local.get $this + i32.load $0 + ) + (func $~lib/rt/common/BLOCK#set:mmInfo (param $this i32) (param $mmInfo i32) + local.get $this + local.get $mmInfo + i32.store $0 + ) + (func $~lib/rt/tlsf/Block#set:prev (param $this i32) (param $prev i32) + local.get $this + local.get $prev + i32.store $0 offset=4 + ) + (func $~lib/rt/tlsf/Block#set:next (param $this i32) (param $next i32) + local.get $this + local.get $next + i32.store $0 offset=8 + ) + (func $~lib/rt/tlsf/Block#get:prev (param $this i32) (result i32) + local.get $this + i32.load $0 offset=4 + ) + (func $~lib/rt/tlsf/Block#get:next (param $this i32) (result i32) + local.get $this + i32.load $0 offset=8 + ) + (func $~lib/rt/tlsf/Root#get:flMap (param $this i32) (result i32) + local.get $this + i32.load $0 + ) + (func $~lib/rt/tlsf/removeBlock (param $root i32) (param $block i32) + (local $blockInfo i32) + (local $size i32) + (local $fl i32) + (local $sl i32) + (local $6 i32) + (local $7 i32) + (local $boundedSize i32) + (local $prev i32) + (local $next i32) + (local $root|11 i32) + (local $fl|12 i32) + (local $sl|13 i32) + (local $root|14 i32) + (local $fl|15 i32) + (local $sl|16 i32) + (local $head i32) + (local $root|18 i32) + (local $fl|19 i32) + (local $slMap i32) + (local $root|21 i32) + (local $fl|22 i32) + (local $slMap|23 i32) + local.get $block + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $blockInfo + i32.const 1 + drop + local.get $blockInfo + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 268 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $blockInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $size + i32.const 1 + drop + local.get $size + i32.const 12 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 270 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $size + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $fl + local.get $size + i32.const 4 + i32.shr_u + local.set $sl + else + local.get $size + local.tee $6 + i32.const 1073741820 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_u + select + local.set $boundedSize + i32.const 31 + local.get $boundedSize + i32.clz + i32.sub + local.set $fl + local.get $boundedSize + local.get $fl + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $sl + local.get $fl + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $fl + end + i32.const 1 + drop + local.get $fl + i32.const 23 + i32.lt_u + if (result i32) + local.get $sl + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 284 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $block + call $~lib/rt/tlsf/Block#get:prev + local.set $prev + local.get $block + call $~lib/rt/tlsf/Block#get:next + local.set $next + local.get $prev + if + local.get $prev + local.get $next + call $~lib/rt/tlsf/Block#set:next + end + local.get $next + if + local.get $next + local.get $prev + call $~lib/rt/tlsf/Block#set:prev + end + local.get $block + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $root + local.set $root|11 + local.get $fl + local.set $fl|12 + local.get $sl + local.set $sl|13 + local.get $root|11 + local.get $fl|12 + i32.const 4 + i32.shl + local.get $sl|13 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + br $~lib/rt/tlsf/GETHEAD|inlined.0 + end + i32.eq + if + local.get $root + local.set $root|14 + local.get $fl + local.set $fl|15 + local.get $sl + local.set $sl|16 + local.get $next + local.set $head + local.get $root|14 + local.get $fl|15 + i32.const 4 + i32.shl + local.get $sl|16 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $head + i32.store $0 offset=96 + local.get $next + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $root + local.set $root|18 + local.get $fl + local.set $fl|19 + local.get $root|18 + local.get $fl|19 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + br $~lib/rt/tlsf/GETSL|inlined.0 + end + local.set $slMap + local.get $root + local.set $root|21 + local.get $fl + local.set $fl|22 + local.get $slMap + i32.const 1 + local.get $sl + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $slMap + local.set $slMap|23 + local.get $root|21 + local.get $fl|22 + i32.const 2 + i32.shl + i32.add + local.get $slMap|23 + i32.store $0 offset=4 + local.get $slMap + i32.eqz + if + local.get $root + local.get $root + call $~lib/rt/tlsf/Root#get:flMap + i32.const 1 + local.get $fl + i32.shl + i32.const -1 + i32.xor + i32.and + call $~lib/rt/tlsf/Root#set:flMap + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (param $root i32) (param $block i32) + (local $blockInfo i32) + (local $block|3 i32) + (local $right i32) + (local $rightInfo i32) + (local $block|6 i32) + (local $block|7 i32) + (local $left i32) + (local $leftInfo i32) + (local $size i32) + (local $fl i32) + (local $sl i32) + (local $13 i32) + (local $14 i32) + (local $boundedSize i32) + (local $root|16 i32) + (local $fl|17 i32) + (local $sl|18 i32) + (local $head i32) + (local $root|20 i32) + (local $fl|21 i32) + (local $sl|22 i32) + (local $head|23 i32) + (local $root|24 i32) + (local $fl|25 i32) + (local $root|26 i32) + (local $fl|27 i32) + (local $slMap i32) + i32.const 1 + drop + local.get $block + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 201 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $block + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $blockInfo + i32.const 1 + drop + local.get $blockInfo + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 203 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $block + local.set $block|3 + local.get $block|3 + i32.const 4 + i32.add + local.get $block|3 + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + br $~lib/rt/tlsf/GETRIGHT|inlined.0 + end + local.set $right + local.get $right + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $rightInfo + local.get $rightInfo + i32.const 1 + i32.and + if + local.get $root + local.get $right + call $~lib/rt/tlsf/removeBlock + local.get $block + local.get $blockInfo + i32.const 4 + i32.add + local.get $rightInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.tee $blockInfo + call $~lib/rt/common/BLOCK#set:mmInfo + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $block + local.set $block|6 + local.get $block|6 + i32.const 4 + i32.add + local.get $block|6 + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + br $~lib/rt/tlsf/GETRIGHT|inlined.1 + end + local.set $right + local.get $right + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $rightInfo + end + local.get $blockInfo + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $block + local.set $block|7 + local.get $block|7 + i32.const 4 + i32.sub + i32.load $0 + br $~lib/rt/tlsf/GETFREELEFT|inlined.0 + end + local.set $left + local.get $left + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $leftInfo + i32.const 1 + drop + local.get $leftInfo + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 221 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.get $left + call $~lib/rt/tlsf/removeBlock + local.get $left + local.set $block + local.get $block + local.get $leftInfo + i32.const 4 + i32.add + local.get $blockInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.tee $blockInfo + call $~lib/rt/common/BLOCK#set:mmInfo + end + local.get $right + local.get $rightInfo + i32.const 2 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $blockInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $size + i32.const 1 + drop + local.get $size + i32.const 12 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 233 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + drop + local.get $block + i32.const 4 + i32.add + local.get $size + i32.add + local.get $right + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 234 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $right + i32.const 4 + i32.sub + local.get $block + i32.store $0 + local.get $size + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $fl + local.get $size + i32.const 4 + i32.shr_u + local.set $sl + else + local.get $size + local.tee $13 + i32.const 1073741820 + local.tee $14 + local.get $13 + local.get $14 + i32.lt_u + select + local.set $boundedSize + i32.const 31 + local.get $boundedSize + i32.clz + i32.sub + local.set $fl + local.get $boundedSize + local.get $fl + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $sl + local.get $fl + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $fl + end + i32.const 1 + drop + local.get $fl + i32.const 23 + i32.lt_u + if (result i32) + local.get $sl + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 251 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $root + local.set $root|16 + local.get $fl + local.set $fl|17 + local.get $sl + local.set $sl|18 + local.get $root|16 + local.get $fl|17 + i32.const 4 + i32.shl + local.get $sl|18 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + br $~lib/rt/tlsf/GETHEAD|inlined.1 + end + local.set $head + local.get $block + i32.const 0 + call $~lib/rt/tlsf/Block#set:prev + local.get $block + local.get $head + call $~lib/rt/tlsf/Block#set:next + local.get $head + if + local.get $head + local.get $block + call $~lib/rt/tlsf/Block#set:prev + end + local.get $root + local.set $root|20 + local.get $fl + local.set $fl|21 + local.get $sl + local.set $sl|22 + local.get $block + local.set $head|23 + local.get $root|20 + local.get $fl|21 + i32.const 4 + i32.shl + local.get $sl|22 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $head|23 + i32.store $0 offset=96 + local.get $root + local.get $root + call $~lib/rt/tlsf/Root#get:flMap + i32.const 1 + local.get $fl + i32.shl + i32.or + call $~lib/rt/tlsf/Root#set:flMap + local.get $root + local.set $root|26 + local.get $fl + local.set $fl|27 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $root + local.set $root|24 + local.get $fl + local.set $fl|25 + local.get $root|24 + local.get $fl|25 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + br $~lib/rt/tlsf/GETSL|inlined.1 + end + i32.const 1 + local.get $sl + i32.shl + i32.or + local.set $slMap + local.get $root|26 + local.get $fl|27 + i32.const 2 + i32.shl + i32.add + local.get $slMap + i32.store $0 offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) + (local $root|3 i32) + (local $tail i32) + (local $tailInfo i32) + (local $size i32) + (local $leftSize i32) + (local $left i32) + (local $root|9 i32) + (local $tail|10 i32) + i32.const 1 + drop + local.get $start + local.get $end + i32.le_u + if (result i32) + i32.const 1 + else + local.get $end + i32.const 0 + i32.eq + end + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 377 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $start + i32.const 4 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + i32.const 4 + i32.sub + local.set $start + local.get $end + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $root + local.set $root|3 + local.get $root|3 + i32.load $0 offset=1568 + br $~lib/rt/tlsf/GETTAIL|inlined.0 + end + local.set $tail + i32.const 0 + local.set $tailInfo + local.get $tail + if + i32.const 1 + drop + local.get $start + local.get $tail + i32.const 4 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 384 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $start + i32.const 16 + i32.sub + local.get $tail + i32.eq + if + local.get $start + i32.const 16 + i32.sub + local.set $start + local.get $tail + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $tailInfo + else + nop + end + else + i32.const 1 + drop + local.get $start + local.get $root + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 397 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $end + local.get $start + i32.sub + local.set $size + local.get $size + i32.const 4 + i32.const 12 + i32.add + i32.const 4 + i32.add + i32.lt_u + if + i32.const 0 + return + end + local.get $size + i32.const 2 + i32.const 4 + i32.mul + i32.sub + local.set $leftSize + local.get $start + local.set $left + local.get $left + local.get $leftSize + i32.const 1 + i32.or + local.get $tailInfo + i32.const 2 + i32.and + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $left + i32.const 0 + call $~lib/rt/tlsf/Block#set:prev + local.get $left + i32.const 0 + call $~lib/rt/tlsf/Block#set:next + local.get $start + i32.const 4 + i32.add + local.get $leftSize + i32.add + local.set $tail + local.get $tail + i32.const 0 + i32.const 2 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $root + local.set $root|9 + local.get $tail + local.set $tail|10 + local.get $root|9 + local.get $tail|10 + i32.store $0 offset=1568 + local.get $root + local.get $left + call $~lib/rt/tlsf/insertBlock + i32.const 1 + return + ) + (func $~lib/rt/tlsf/initialize + (local $rootOffset i32) + (local $pagesBefore i32) + (local $pagesNeeded i32) + (local $root i32) + (local $root|4 i32) + (local $tail i32) + (local $fl i32) + (local $root|7 i32) + (local $fl|8 i32) + (local $slMap i32) + (local $sl i32) + (local $root|11 i32) + (local $fl|12 i32) + (local $sl|13 i32) + (local $head i32) + (local $memStart i32) + i32.const 0 + drop + global.get $~lib/memory/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $rootOffset + memory.size $0 + local.set $pagesBefore + local.get $rootOffset + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $pagesNeeded + local.get $pagesNeeded + local.get $pagesBefore + i32.gt_s + if (result i32) + local.get $pagesNeeded + local.get $pagesBefore + i32.sub + memory.grow $0 + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $rootOffset + local.set $root + local.get $root + i32.const 0 + call $~lib/rt/tlsf/Root#set:flMap + local.get $root + local.set $root|4 + i32.const 0 + local.set $tail + local.get $root|4 + local.get $tail + i32.store $0 offset=1568 + i32.const 0 + local.set $fl + loop $for-loop|0 + local.get $fl + i32.const 23 + i32.lt_u + if + local.get $root + local.set $root|7 + local.get $fl + local.set $fl|8 + i32.const 0 + local.set $slMap + local.get $root|7 + local.get $fl|8 + i32.const 2 + i32.shl + i32.add + local.get $slMap + i32.store $0 offset=4 + i32.const 0 + local.set $sl + loop $for-loop|1 + local.get $sl + i32.const 16 + i32.lt_u + if + local.get $root + local.set $root|11 + local.get $fl + local.set $fl|12 + local.get $sl + local.set $sl|13 + i32.const 0 + local.set $head + local.get $root|11 + local.get $fl|12 + i32.const 4 + i32.shl + local.get $sl|13 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $head + i32.store $0 offset=96 + local.get $sl + i32.const 1 + i32.add + local.set $sl + br $for-loop|1 + end + end + local.get $fl + i32.const 1 + i32.add + local.set $fl + br $for-loop|0 + end + end + local.get $rootOffset + i32.const 1572 + i32.add + local.set $memStart + i32.const 0 + drop + local.get $root + local.get $memStart + memory.size $0 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $root + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/computeSize (param $size i32) (result i32) + local.get $size + i32.const 12 + i32.le_u + if (result i32) + i32.const 12 + else + local.get $size + i32.const 4 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + i32.const 4 + i32.sub + end + return + ) + (func $~lib/rt/tlsf/prepareSize (param $size i32) (result i32) + local.get $size + i32.const 1073741820 + i32.gt_u + if + i32.const 96 + i32.const 32 + i32.const 458 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $size + call $~lib/rt/tlsf/computeSize + return + ) + (func $~lib/rt/tlsf/searchBlock (param $root i32) (param $size i32) (result i32) + (local $fl i32) + (local $sl i32) + (local $requestSize i32) + (local $root|5 i32) + (local $fl|6 i32) + (local $slMap i32) + (local $head i32) + (local $flMap i32) + (local $root|10 i32) + (local $fl|11 i32) + (local $root|12 i32) + (local $fl|13 i32) + (local $sl|14 i32) + (local $root|15 i32) + (local $fl|16 i32) + (local $sl|17 i32) + local.get $size + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $fl + local.get $size + i32.const 4 + i32.shr_u + local.set $sl + else + local.get $size + i32.const 536870910 + i32.lt_u + if (result i32) + local.get $size + i32.const 1 + i32.const 27 + local.get $size + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $size + end + local.set $requestSize + i32.const 31 + local.get $requestSize + i32.clz + i32.sub + local.set $fl + local.get $requestSize + local.get $fl + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $sl + local.get $fl + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $fl + end + i32.const 1 + drop + local.get $fl + i32.const 23 + i32.lt_u + if (result i32) + local.get $sl + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 330 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $root + local.set $root|5 + local.get $fl + local.set $fl|6 + local.get $root|5 + local.get $fl|6 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + br $~lib/rt/tlsf/GETSL|inlined.2 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $sl + i32.shl + i32.and + local.set $slMap + i32.const 0 + local.set $head + local.get $slMap + i32.eqz + if + local.get $root + call $~lib/rt/tlsf/Root#get:flMap + i32.const 0 + i32.const -1 + i32.xor + local.get $fl + i32.const 1 + i32.add + i32.shl + i32.and + local.set $flMap + local.get $flMap + i32.eqz + if + i32.const 0 + local.set $head + else + local.get $flMap + i32.ctz + local.set $fl + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $root + local.set $root|10 + local.get $fl + local.set $fl|11 + local.get $root|10 + local.get $fl|11 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + br $~lib/rt/tlsf/GETSL|inlined.3 + end + local.set $slMap + i32.const 1 + drop + local.get $slMap + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 343 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $root + local.set $root|12 + local.get $fl + local.set $fl|13 + local.get $slMap + i32.ctz + local.set $sl|14 + local.get $root|12 + local.get $fl|13 + i32.const 4 + i32.shl + local.get $sl|14 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + br $~lib/rt/tlsf/GETHEAD|inlined.2 + end + local.set $head + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $root + local.set $root|15 + local.get $fl + local.set $fl|16 + local.get $slMap + i32.ctz + local.set $sl|17 + local.get $root|15 + local.get $fl|16 + i32.const 4 + i32.shl + local.get $sl|17 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + br $~lib/rt/tlsf/GETHEAD|inlined.3 + end + local.set $head + end + local.get $head + return + ) + (func $~lib/rt/tlsf/growMemory (param $root i32) (param $size i32) + (local $pagesBefore i32) + (local $root|3 i32) + (local $pagesNeeded i32) + (local $5 i32) + (local $6 i32) + (local $pagesWanted i32) + (local $pagesAfter i32) + i32.const 0 + drop + local.get $size + i32.const 536870910 + i32.lt_u + if + local.get $size + i32.const 1 + i32.const 27 + local.get $size + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.set $size + end + memory.size $0 + local.set $pagesBefore + local.get $size + i32.const 4 + local.get $pagesBefore + i32.const 16 + i32.shl + i32.const 4 + i32.sub + block $~lib/rt/tlsf/GETTAIL|inlined.1 (result i32) + local.get $root + local.set $root|3 + local.get $root|3 + i32.load $0 offset=1568 + br $~lib/rt/tlsf/GETTAIL|inlined.1 + end + i32.ne + i32.shl + i32.add + local.set $size + local.get $size + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $pagesNeeded + local.get $pagesBefore + local.tee $5 + local.get $pagesNeeded + local.tee $6 + local.get $5 + local.get $6 + i32.gt_s + select + local.set $pagesWanted + local.get $pagesWanted + memory.grow $0 + i32.const 0 + i32.lt_s + if + local.get $pagesNeeded + memory.grow $0 + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size $0 + local.set $pagesAfter + local.get $root + local.get $pagesBefore + i32.const 16 + i32.shl + local.get $pagesAfter + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (param $root i32) (param $block i32) (param $size i32) + (local $blockInfo i32) + (local $remaining i32) + (local $spare i32) + (local $block|6 i32) + (local $block|7 i32) + local.get $block + call $~lib/rt/common/BLOCK#get:mmInfo + local.set $blockInfo + i32.const 1 + drop + local.get $size + i32.const 4 + i32.add + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 357 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $blockInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $size + i32.sub + local.set $remaining + local.get $remaining + i32.const 4 + i32.const 12 + i32.add + i32.ge_u + if + local.get $block + local.get $size + local.get $blockInfo + i32.const 2 + i32.and + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $block + i32.const 4 + i32.add + local.get $size + i32.add + local.set $spare + local.get $spare + local.get $remaining + i32.const 4 + i32.sub + i32.const 1 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $root + local.get $spare + call $~lib/rt/tlsf/insertBlock + else + local.get $block + local.get $blockInfo + i32.const 1 + i32.const -1 + i32.xor + i32.and + call $~lib/rt/common/BLOCK#set:mmInfo + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $block + local.set $block|7 + local.get $block|7 + i32.const 4 + i32.add + local.get $block|7 + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + br $~lib/rt/tlsf/GETRIGHT|inlined.3 + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $block + local.set $block|6 + local.get $block|6 + i32.const 4 + i32.add + local.get $block|6 + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + br $~lib/rt/tlsf/GETRIGHT|inlined.2 + end + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 2 + i32.const -1 + i32.xor + i32.and + call $~lib/rt/common/BLOCK#set:mmInfo + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $root i32) (param $size i32) (result i32) + (local $payloadSize i32) + (local $block i32) + local.get $size + call $~lib/rt/tlsf/prepareSize + local.set $payloadSize + local.get $root + local.get $payloadSize + call $~lib/rt/tlsf/searchBlock + local.set $block + local.get $block + i32.eqz + if + local.get $root + local.get $payloadSize + call $~lib/rt/tlsf/growMemory + local.get $root + local.get $payloadSize + call $~lib/rt/tlsf/searchBlock + local.set $block + i32.const 1 + drop + local.get $block + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 496 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + end + i32.const 1 + drop + local.get $block + call $~lib/rt/common/BLOCK#get:mmInfo + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $payloadSize + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 498 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.get $block + call $~lib/rt/tlsf/removeBlock + local.get $root + local.get $block + local.get $payloadSize + call $~lib/rt/tlsf/prepareBlock + i32.const 0 + drop + local.get $block + return + ) + (func $~lib/rt/tlsf/__alloc (param $size i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $size + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + return + ) + (func $~lib/memory/heap.alloc (param $size i32) (result i32) + local.get $size + call $~lib/rt/tlsf/__alloc + return + ) + (func $start:rt/alloc-large-memory + (local $i i32) + loop $while-continue|0 + memory.size $0 + i32.const 128 + i32.ne + if + i32.const 32 + i32.const 1024 + i32.mul + call $~lib/memory/heap.alloc + drop + br $while-continue|0 + end + end + i32.const 0 + local.set $i + loop $for-loop|1 + local.get $i + i32.const 32763 + i32.lt_s + if + i32.const 64 + i32.const 1024 + i32.mul + call $~lib/memory/heap.alloc + drop + local.get $i + i32.const 1 + i32.add + local.set $i + br $for-loop|1 + end + end + ) + (func $~start + call $start:rt/alloc-large-memory + ) +) diff --git a/tests/compiler/rt/alloc-large-memory.json b/tests/compiler/rt/alloc-large-memory.json new file mode 100644 index 0000000000..ea57a955e1 --- /dev/null +++ b/tests/compiler/rt/alloc-large-memory.json @@ -0,0 +1,3 @@ +{ + "asc_flags": [] +} diff --git a/tests/compiler/rt/alloc-large-memory.release.wat b/tests/compiler/rt/alloc-large-memory.release.wat new file mode 100644 index 0000000000..d73c209ce4 --- /dev/null +++ b/tests/compiler/rt/alloc-large-memory.release.wat @@ -0,0 +1,959 @@ +(module + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (memory $0 1) + (data (i32.const 1036) "<") + (data (i32.const 1048) "\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 1100) "<") + (data (i32.const 1112) "\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (export "memory" (memory $0)) + (start $~start) + (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load $0 + local.tee $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 268 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const -4 + i32.and + local.tee $2 + i32.const 12 + i32.lt_u + if + i32.const 0 + i32.const 1056 + i32.const 270 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + else + i32.const 31 + i32.const 1073741820 + local.get $2 + local.get $2 + i32.const 1073741820 + i32.ge_u + select + local.tee $2 + i32.clz + i32.sub + local.tee $4 + i32.const 7 + i32.sub + local.set $3 + local.get $2 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + end + local.tee $2 + i32.const 16 + i32.lt_u + local.get $3 + i32.const 23 + i32.lt_u + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 284 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load $0 offset=8 + local.set $5 + local.get $1 + i32.load $0 offset=4 + local.tee $4 + if + local.get $4 + local.get $5 + i32.store $0 offset=8 + end + local.get $5 + if + local.get $5 + local.get $4 + i32.store $0 offset=4 + end + local.get $1 + local.get $0 + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + i32.eq + if + local.get $0 + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store $0 offset=96 + local.get $5 + i32.eqz + if + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.tee $1 + i32.load $0 offset=4 + i32.const -2 + local.get $2 + i32.rotl + i32.and + local.set $2 + local.get $1 + local.get $2 + i32.store $0 offset=4 + local.get $2 + i32.eqz + if + local.get $0 + local.get $0 + i32.load $0 + i32.const -2 + local.get $3 + i32.rotl + i32.and + i32.store $0 + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 201 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load $0 + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 203 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $1 + i32.load $0 + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load $0 + local.tee $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 4 + i32.add + local.get $2 + i32.const -4 + i32.and + i32.add + local.tee $3 + i32.store $0 + local.get $1 + i32.const 4 + i32.add + local.get $1 + i32.load $0 + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load $0 + local.set $2 + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load $0 + local.tee $1 + i32.load $0 + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 221 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $6 + i32.const 4 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $3 + i32.store $0 + end + local.get $4 + local.get $2 + i32.const 2 + i32.or + i32.store $0 + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 12 + i32.lt_u + if + i32.const 0 + i32.const 1056 + i32.const 233 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 4 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 1056 + i32.const 234 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store $0 + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + else + i32.const 31 + i32.const 1073741820 + local.get $2 + local.get $2 + i32.const 1073741820 + i32.ge_u + select + local.tee $2 + i32.clz + i32.sub + local.tee $3 + i32.const 7 + i32.sub + local.set $5 + local.get $2 + local.get $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + end + local.tee $2 + i32.const 16 + i32.lt_u + local.get $5 + i32.const 23 + i32.lt_u + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 251 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $5 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + local.set $3 + local.get $1 + i32.const 0 + i32.store $0 offset=4 + local.get $1 + local.get $3 + i32.store $0 offset=8 + local.get $3 + if + local.get $3 + local.get $1 + i32.store $0 offset=4 + end + local.get $0 + local.get $5 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store $0 offset=96 + local.get $0 + local.get $0 + i32.load $0 + i32.const 1 + local.get $5 + i32.shl + i32.or + i32.store $0 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.tee $0 + local.get $0 + i32.load $0 offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.or + i32.store $0 offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.eqz + local.get $1 + local.get $2 + i32.le_u + i32.or + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 377 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 19 + i32.add + i32.const -16 + i32.and + i32.const 4 + i32.sub + local.set $1 + local.get $0 + i32.load $0 offset=1568 + local.tee $4 + if + local.get $4 + i32.const 4 + i32.add + local.get $1 + i32.gt_u + if + i32.const 0 + i32.const 1056 + i32.const 384 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $4 + i32.load $0 + local.set $3 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $0 + i32.const 1572 + i32.add + local.get $1 + i32.gt_u + if + i32.const 0 + i32.const 1056 + i32.const 397 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.const -16 + i32.and + local.get $1 + i32.sub + local.tee $2 + i32.const 20 + i32.lt_u + if + return + end + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + i32.const 1 + i32.or + i32.or + i32.store $0 + local.get $1 + i32.const 0 + i32.store $0 offset=4 + local.get $1 + i32.const 0 + i32.store $0 offset=8 + local.get $1 + i32.const 4 + i32.add + local.get $2 + i32.add + local.tee $2 + i32.const 2 + i32.store $0 + local.get $0 + local.get $2 + i32.store $0 offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + else + i32.const 31 + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + local.get $1 + local.get $1 + i32.const 536870910 + i32.lt_u + select + local.tee $1 + i32.clz + i32.sub + local.tee $3 + i32.const 7 + i32.sub + local.set $2 + local.get $1 + local.get $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + end + local.tee $1 + i32.const 16 + i32.lt_u + local.get $2 + i32.const 23 + i32.lt_u + i32.and + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 330 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + else + local.get $0 + i32.load $0 + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 343 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load $0 offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/memory/heap.alloc (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + memory.size $0 + local.tee $2 + i32.const 0 + i32.le_s + if (result i32) + i32.const 1 + local.get $2 + i32.sub + memory.grow $0 + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 33936 + i32.const 0 + i32.store $0 + i32.const 35504 + i32.const 0 + i32.store $0 + loop $for-loop|0 + local.get $1 + i32.const 23 + i32.lt_u + if + local.get $1 + i32.const 2 + i32.shl + i32.const 33936 + i32.add + i32.const 0 + i32.store $0 offset=4 + i32.const 0 + local.set $2 + loop $for-loop|1 + local.get $2 + i32.const 16 + i32.lt_u + if + local.get $1 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.const 33936 + i32.add + i32.const 0 + i32.store $0 offset=96 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $for-loop|1 + end + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|0 + end + end + i32.const 33936 + i32.const 35508 + memory.size $0 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 33936 + global.set $~lib/rt/tlsf/ROOT + end + global.get $~lib/rt/tlsf/ROOT + local.set $3 + local.get $0 + i32.const 1073741820 + i32.gt_u + if + i32.const 1120 + i32.const 1056 + i32.const 458 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 12 + local.get $0 + i32.const 19 + i32.add + i32.const -16 + i32.and + i32.const 4 + i32.sub + local.get $0 + i32.const 12 + i32.le_u + select + local.tee $0 + call $~lib/rt/tlsf/searchBlock + local.tee $1 + i32.eqz + if + memory.size $0 + local.tee $1 + i32.const 4 + local.get $3 + i32.load $0 offset=1568 + local.get $1 + i32.const 16 + i32.shl + i32.const 4 + i32.sub + i32.ne + i32.shl + local.get $0 + i32.const 1 + i32.const 27 + local.get $0 + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.get $0 + local.get $0 + i32.const 536870910 + i32.lt_u + select + i32.add + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $2 + local.get $1 + local.get $2 + i32.gt_s + select + memory.grow $0 + i32.const 0 + i32.lt_s + if + local.get $2 + memory.grow $0 + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $3 + local.get $1 + i32.const 16 + i32.shl + memory.size $0 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + local.get $3 + local.get $0 + call $~lib/rt/tlsf/searchBlock + local.tee $1 + i32.eqz + if + i32.const 0 + i32.const 1056 + i32.const 496 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + end + local.get $0 + local.get $1 + i32.load $0 + i32.const -4 + i32.and + i32.gt_u + if + i32.const 0 + i32.const 1056 + i32.const 498 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $1 + call $~lib/rt/tlsf/removeBlock + local.get $1 + i32.load $0 + local.set $2 + local.get $0 + i32.const 4 + i32.add + i32.const 15 + i32.and + if + i32.const 0 + i32.const 1056 + i32.const 357 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const -4 + i32.and + local.get $0 + i32.sub + local.tee $4 + i32.const 16 + i32.ge_u + if + local.get $1 + local.get $0 + local.get $2 + i32.const 2 + i32.and + i32.or + i32.store $0 + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.add + local.tee $0 + local.get $4 + i32.const 4 + i32.sub + i32.const 1 + i32.or + i32.store $0 + local.get $3 + local.get $0 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $2 + i32.const -2 + i32.and + i32.store $0 + local.get $1 + i32.const 4 + i32.add + local.get $1 + i32.load $0 + i32.const -4 + i32.and + i32.add + local.tee $0 + local.get $0 + i32.load $0 + i32.const -3 + i32.and + i32.store $0 + end + ) + (func $~start + (local $0 i32) + loop $while-continue|0 + memory.size $0 + i32.const 128 + i32.ne + if + i32.const 32768 + call $~lib/memory/heap.alloc + br $while-continue|0 + end + end + loop $for-loop|1 + local.get $0 + i32.const 32763 + i32.lt_s + if + i32.const 65536 + call $~lib/memory/heap.alloc + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $for-loop|1 + end + end + ) +) diff --git a/tests/compiler/rt/alloc-large-memory.ts b/tests/compiler/rt/alloc-large-memory.ts new file mode 100644 index 0000000000..60af92d558 --- /dev/null +++ b/tests/compiler/rt/alloc-large-memory.ts @@ -0,0 +1,7 @@ +while (memory.size() != 128) { + heap.alloc(32 * 1024); +} + +for (let i = 0; i < 32763; i++) { + heap.alloc(64 * 1024); +} From c0cdd1d8bde8844bb0816abe435697bef2478acd Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 24 Apr 2023 14:56:17 +0200 Subject: [PATCH 4/4] more strict assert --- std/assembly/rt/tlsf.ts | 11 +- tests/compiler/bindings/esm.debug.js | 6 +- tests/compiler/bindings/esm.debug.wat | 63 +++++----- tests/compiler/bindings/esm.release.js | 8 +- tests/compiler/bindings/esm.release.wat | 50 ++++---- .../bindings/noExportRuntime.debug.wat | 63 +++++----- .../bindings/noExportRuntime.release.wat | 48 ++++---- tests/compiler/bindings/raw.debug.js | 6 +- tests/compiler/bindings/raw.debug.wat | 63 +++++----- tests/compiler/bindings/raw.release.js | 8 +- tests/compiler/bindings/raw.release.wat | 50 ++++---- tests/compiler/call-super.debug.wat | 62 +++++----- tests/compiler/call-super.release.wat | 48 ++++---- tests/compiler/class-implements.debug.wat | 62 +++++----- tests/compiler/class-implements.release.wat | 48 ++++---- .../compiler/class-overloading-cast.debug.wat | 62 +++++----- .../class-overloading-cast.release.wat | 46 ++++---- tests/compiler/class-overloading.debug.wat | 62 +++++----- tests/compiler/class-overloading.release.wat | 46 ++++---- tests/compiler/class.debug.wat | 63 +++++----- tests/compiler/class.release.wat | 48 ++++---- tests/compiler/constructor.debug.wat | 63 +++++----- tests/compiler/constructor.release.wat | 48 ++++---- tests/compiler/do.debug.wat | 62 +++++----- tests/compiler/do.release.wat | 46 ++++---- tests/compiler/duplicate-fields.debug.wat | 62 +++++----- tests/compiler/duplicate-fields.release.wat | 48 ++++---- tests/compiler/empty-exportruntime.debug.wat | 62 +++++----- .../compiler/empty-exportruntime.release.wat | 48 ++++---- tests/compiler/empty-new.debug.wat | 62 +++++----- tests/compiler/empty-new.release.wat | 46 ++++---- .../compiler/exportstar-rereexport.debug.wat | 62 +++++----- .../exportstar-rereexport.release.wat | 46 ++++---- .../compiler/extends-baseaggregate.debug.wat | 62 +++++----- .../extends-baseaggregate.release.wat | 48 ++++---- tests/compiler/extends-recursive.debug.wat | 62 +++++----- tests/compiler/extends-recursive.release.wat | 48 ++++---- tests/compiler/field-initialization.debug.wat | 62 +++++----- .../compiler/field-initialization.release.wat | 48 ++++---- tests/compiler/field.debug.wat | 63 +++++----- tests/compiler/field.release.wat | 48 ++++---- tests/compiler/for.debug.wat | 62 +++++----- tests/compiler/for.release.wat | 46 ++++---- tests/compiler/function-call.debug.wat | 63 +++++----- tests/compiler/function-call.release.wat | 46 ++++---- tests/compiler/function-expression.debug.wat | 62 +++++----- .../compiler/function-expression.release.wat | 46 ++++---- tests/compiler/getter-call.debug.wat | 62 +++++----- tests/compiler/getter-call.release.wat | 46 ++++---- tests/compiler/heap.debug.wat | 63 +++++----- tests/compiler/heap.release.wat | 49 ++++---- tests/compiler/infer-array.debug.wat | 63 +++++----- tests/compiler/infer-array.release.wat | 49 ++++---- tests/compiler/infer-generic.debug.wat | 63 +++++----- tests/compiler/infer-generic.release.wat | 48 ++++---- tests/compiler/inlining.debug.wat | 62 +++++----- tests/compiler/inlining.release.wat | 48 ++++---- tests/compiler/instanceof.debug.wat | 62 +++++----- tests/compiler/instanceof.release.wat | 46 ++++---- tests/compiler/issues/1095.debug.wat | 62 +++++----- tests/compiler/issues/1095.release.wat | 48 ++++---- tests/compiler/issues/1225.debug.wat | 62 +++++----- tests/compiler/issues/1225.release.wat | 46 ++++---- tests/compiler/issues/1699.debug.wat | 62 +++++----- tests/compiler/issues/1699.release.wat | 49 ++++---- tests/compiler/issues/2166.debug.wat | 62 +++++----- tests/compiler/issues/2166.release.wat | 46 ++++---- tests/compiler/issues/2322/index.debug.wat | 62 +++++----- tests/compiler/issues/2322/index.release.wat | 48 ++++---- tests/compiler/issues/2622.debug.wat | 62 +++++----- tests/compiler/issues/2622.release.wat | 46 ++++---- tests/compiler/logical.debug.wat | 62 +++++----- tests/compiler/logical.release.wat | 46 ++++---- tests/compiler/managed-cast.debug.wat | 62 +++++----- tests/compiler/managed-cast.release.wat | 46 ++++---- tests/compiler/new.debug.wat | 62 +++++----- tests/compiler/new.release.wat | 46 ++++---- tests/compiler/object-literal.debug.wat | 63 +++++----- tests/compiler/object-literal.release.wat | 48 ++++---- .../optional-typeparameters.debug.wat | 63 +++++----- .../optional-typeparameters.release.wat | 46 ++++---- tests/compiler/reexport.debug.wat | 62 +++++----- tests/compiler/reexport.release.wat | 46 ++++---- tests/compiler/rereexport.debug.wat | 62 +++++----- tests/compiler/rereexport.release.wat | 46 ++++---- tests/compiler/resolve-access.debug.wat | 63 +++++----- tests/compiler/resolve-access.release.wat | 49 ++++---- tests/compiler/resolve-binary.debug.wat | 63 +++++----- tests/compiler/resolve-binary.release.wat | 49 ++++---- .../compiler/resolve-elementaccess.debug.wat | 61 +++++----- .../resolve-elementaccess.release.wat | 47 ++++---- .../resolve-function-expression.debug.wat | 62 +++++----- .../resolve-function-expression.release.wat | 48 ++++---- tests/compiler/resolve-new.debug.wat | 62 +++++----- tests/compiler/resolve-new.release.wat | 46 ++++---- .../compiler/resolve-propertyaccess.debug.wat | 62 +++++----- .../resolve-propertyaccess.release.wat | 48 ++++---- tests/compiler/resolve-ternary.debug.wat | 63 +++++----- tests/compiler/resolve-ternary.release.wat | 49 ++++---- tests/compiler/resolve-unary.debug.wat | 62 +++++----- tests/compiler/resolve-unary.release.wat | 48 ++++---- tests/compiler/return-unreachable.debug.wat | 62 +++++----- tests/compiler/return-unreachable.release.wat | 48 ++++---- .../compiler/rt/alloc-large-memory.debug.wat | 64 +++++----- .../rt/alloc-large-memory.release.wat | 54 ++++----- tests/compiler/rt/finalize.debug.wat | 62 +++++----- tests/compiler/rt/finalize.release.wat | 46 ++++---- .../rt/runtime-incremental-export.debug.wat | 62 +++++----- .../rt/runtime-incremental-export.release.wat | 48 ++++---- .../rt/runtime-minimal-export.debug.wat | 62 +++++----- .../rt/runtime-minimal-export.release.wat | 48 ++++---- tests/compiler/simd.debug.wat | 63 +++++----- tests/compiler/simd.release.wat | 48 ++++---- tests/compiler/std/array-literal.debug.wat | 63 +++++----- tests/compiler/std/array-literal.release.wat | 49 ++++---- tests/compiler/std/array.debug.wat | 61 +++++----- tests/compiler/std/array.release.wat | 47 ++++---- tests/compiler/std/arraybuffer.debug.wat | 63 +++++----- tests/compiler/std/arraybuffer.release.wat | 48 ++++---- tests/compiler/std/dataview.debug.wat | 63 +++++----- tests/compiler/std/dataview.release.wat | 47 ++++---- tests/compiler/std/date.debug.wat | 61 +++++----- tests/compiler/std/date.release.wat | 49 ++++---- tests/compiler/std/map.debug.wat | 61 +++++----- tests/compiler/std/map.release.wat | 50 ++++---- tests/compiler/std/math.release.wat | 36 +++--- tests/compiler/std/new.debug.wat | 62 +++++----- tests/compiler/std/new.release.wat | 46 ++++---- .../std/operator-overloading.debug.wat | 63 +++++----- .../std/operator-overloading.release.wat | 47 ++++---- tests/compiler/std/set.debug.wat | 61 +++++----- tests/compiler/std/set.release.wat | 50 ++++---- tests/compiler/std/static-array.debug.wat | 62 +++++----- tests/compiler/std/static-array.release.wat | 48 ++++---- tests/compiler/std/staticarray.debug.wat | 61 +++++----- tests/compiler/std/staticarray.release.wat | 49 ++++---- .../compiler/std/string-casemapping.debug.wat | 62 +++++----- .../std/string-casemapping.release.wat | 49 ++++---- tests/compiler/std/string-encoding.debug.wat | 61 +++++----- .../compiler/std/string-encoding.release.wat | 48 ++++---- tests/compiler/std/string.debug.wat | 61 +++++----- tests/compiler/std/string.release.wat | 49 ++++---- tests/compiler/std/symbol.debug.wat | 63 +++++----- tests/compiler/std/symbol.release.wat | 49 ++++---- tests/compiler/std/typedarray.debug.wat | 61 +++++----- tests/compiler/std/typedarray.release.wat | 48 ++++---- tests/compiler/std/uri.debug.wat | 61 +++++----- tests/compiler/std/uri.release.wat | 48 ++++---- tests/compiler/super-inline.debug.wat | 62 +++++----- tests/compiler/super-inline.release.wat | 46 ++++---- tests/compiler/templateliteral.debug.wat | 61 +++++----- tests/compiler/templateliteral.release.wat | 49 ++++---- tests/compiler/throw.debug.wat | 51 ++++---- tests/compiler/throw.release.wat | 110 +++++++++--------- tests/compiler/typeof.debug.wat | 62 +++++----- tests/compiler/typeof.release.wat | 46 ++++---- tests/compiler/while.debug.wat | 62 +++++----- tests/compiler/while.release.wat | 46 ++++---- 158 files changed, 4262 insertions(+), 4209 deletions(-) diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index d7efcce560..1d25919168 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -373,8 +373,9 @@ function prepareBlock(root: Root, block: Block, size: usize): void { } /** Adds more memory to the pool. */ -function addMemory(root: Root, start: usize, end: usize): bool { - if (DEBUG) assert(start <= end || end == 0); // must be valid +function addMemory(root: Root, start: usize, endU64: u64): bool { + let end = endU64; + if (DEBUG) assert(start <= endU64); // must be valid start = ((start + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD; end &= ~AL_MASK; @@ -442,7 +443,7 @@ function growMemory(root: Root, size: usize): void { if (memory.grow(pagesNeeded) < 0) unreachable(); } let pagesAfter = memory.size(); - addMemory(root, pagesBefore << 16, pagesAfter << 16); + addMemory(root, pagesBefore << 16, pagesAfter << 16); } /** Computes the size (excl. header) of a block. */ @@ -477,11 +478,11 @@ function initialize(): void { } let memStart = rootOffset + ROOT_SIZE; if (ASC_LOW_MEMORY_LIMIT) { - const memEnd = ASC_LOW_MEMORY_LIMIT & ~AL_MASK; + const memEnd = ASC_LOW_MEMORY_LIMIT & ~AL_MASK; if (memStart <= memEnd) addMemory(root, memStart, memEnd); else unreachable(); // low memory limit already exceeded } else { - addMemory(root, memStart, memory.size() << 16); + addMemory(root, memStart, memory.size() << 16); } ROOT = root; } diff --git a/tests/compiler/bindings/esm.debug.js b/tests/compiler/bindings/esm.debug.js index 9503ad5efb..dfd6e51847 100644 --- a/tests/compiler/bindings/esm.debug.js +++ b/tests/compiler/bindings/esm.debug.js @@ -18,10 +18,10 @@ async function instantiate(module, imports = {}) { // ~lib/bindings/dom/Math.E: f64 Math.E ), - "Math.log": ( + "Math.log"(x) { // ~lib/bindings/dom/Math.log(f64) => f64 - Math.log - ), + return Math.log(x); + }, "globalThis.globalThis": ( // bindings/esm/immutableGlobalNested: ref_extern | null} globalThis.globalThis diff --git a/tests/compiler/bindings/esm.debug.wat b/tests/compiler/bindings/esm.debug.wat index 03e27b3dba..d5d22b6aef 100644 --- a/tests/compiler/bindings/esm.debug.wat +++ b/tests/compiler/bindings/esm.debug.wat @@ -7,14 +7,15 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $f64_=>_f64 (func (param f64) (result f64))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $none_=>_i64 (func (result i64))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (import "env" "Math.E" (global $~lib/bindings/dom/Math.E f64)) @@ -1123,32 +1124,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 672 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1173,8 +1172,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1194,7 +1193,7 @@ if i32.const 0 i32.const 672 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1227,7 +1226,7 @@ if i32.const 0 i32.const 672 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1283,11 +1282,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1433,8 +1432,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1470,7 +1470,7 @@ if i32.const 0 i32.const 672 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1799,7 +1799,7 @@ if i32.const 336 i32.const 672 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2101,8 +2101,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2242,7 +2243,7 @@ if i32.const 0 i32.const 672 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2262,7 +2263,7 @@ if i32.const 0 i32.const 672 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/bindings/esm.release.js b/tests/compiler/bindings/esm.release.js index e929b4a60f..d4968bcc23 100644 --- a/tests/compiler/bindings/esm.release.js +++ b/tests/compiler/bindings/esm.release.js @@ -18,12 +18,12 @@ async function instantiate(module, imports = {}) { // ~lib/bindings/dom/Math.E: f64 Math.E ), - "Math.log": ( + "Math.log"(x) { // ~lib/bindings/dom/Math.log(f64) => f64 - Math.log - ), + return Math.log(x); + }, "globalThis.globalThis": ( - // bindings/esm/immutableGlobalNested: externref + // bindings/esm/immutableGlobalNested: ref_extern | null} globalThis.globalThis ), "Date.getTimezoneOffset"() { diff --git a/tests/compiler/bindings/esm.release.wat b/tests/compiler/bindings/esm.release.wat index b0e00dbe1d..ad9d048a83 100644 --- a/tests/compiler/bindings/esm.release.wat +++ b/tests/compiler/bindings/esm.release.wat @@ -1,17 +1,17 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $f64_=>_f64 (func (param f64) (result f64))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $none_=>_i64 (func (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "Math.E" (global $~lib/bindings/dom/Math.E f64)) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "console.log" (func $~lib/bindings/dom/console.log (param i32))) @@ -731,20 +731,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1696 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -769,7 +766,7 @@ if i32.const 0 i32.const 1696 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -797,18 +794,19 @@ if i32.const 0 i32.const 1696 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -818,10 +816,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -835,13 +833,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -920,8 +918,9 @@ i32.const 35056 i32.const 36628 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 35056 global.set $~lib/rt/tlsf/ROOT @@ -1162,7 +1161,7 @@ if i32.const 0 i32.const 1696 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1397,7 +1396,7 @@ if i32.const 1360 i32.const 1696 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1476,8 +1475,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1487,7 +1487,7 @@ if i32.const 0 i32.const 1696 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 1696 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/bindings/noExportRuntime.debug.wat b/tests/compiler/bindings/noExportRuntime.debug.wat index 4960f8fc61..b08ffb88b4 100644 --- a/tests/compiler/bindings/noExportRuntime.debug.wat +++ b/tests/compiler/bindings/noExportRuntime.debug.wat @@ -6,8 +6,9 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $bindings/noExportRuntime/isBasic (mut i32) (i32.const 0)) (global $bindings/noExportRuntime/isString i32 (i32.const 32)) @@ -1038,32 +1039,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 512 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1088,8 +1087,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1109,7 +1108,7 @@ if i32.const 0 i32.const 512 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1142,7 +1141,7 @@ if i32.const 0 i32.const 512 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1198,11 +1197,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1348,8 +1347,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1385,7 +1385,7 @@ if i32.const 0 i32.const 512 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1714,7 +1714,7 @@ if i32.const 176 i32.const 512 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2016,8 +2016,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2157,7 +2158,7 @@ if i32.const 0 i32.const 512 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2177,7 +2178,7 @@ if i32.const 0 i32.const 512 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/bindings/noExportRuntime.release.wat b/tests/compiler/bindings/noExportRuntime.release.wat index 173f60717e..e3acf8a363 100644 --- a/tests/compiler/bindings/noExportRuntime.release.wat +++ b/tests/compiler/bindings/noExportRuntime.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $bindings/noExportRuntime/isBasic (mut i32) (i32.const 0)) @@ -664,20 +664,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1536 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -702,7 +699,7 @@ if i32.const 0 i32.const 1536 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -730,18 +727,19 @@ if i32.const 0 i32.const 1536 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -751,10 +749,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -768,13 +766,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -853,8 +851,9 @@ i32.const 34560 i32.const 36132 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34560 global.set $~lib/rt/tlsf/ROOT @@ -1095,7 +1094,7 @@ if i32.const 0 i32.const 1536 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1330,7 +1329,7 @@ if i32.const 1200 i32.const 1536 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1409,8 +1408,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1420,7 +1420,7 @@ if i32.const 0 i32.const 1536 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1435,7 +1435,7 @@ if i32.const 0 i32.const 1536 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/bindings/raw.debug.js b/tests/compiler/bindings/raw.debug.js index 62227b542a..80551c4d39 100644 --- a/tests/compiler/bindings/raw.debug.js +++ b/tests/compiler/bindings/raw.debug.js @@ -18,10 +18,10 @@ export async function instantiate(module, imports = {}) { // ~lib/bindings/dom/Math.E: f64 Math.E ), - "Math.log": ( + "Math.log"(x) { // ~lib/bindings/dom/Math.log(f64) => f64 - Math.log - ), + return Math.log(x); + }, "globalThis.globalThis": ( // bindings/esm/immutableGlobalNested: ref_extern | null} globalThis.globalThis diff --git a/tests/compiler/bindings/raw.debug.wat b/tests/compiler/bindings/raw.debug.wat index 32a5b7f4ce..d4393ad921 100644 --- a/tests/compiler/bindings/raw.debug.wat +++ b/tests/compiler/bindings/raw.debug.wat @@ -7,14 +7,15 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $f64_=>_f64 (func (param f64) (result f64))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $none_=>_i64 (func (result i64))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (import "env" "Math.E" (global $~lib/bindings/dom/Math.E f64)) @@ -1126,32 +1127,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 672 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1176,8 +1175,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1197,7 +1196,7 @@ if i32.const 0 i32.const 672 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1230,7 +1229,7 @@ if i32.const 0 i32.const 672 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1286,11 +1285,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1436,8 +1435,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1473,7 +1473,7 @@ if i32.const 0 i32.const 672 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1802,7 +1802,7 @@ if i32.const 336 i32.const 672 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2104,8 +2104,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2245,7 +2246,7 @@ if i32.const 0 i32.const 672 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2265,7 +2266,7 @@ if i32.const 0 i32.const 672 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/bindings/raw.release.js b/tests/compiler/bindings/raw.release.js index 06002860de..80551c4d39 100644 --- a/tests/compiler/bindings/raw.release.js +++ b/tests/compiler/bindings/raw.release.js @@ -18,12 +18,12 @@ export async function instantiate(module, imports = {}) { // ~lib/bindings/dom/Math.E: f64 Math.E ), - "Math.log": ( + "Math.log"(x) { // ~lib/bindings/dom/Math.log(f64) => f64 - Math.log - ), + return Math.log(x); + }, "globalThis.globalThis": ( - // bindings/esm/immutableGlobalNested: externref + // bindings/esm/immutableGlobalNested: ref_extern | null} globalThis.globalThis ), "Date.getTimezoneOffset"() { diff --git a/tests/compiler/bindings/raw.release.wat b/tests/compiler/bindings/raw.release.wat index f1b7aa128e..38613cc3db 100644 --- a/tests/compiler/bindings/raw.release.wat +++ b/tests/compiler/bindings/raw.release.wat @@ -1,17 +1,17 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $f64_=>_f64 (func (param f64) (result f64))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $none_=>_i64 (func (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "Math.E" (global $~lib/bindings/dom/Math.E f64)) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "console.log" (func $~lib/bindings/dom/console.log (param i32))) @@ -731,20 +731,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1696 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -769,7 +766,7 @@ if i32.const 0 i32.const 1696 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -797,18 +794,19 @@ if i32.const 0 i32.const 1696 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -818,10 +816,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -835,13 +833,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -920,8 +918,9 @@ i32.const 35056 i32.const 36628 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 35056 global.set $~lib/rt/tlsf/ROOT @@ -1162,7 +1161,7 @@ if i32.const 0 i32.const 1696 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1397,7 +1396,7 @@ if i32.const 1360 i32.const 1696 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1476,8 +1475,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1487,7 +1487,7 @@ if i32.const 0 i32.const 1696 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 1696 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/call-super.debug.wat b/tests/compiler/call-super.debug.wat index 5aa2abfd02..ee0438c5cd 100644 --- a/tests/compiler/call-super.debug.wat +++ b/tests/compiler/call-super.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1014,32 +1014,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1064,8 +1062,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1085,7 +1083,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1118,7 +1116,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1174,11 +1172,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1324,8 +1322,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1361,7 +1360,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1690,7 +1689,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1992,8 +1991,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2133,7 +2133,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2153,7 +2153,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/call-super.release.wat b/tests/compiler/call-super.release.wat index 1ce46c171a..96f5a06379 100644 --- a/tests/compiler/call-super.release.wat +++ b/tests/compiler/call-super.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -611,20 +611,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -649,7 +646,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -677,18 +674,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -698,10 +696,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -715,13 +713,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -800,8 +798,9 @@ i32.const 34320 i32.const 35892 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34320 global.set $~lib/rt/tlsf/ROOT @@ -1042,7 +1041,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1277,7 +1276,7 @@ if i32.const 1104 i32.const 1440 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1356,8 +1355,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1367,7 +1367,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1382,7 +1382,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-implements.debug.wat b/tests/compiler/class-implements.debug.wat index ef19e9d227..513488c3b1 100644 --- a/tests/compiler/class-implements.debug.wat +++ b/tests/compiler/class-implements.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1017,32 +1017,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1067,8 +1065,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1088,7 +1086,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1121,7 +1119,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1177,11 +1175,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1327,8 +1325,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1364,7 +1363,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1693,7 +1692,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1995,8 +1994,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2136,7 +2136,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2156,7 +2156,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-implements.release.wat b/tests/compiler/class-implements.release.wat index 19ab9e6870..8241ee895b 100644 --- a/tests/compiler/class-implements.release.wat +++ b/tests/compiler/class-implements.release.wat @@ -6,7 +6,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -660,20 +660,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -698,7 +695,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -726,18 +723,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -747,10 +745,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -764,13 +762,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -849,8 +847,9 @@ i32.const 34352 i32.const 35924 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34352 global.set $~lib/rt/tlsf/ROOT @@ -1091,7 +1090,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1326,7 +1325,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1405,8 +1404,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1416,7 +1416,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1431,7 +1431,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-overloading-cast.debug.wat b/tests/compiler/class-overloading-cast.debug.wat index 1c26806065..5d6b4c4440 100644 --- a/tests/compiler/class-overloading-cast.debug.wat +++ b/tests/compiler/class-overloading-cast.debug.wat @@ -7,7 +7,7 @@ (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) @@ -1023,32 +1023,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1073,8 +1071,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1094,7 +1092,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1127,7 +1125,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1183,11 +1181,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1333,8 +1331,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1370,7 +1369,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1699,7 +1698,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2001,8 +2000,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2142,7 +2142,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2162,7 +2162,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-overloading-cast.release.wat b/tests/compiler/class-overloading-cast.release.wat index 35b6cbb524..7f8807e5d0 100644 --- a/tests/compiler/class-overloading-cast.release.wat +++ b/tests/compiler/class-overloading-cast.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -648,20 +648,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -686,7 +683,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -714,18 +711,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -735,10 +733,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -752,13 +750,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -837,8 +835,9 @@ i32.const 34480 i32.const 36052 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34480 global.set $~lib/rt/tlsf/ROOT @@ -1079,7 +1078,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1268,8 +1267,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1278,7 +1278,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1293,7 +1293,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-overloading.debug.wat b/tests/compiler/class-overloading.debug.wat index 7cbbda6acf..68188c2423 100644 --- a/tests/compiler/class-overloading.debug.wat +++ b/tests/compiler/class-overloading.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1027,32 +1027,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1077,8 +1075,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1098,7 +1096,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1131,7 +1129,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1187,11 +1185,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1337,8 +1335,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1374,7 +1373,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1703,7 +1702,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2005,8 +2004,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2146,7 +2146,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2166,7 +2166,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class-overloading.release.wat b/tests/compiler/class-overloading.release.wat index 5a61f57076..7c2ae8c167 100644 --- a/tests/compiler/class-overloading.release.wat +++ b/tests/compiler/class-overloading.release.wat @@ -4,7 +4,7 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -670,20 +670,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -708,7 +705,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -736,18 +733,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -757,10 +755,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -774,13 +772,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -859,8 +857,9 @@ i32.const 34640 i32.const 36212 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34640 global.set $~lib/rt/tlsf/ROOT @@ -1101,7 +1100,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1290,8 +1289,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1300,7 +1300,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1315,7 +1315,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class.debug.wat b/tests/compiler/class.debug.wat index a42e787e3d..d982de291a 100644 --- a/tests/compiler/class.debug.wat +++ b/tests/compiler/class.debug.wat @@ -5,10 +5,11 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f32_f32_=>_f32 (func (param i32 f32 f32) (result f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $class/Animal.ONE (mut i32) (i32.const 1)) @@ -1094,32 +1095,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1144,8 +1143,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1165,7 +1164,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1198,7 +1197,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1254,11 +1253,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1404,8 +1403,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1441,7 +1441,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1770,7 +1770,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2072,8 +2072,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2213,7 +2214,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2233,7 +2234,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/class.release.wat b/tests/compiler/class.release.wat index c86e991cc1..d09c997d7e 100644 --- a/tests/compiler/class.release.wat +++ b/tests/compiler/class.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -617,20 +617,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -655,7 +652,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -683,18 +680,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -704,10 +702,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -721,13 +719,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -806,8 +804,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1048,7 +1047,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1283,7 +1282,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1362,8 +1361,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1373,7 +1373,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1388,7 +1388,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/constructor.debug.wat b/tests/compiler/constructor.debug.wat index ca32016f80..fea14b0274 100644 --- a/tests/compiler/constructor.debug.wat +++ b/tests/compiler/constructor.debug.wat @@ -5,9 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1022,32 +1023,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1072,8 +1071,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1093,7 +1092,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1126,7 +1125,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1182,11 +1181,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1332,8 +1331,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1369,7 +1369,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1698,7 +1698,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2000,8 +2000,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2141,7 +2142,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2161,7 +2162,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/constructor.release.wat b/tests/compiler/constructor.release.wat index 89ed17f28e..e90dc84a66 100644 --- a/tests/compiler/constructor.release.wat +++ b/tests/compiler/constructor.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -674,20 +674,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -712,7 +709,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -740,18 +737,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -761,10 +759,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -778,13 +776,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -863,8 +861,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1105,7 +1104,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1340,7 +1339,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1419,8 +1418,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1430,7 +1430,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1445,7 +1445,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.debug.wat b/tests/compiler/do.debug.wat index 05542539a8..8432628da9 100644 --- a/tests/compiler/do.debug.wat +++ b/tests/compiler/do.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $do/ran (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1418,32 +1418,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1468,8 +1466,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1489,7 +1487,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1522,7 +1520,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1578,11 +1576,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1728,8 +1726,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1765,7 +1764,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2094,7 +2093,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2396,8 +2395,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2537,7 +2537,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2557,7 +2557,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.release.wat b/tests/compiler/do.release.wat index 3e0176701c..eae6e23206 100644 --- a/tests/compiler/do.release.wat +++ b/tests/compiler/do.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -610,20 +610,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -648,7 +645,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -676,18 +673,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -697,10 +695,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -714,13 +712,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -799,8 +797,9 @@ i32.const 34272 i32.const 35844 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34272 global.set $~lib/rt/tlsf/ROOT @@ -1041,7 +1040,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1230,8 +1229,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1255,7 +1255,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/duplicate-fields.debug.wat b/tests/compiler/duplicate-fields.debug.wat index 163aae9ca1..7bf87ccaba 100644 --- a/tests/compiler/duplicate-fields.debug.wat +++ b/tests/compiler/duplicate-fields.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1017,32 +1017,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1067,8 +1065,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1088,7 +1086,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1121,7 +1119,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1177,11 +1175,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1327,8 +1325,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1364,7 +1363,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1693,7 +1692,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1995,8 +1994,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2136,7 +2136,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2156,7 +2156,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/duplicate-fields.release.wat b/tests/compiler/duplicate-fields.release.wat index cf8f5bc2e0..493ded77a6 100644 --- a/tests/compiler/duplicate-fields.release.wat +++ b/tests/compiler/duplicate-fields.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -624,20 +624,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -662,7 +659,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -690,18 +687,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -711,10 +709,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -728,13 +726,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -813,8 +811,9 @@ i32.const 34320 i32.const 35892 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34320 global.set $~lib/rt/tlsf/ROOT @@ -1055,7 +1054,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1290,7 +1289,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1369,8 +1368,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1380,7 +1380,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1395,7 +1395,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/empty-exportruntime.debug.wat b/tests/compiler/empty-exportruntime.debug.wat index 19aebb2f07..8f69345eb5 100644 --- a/tests/compiler/empty-exportruntime.debug.wat +++ b/tests/compiler/empty-exportruntime.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1016,32 +1016,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1066,8 +1064,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1087,7 +1085,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1120,7 +1118,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1176,11 +1174,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1326,8 +1324,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1363,7 +1362,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1692,7 +1691,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1994,8 +1993,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2135,7 +2135,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2155,7 +2155,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/empty-exportruntime.release.wat b/tests/compiler/empty-exportruntime.release.wat index 9effd21443..caf4fb6744 100644 --- a/tests/compiler/empty-exportruntime.release.wat +++ b/tests/compiler/empty-exportruntime.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -625,20 +625,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -663,7 +660,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -691,18 +688,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -712,10 +710,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -729,13 +727,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -814,8 +812,9 @@ i32.const 34368 i32.const 35940 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34368 global.set $~lib/rt/tlsf/ROOT @@ -1056,7 +1055,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1291,7 +1290,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1370,8 +1369,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1381,7 +1381,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1396,7 +1396,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/empty-new.debug.wat b/tests/compiler/empty-new.debug.wat index f80e2d0577..de8b37131f 100644 --- a/tests/compiler/empty-new.debug.wat +++ b/tests/compiler/empty-new.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1009,32 +1009,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1059,8 +1057,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1080,7 +1078,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1113,7 +1111,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1169,11 +1167,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1319,8 +1317,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1356,7 +1355,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1685,7 +1684,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1987,8 +1986,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2128,7 +2128,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2148,7 +2148,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/empty-new.release.wat b/tests/compiler/empty-new.release.wat index 6ec33486f3..9cce3d1af5 100644 --- a/tests/compiler/empty-new.release.wat +++ b/tests/compiler/empty-new.release.wat @@ -3,7 +3,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -607,20 +607,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -645,7 +642,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -673,18 +670,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -694,10 +692,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -711,13 +709,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -796,8 +794,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1038,7 +1037,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1227,8 +1226,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1237,7 +1237,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1252,7 +1252,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/exportstar-rereexport.debug.wat b/tests/compiler/exportstar-rereexport.debug.wat index 88315555c7..6ab32b9f63 100644 --- a/tests/compiler/exportstar-rereexport.debug.wat +++ b/tests/compiler/exportstar-rereexport.debug.wat @@ -6,7 +6,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1049,32 +1049,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1099,8 +1097,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1120,7 +1118,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1153,7 +1151,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1209,11 +1207,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1359,8 +1357,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1396,7 +1395,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1725,7 +1724,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2027,8 +2026,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2168,7 +2168,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2188,7 +2188,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/exportstar-rereexport.release.wat b/tests/compiler/exportstar-rereexport.release.wat index 03bbac5a18..2579e676cb 100644 --- a/tests/compiler/exportstar-rereexport.release.wat +++ b/tests/compiler/exportstar-rereexport.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -641,20 +641,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -679,7 +676,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -707,18 +704,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -728,10 +726,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -745,13 +743,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -830,8 +828,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1072,7 +1071,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1261,8 +1260,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1271,7 +1271,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1286,7 +1286,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.debug.wat b/tests/compiler/extends-baseaggregate.debug.wat index a255f27e4d..b4ad0cd136 100644 --- a/tests/compiler/extends-baseaggregate.debug.wat +++ b/tests/compiler/extends-baseaggregate.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f64_=>_none (func (param i32 f64))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $extends-baseaggregate/poolB i32 (i32.const 64)) @@ -1019,32 +1019,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 528 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1069,8 +1067,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1090,7 +1088,7 @@ if i32.const 0 i32.const 528 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1123,7 +1121,7 @@ if i32.const 0 i32.const 528 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1179,11 +1177,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1329,8 +1327,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1366,7 +1365,7 @@ if i32.const 0 i32.const 528 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1695,7 +1694,7 @@ if i32.const 192 i32.const 528 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1997,8 +1996,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2138,7 +2138,7 @@ if i32.const 0 i32.const 528 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2158,7 +2158,7 @@ if i32.const 0 i32.const 528 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.release.wat b/tests/compiler/extends-baseaggregate.release.wat index 1ad5c2deee..e7f2d48b36 100644 --- a/tests/compiler/extends-baseaggregate.release.wat +++ b/tests/compiler/extends-baseaggregate.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -627,20 +627,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1552 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -665,7 +662,7 @@ if i32.const 0 i32.const 1552 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -693,18 +690,19 @@ if i32.const 0 i32.const 1552 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -714,10 +712,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -731,13 +729,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -816,8 +814,9 @@ i32.const 34512 i32.const 36084 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34512 global.set $~lib/rt/tlsf/ROOT @@ -1058,7 +1057,7 @@ if i32.const 0 i32.const 1552 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1293,7 +1292,7 @@ if i32.const 1216 i32.const 1552 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1372,8 +1371,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1383,7 +1383,7 @@ if i32.const 0 i32.const 1552 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1398,7 +1398,7 @@ if i32.const 0 i32.const 1552 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-recursive.debug.wat b/tests/compiler/extends-recursive.debug.wat index 75731d285b..cc418dc5a2 100644 --- a/tests/compiler/extends-recursive.debug.wat +++ b/tests/compiler/extends-recursive.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1009,32 +1009,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1059,8 +1057,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1080,7 +1078,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1113,7 +1111,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1169,11 +1167,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1319,8 +1317,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1356,7 +1355,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1685,7 +1684,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1987,8 +1986,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2128,7 +2128,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2148,7 +2148,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-recursive.release.wat b/tests/compiler/extends-recursive.release.wat index 73b4e52c52..55177fd2de 100644 --- a/tests/compiler/extends-recursive.release.wat +++ b/tests/compiler/extends-recursive.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -608,20 +608,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -646,7 +643,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -674,18 +671,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -695,10 +693,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -712,13 +710,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -797,8 +795,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1039,7 +1038,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1274,7 +1273,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1353,8 +1352,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1364,7 +1364,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1379,7 +1379,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/field-initialization.debug.wat b/tests/compiler/field-initialization.debug.wat index 0c58397882..8d33900225 100644 --- a/tests/compiler/field-initialization.debug.wat +++ b/tests/compiler/field-initialization.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1020,32 +1020,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1070,8 +1068,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1091,7 +1089,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1124,7 +1122,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1180,11 +1178,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1330,8 +1328,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1367,7 +1366,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1696,7 +1695,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1998,8 +1997,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2139,7 +2139,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2159,7 +2159,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/field-initialization.release.wat b/tests/compiler/field-initialization.release.wat index 09309044c6..2b12e4b206 100644 --- a/tests/compiler/field-initialization.release.wat +++ b/tests/compiler/field-initialization.release.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -628,20 +628,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -666,7 +663,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -694,18 +691,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -715,10 +713,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -732,13 +730,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -817,8 +815,9 @@ i32.const 34672 i32.const 36244 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34672 global.set $~lib/rt/tlsf/ROOT @@ -1059,7 +1058,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1294,7 +1293,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1373,8 +1372,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1384,7 +1384,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1399,7 +1399,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/field.debug.wat b/tests/compiler/field.debug.wat index fb7e16580d..8ba0b11431 100644 --- a/tests/compiler/field.debug.wat +++ b/tests/compiler/field.debug.wat @@ -5,9 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1011,32 +1012,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1061,8 +1060,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1082,7 +1081,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1115,7 +1114,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1171,11 +1170,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1321,8 +1320,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1358,7 +1358,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1687,7 +1687,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1989,8 +1989,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2130,7 +2131,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2150,7 +2151,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/field.release.wat b/tests/compiler/field.release.wat index 9efe273400..17ce80649a 100644 --- a/tests/compiler/field.release.wat +++ b/tests/compiler/field.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -611,20 +611,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -649,7 +646,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -677,18 +674,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -698,10 +696,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -715,13 +713,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -800,8 +798,9 @@ i32.const 34272 i32.const 35844 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34272 global.set $~lib/rt/tlsf/ROOT @@ -1042,7 +1041,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1277,7 +1276,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1356,8 +1355,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1367,7 +1367,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1382,7 +1382,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.debug.wat b/tests/compiler/for.debug.wat index c5cea01699..407a1ca890 100644 --- a/tests/compiler/for.debug.wat +++ b/tests/compiler/for.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $for/ran (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1399,32 +1399,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1449,8 +1447,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1470,7 +1468,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1503,7 +1501,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1559,11 +1557,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1709,8 +1707,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1746,7 +1745,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2075,7 +2074,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2377,8 +2376,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2518,7 +2518,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2538,7 +2538,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.release.wat b/tests/compiler/for.release.wat index da19dcee11..008278b7d7 100644 --- a/tests/compiler/for.release.wat +++ b/tests/compiler/for.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -610,20 +610,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -648,7 +645,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -676,18 +673,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -697,10 +695,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -714,13 +712,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -799,8 +797,9 @@ i32.const 34272 i32.const 35844 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34272 global.set $~lib/rt/tlsf/ROOT @@ -1041,7 +1040,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1230,8 +1229,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1255,7 +1255,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/function-call.debug.wat b/tests/compiler/function-call.debug.wat index 1778e7fa7c..fafbdad6aa 100644 --- a/tests/compiler/function-call.debug.wat +++ b/tests/compiler/function-call.debug.wat @@ -4,9 +4,10 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $function-call/fnVoid (mut i32) (i32.const 32)) @@ -1047,32 +1048,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 592 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1097,8 +1096,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1118,7 +1117,7 @@ if i32.const 0 i32.const 592 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1151,7 +1150,7 @@ if i32.const 0 i32.const 592 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1207,11 +1206,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1357,8 +1356,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1394,7 +1394,7 @@ if i32.const 0 i32.const 592 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1723,7 +1723,7 @@ if i32.const 256 i32.const 592 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2025,8 +2025,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2166,7 +2167,7 @@ if i32.const 0 i32.const 592 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2186,7 +2187,7 @@ if i32.const 0 i32.const 592 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/function-call.release.wat b/tests/compiler/function-call.release.wat index e8f1a6e75b..c784df4f93 100644 --- a/tests/compiler/function-call.release.wat +++ b/tests/compiler/function-call.release.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -649,20 +649,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1616 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -687,7 +684,7 @@ if i32.const 0 i32.const 1616 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -715,18 +712,19 @@ if i32.const 0 i32.const 1616 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -736,10 +734,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -753,13 +751,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -838,8 +836,9 @@ i32.const 34576 i32.const 36148 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34576 global.set $~lib/rt/tlsf/ROOT @@ -1080,7 +1079,7 @@ if i32.const 0 i32.const 1616 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1269,8 +1268,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1279,7 +1279,7 @@ if i32.const 0 i32.const 1616 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1294,7 +1294,7 @@ if i32.const 0 i32.const 1616 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/function-expression.debug.wat b/tests/compiler/function-expression.debug.wat index 190a17fcff..d4bb092868 100644 --- a/tests/compiler/function-expression.debug.wat +++ b/tests/compiler/function-expression.debug.wat @@ -7,7 +7,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $function-expression/f1 (mut i32) (i32.const 32)) (global $~argumentsLength (mut i32) (i32.const 0)) @@ -1205,32 +1205,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 912 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1255,8 +1253,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1276,7 +1274,7 @@ if i32.const 0 i32.const 912 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1309,7 +1307,7 @@ if i32.const 0 i32.const 912 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1365,11 +1363,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1515,8 +1513,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1552,7 +1551,7 @@ if i32.const 0 i32.const 912 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1881,7 +1880,7 @@ if i32.const 576 i32.const 912 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2183,8 +2182,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2324,7 +2324,7 @@ if i32.const 0 i32.const 912 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2344,7 +2344,7 @@ if i32.const 0 i32.const 912 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/function-expression.release.wat b/tests/compiler/function-expression.release.wat index 6cc059c855..81beccd9b2 100644 --- a/tests/compiler/function-expression.release.wat +++ b/tests/compiler/function-expression.release.wat @@ -6,7 +6,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -675,20 +675,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1936 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -713,7 +710,7 @@ if i32.const 0 i32.const 1936 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -741,18 +738,19 @@ if i32.const 0 i32.const 1936 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -762,10 +760,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -779,13 +777,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -864,8 +862,9 @@ i32.const 34928 i32.const 36500 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34928 global.set $~lib/rt/tlsf/ROOT @@ -1106,7 +1105,7 @@ if i32.const 0 i32.const 1936 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1295,8 +1294,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1305,7 +1305,7 @@ if i32.const 0 i32.const 1936 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1320,7 +1320,7 @@ if i32.const 0 i32.const 1936 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/getter-call.debug.wat b/tests/compiler/getter-call.debug.wat index 94c719dd8f..35e9824008 100644 --- a/tests/compiler/getter-call.debug.wat +++ b/tests/compiler/getter-call.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1012,32 +1012,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1062,8 +1060,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1083,7 +1081,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1116,7 +1114,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1172,11 +1170,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1322,8 +1320,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1359,7 +1358,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1688,7 +1687,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1990,8 +1989,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2131,7 +2131,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2151,7 +2151,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/getter-call.release.wat b/tests/compiler/getter-call.release.wat index 2dc93630a7..76889b92a2 100644 --- a/tests/compiler/getter-call.release.wat +++ b/tests/compiler/getter-call.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -613,20 +613,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -651,7 +648,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -679,18 +676,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -700,10 +698,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -717,13 +715,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -802,8 +800,9 @@ i32.const 34272 i32.const 35844 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34272 global.set $~lib/rt/tlsf/ROOT @@ -1044,7 +1043,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1233,8 +1232,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1243,7 +1243,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1258,7 +1258,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/heap.debug.wat b/tests/compiler/heap.debug.wat index 03bbdf925e..15b46c46c7 100644 --- a/tests/compiler/heap.debug.wat +++ b/tests/compiler/heap.debug.wat @@ -2,10 +2,11 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -657,32 +658,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 32 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -707,8 +706,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -728,7 +727,7 @@ if i32.const 0 i32.const 32 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -761,7 +760,7 @@ if i32.const 0 i32.const 32 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -817,11 +816,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -967,8 +966,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1002,7 +1002,7 @@ if i32.const 96 i32.const 32 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1304,8 +1304,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -1445,7 +1446,7 @@ if i32.const 0 i32.const 32 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1465,7 +1466,7 @@ if i32.const 0 i32.const 32 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable @@ -1530,7 +1531,7 @@ if i32.const 0 i32.const 32 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/heap.release.wat b/tests/compiler/heap.release.wat index 02881148bb..baefb0fa14 100644 --- a/tests/compiler/heap.release.wat +++ b/tests/compiler/heap.release.wat @@ -1,10 +1,11 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $heap/ptr (mut i32) (i32.const 0)) @@ -414,20 +415,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1056 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -452,7 +450,7 @@ if i32.const 0 i32.const 1056 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -480,18 +478,19 @@ if i32.const 0 i32.const 1056 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -501,10 +500,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -518,13 +517,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -603,8 +602,9 @@ i32.const 33936 i32.const 35508 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 33936 global.set $~lib/rt/tlsf/ROOT @@ -616,7 +616,7 @@ if i32.const 1120 i32.const 1056 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -899,8 +899,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $2 @@ -910,7 +911,7 @@ if i32.const 0 i32.const 1056 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -925,7 +926,7 @@ if i32.const 0 i32.const 1056 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable @@ -962,7 +963,7 @@ if i32.const 0 i32.const 1056 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-array.debug.wat b/tests/compiler/infer-array.debug.wat index 41b69c90bb..6a0d4d81de 100644 --- a/tests/compiler/infer-array.debug.wat +++ b/tests/compiler/infer-array.debug.wat @@ -6,8 +6,9 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) @@ -1030,32 +1031,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1080,8 +1079,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1101,7 +1100,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1134,7 +1133,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1190,11 +1189,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1340,8 +1339,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1377,7 +1377,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1706,7 +1706,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2008,8 +2008,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2149,7 +2150,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2169,7 +2170,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-array.release.wat b/tests/compiler/infer-array.release.wat index ca83e42920..ecdace4dee 100644 --- a/tests/compiler/infer-array.release.wat +++ b/tests/compiler/infer-array.release.wat @@ -2,10 +2,11 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -649,20 +650,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -687,7 +685,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -715,18 +713,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -736,10 +735,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -753,13 +752,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -838,8 +837,9 @@ i32.const 34992 i32.const 36564 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34992 global.set $~lib/rt/tlsf/ROOT @@ -1080,7 +1080,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1315,7 +1315,7 @@ if i32.const 1088 i32.const 1424 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1394,8 +1394,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1405,7 +1406,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1420,7 +1421,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-generic.debug.wat b/tests/compiler/infer-generic.debug.wat index dc3f288429..8f233ef65a 100644 --- a/tests/compiler/infer-generic.debug.wat +++ b/tests/compiler/infer-generic.debug.wat @@ -6,11 +6,12 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $infer-generic/arr i32 (i32.const 128)) (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) @@ -1057,32 +1058,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 544 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1107,8 +1106,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1128,7 +1127,7 @@ if i32.const 0 i32.const 544 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1161,7 +1160,7 @@ if i32.const 0 i32.const 544 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1217,11 +1216,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1367,8 +1366,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1404,7 +1404,7 @@ if i32.const 0 i32.const 544 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1733,7 +1733,7 @@ if i32.const 208 i32.const 544 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2035,8 +2035,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2176,7 +2177,7 @@ if i32.const 0 i32.const 544 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2196,7 +2197,7 @@ if i32.const 0 i32.const 544 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-generic.release.wat b/tests/compiler/infer-generic.release.wat index f046ee0c95..a3aa2380b5 100644 --- a/tests/compiler/infer-generic.release.wat +++ b/tests/compiler/infer-generic.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) (type $i32_=>_i32 (func (param i32) (result i32))) @@ -637,20 +637,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1568 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -675,7 +672,7 @@ if i32.const 0 i32.const 1568 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -703,18 +700,19 @@ if i32.const 0 i32.const 1568 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -724,10 +722,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -741,13 +739,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -826,8 +824,9 @@ i32.const 34432 i32.const 36004 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34432 global.set $~lib/rt/tlsf/ROOT @@ -1068,7 +1067,7 @@ if i32.const 0 i32.const 1568 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1303,7 +1302,7 @@ if i32.const 1232 i32.const 1568 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1382,8 +1381,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1393,7 +1393,7 @@ if i32.const 0 i32.const 1568 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1408,7 +1408,7 @@ if i32.const 0 i32.const 1568 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/inlining.debug.wat b/tests/compiler/inlining.debug.wat index d01f86fbba..9aa02eb8e6 100644 --- a/tests/compiler/inlining.debug.wat +++ b/tests/compiler/inlining.debug.wat @@ -7,7 +7,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $inlining/constantGlobal i32 (i32.const 1)) (global $~argumentsLength (mut i32) (i32.const 0)) @@ -1277,32 +1277,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 448 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1327,8 +1325,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1348,7 +1346,7 @@ if i32.const 0 i32.const 448 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1381,7 +1379,7 @@ if i32.const 0 i32.const 448 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1437,11 +1435,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1587,8 +1585,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1624,7 +1623,7 @@ if i32.const 0 i32.const 448 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1953,7 +1952,7 @@ if i32.const 112 i32.const 448 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2255,8 +2254,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2396,7 +2396,7 @@ if i32.const 0 i32.const 448 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2416,7 +2416,7 @@ if i32.const 0 i32.const 448 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/inlining.release.wat b/tests/compiler/inlining.release.wat index c70c8ada59..86a09559d2 100644 --- a/tests/compiler/inlining.release.wat +++ b/tests/compiler/inlining.release.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -623,20 +623,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1472 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -661,7 +658,7 @@ if i32.const 0 i32.const 1472 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -689,18 +686,19 @@ if i32.const 0 i32.const 1472 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -710,10 +708,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -727,13 +725,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -812,8 +810,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1054,7 +1053,7 @@ if i32.const 0 i32.const 1472 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1289,7 +1288,7 @@ if i32.const 1136 i32.const 1472 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1368,8 +1367,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1379,7 +1379,7 @@ if i32.const 0 i32.const 1472 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1394,7 +1394,7 @@ if i32.const 0 i32.const 1472 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/instanceof.debug.wat b/tests/compiler/instanceof.debug.wat index 5cee12228e..7a6e9d3571 100644 --- a/tests/compiler/instanceof.debug.wat +++ b/tests/compiler/instanceof.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1033,32 +1033,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1083,8 +1081,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1104,7 +1102,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1137,7 +1135,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1193,11 +1191,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1343,8 +1341,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1380,7 +1379,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1709,7 +1708,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2011,8 +2010,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2152,7 +2152,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2172,7 +2172,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/instanceof.release.wat b/tests/compiler/instanceof.release.wat index 98178bebc1..6e380ceb09 100644 --- a/tests/compiler/instanceof.release.wat +++ b/tests/compiler/instanceof.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -715,20 +715,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -753,7 +750,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -781,18 +778,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -802,10 +800,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -819,13 +817,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -904,8 +902,9 @@ i32.const 34368 i32.const 35940 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34368 global.set $~lib/rt/tlsf/ROOT @@ -1146,7 +1145,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1335,8 +1334,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1345,7 +1345,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1360,7 +1360,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.debug.wat b/tests/compiler/issues/1095.debug.wat index 8b47853a21..7bc52ec422 100644 --- a/tests/compiler/issues/1095.debug.wat +++ b/tests/compiler/issues/1095.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1012,32 +1012,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1062,8 +1060,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1083,7 +1081,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1116,7 +1114,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1172,11 +1170,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1322,8 +1320,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1359,7 +1358,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1688,7 +1687,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1990,8 +1989,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2131,7 +2131,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2151,7 +2151,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.release.wat b/tests/compiler/issues/1095.release.wat index 9716be30ff..833d7bb9b4 100644 --- a/tests/compiler/issues/1095.release.wat +++ b/tests/compiler/issues/1095.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -614,20 +614,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -652,7 +649,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -680,18 +677,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -701,10 +699,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -718,13 +716,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -803,8 +801,9 @@ i32.const 34448 i32.const 36020 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34448 global.set $~lib/rt/tlsf/ROOT @@ -1045,7 +1044,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1280,7 +1279,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1359,8 +1358,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1370,7 +1370,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1385,7 +1385,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1225.debug.wat b/tests/compiler/issues/1225.debug.wat index 05f0fa10f3..5766a3ebaa 100644 --- a/tests/compiler/issues/1225.debug.wat +++ b/tests/compiler/issues/1225.debug.wat @@ -7,7 +7,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1027,32 +1027,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1077,8 +1075,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1098,7 +1096,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1131,7 +1129,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1187,11 +1185,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1337,8 +1335,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1374,7 +1373,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1703,7 +1702,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2005,8 +2004,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2146,7 +2146,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2166,7 +2166,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1225.release.wat b/tests/compiler/issues/1225.release.wat index 548acd53d9..27ad0ab4d1 100644 --- a/tests/compiler/issues/1225.release.wat +++ b/tests/compiler/issues/1225.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -619,20 +619,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -657,7 +654,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -685,18 +682,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -706,10 +704,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -723,13 +721,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -808,8 +806,9 @@ i32.const 34288 i32.const 35860 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34288 global.set $~lib/rt/tlsf/ROOT @@ -1050,7 +1049,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1239,8 +1238,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1249,7 +1249,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1264,7 +1264,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1699.debug.wat b/tests/compiler/issues/1699.debug.wat index 0b59c7f09c..6fa0fa92a5 100644 --- a/tests/compiler/issues/1699.debug.wat +++ b/tests/compiler/issues/1699.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) @@ -1014,32 +1014,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 464 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1064,8 +1062,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1085,7 +1083,7 @@ if i32.const 0 i32.const 464 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1118,7 +1116,7 @@ if i32.const 0 i32.const 464 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1174,11 +1172,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1324,8 +1322,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1361,7 +1360,7 @@ if i32.const 0 i32.const 464 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1690,7 +1689,7 @@ if i32.const 128 i32.const 464 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1992,8 +1991,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2133,7 +2133,7 @@ if i32.const 0 i32.const 464 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2153,7 +2153,7 @@ if i32.const 0 i32.const 464 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1699.release.wat b/tests/compiler/issues/1699.release.wat index 8b22fd9923..2228f68687 100644 --- a/tests/compiler/issues/1699.release.wat +++ b/tests/compiler/issues/1699.release.wat @@ -1,11 +1,12 @@ (module (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -620,20 +621,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1488 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -658,7 +656,7 @@ if i32.const 0 i32.const 1488 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -686,18 +684,19 @@ if i32.const 0 i32.const 1488 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -707,10 +706,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -724,13 +723,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -809,8 +808,9 @@ i32.const 34512 i32.const 36084 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34512 global.set $~lib/rt/tlsf/ROOT @@ -1051,7 +1051,7 @@ if i32.const 0 i32.const 1488 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1286,7 +1286,7 @@ if i32.const 1152 i32.const 1488 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1365,8 +1365,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1376,7 +1377,7 @@ if i32.const 0 i32.const 1488 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1391,7 +1392,7 @@ if i32.const 0 i32.const 1488 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2166.debug.wat b/tests/compiler/issues/2166.debug.wat index 8dba63b0a4..95bcc64d24 100644 --- a/tests/compiler/issues/2166.debug.wat +++ b/tests/compiler/issues/2166.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1016,32 +1016,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1066,8 +1064,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1087,7 +1085,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1120,7 +1118,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1176,11 +1174,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1326,8 +1324,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1363,7 +1362,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1692,7 +1691,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1994,8 +1993,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2135,7 +2135,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2155,7 +2155,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2166.release.wat b/tests/compiler/issues/2166.release.wat index 511d21db73..50358d77ee 100644 --- a/tests/compiler/issues/2166.release.wat +++ b/tests/compiler/issues/2166.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -619,20 +619,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -657,7 +654,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -685,18 +682,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -706,10 +704,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -723,13 +721,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -808,8 +806,9 @@ i32.const 34432 i32.const 36004 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34432 global.set $~lib/rt/tlsf/ROOT @@ -1050,7 +1049,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1239,8 +1238,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1249,7 +1249,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1264,7 +1264,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2322/index.debug.wat b/tests/compiler/issues/2322/index.debug.wat index 5a7e54a9ac..12436fad86 100644 --- a/tests/compiler/issues/2322/index.debug.wat +++ b/tests/compiler/issues/2322/index.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1010,32 +1010,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1060,8 +1058,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1081,7 +1079,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1114,7 +1112,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1170,11 +1168,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1320,8 +1318,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1357,7 +1356,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1686,7 +1685,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1988,8 +1987,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2129,7 +2129,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2149,7 +2149,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2322/index.release.wat b/tests/compiler/issues/2322/index.release.wat index 41aadb5d85..0d93ed1ae6 100644 --- a/tests/compiler/issues/2322/index.release.wat +++ b/tests/compiler/issues/2322/index.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -609,20 +609,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -647,7 +644,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -675,18 +672,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -696,10 +694,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -713,13 +711,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -798,8 +796,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1040,7 +1039,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1275,7 +1274,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1354,8 +1353,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1365,7 +1365,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1380,7 +1380,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2622.debug.wat b/tests/compiler/issues/2622.debug.wat index 518e16b83d..114640c3e5 100644 --- a/tests/compiler/issues/2622.debug.wat +++ b/tests/compiler/issues/2622.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1013,32 +1013,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1063,8 +1061,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1084,7 +1082,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1117,7 +1115,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1173,11 +1171,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1323,8 +1321,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1360,7 +1359,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1689,7 +1688,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1991,8 +1990,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2132,7 +2132,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2152,7 +2152,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/2622.release.wat b/tests/compiler/issues/2622.release.wat index f1ad5c79db..b2ba09af23 100644 --- a/tests/compiler/issues/2622.release.wat +++ b/tests/compiler/issues/2622.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -648,20 +648,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -686,7 +683,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -714,18 +711,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -735,10 +733,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -752,13 +750,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -837,8 +835,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1079,7 +1078,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1268,8 +1267,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1278,7 +1278,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1293,7 +1293,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/logical.debug.wat b/tests/compiler/logical.debug.wat index 09dc5e0849..fca6162159 100644 --- a/tests/compiler/logical.debug.wat +++ b/tests/compiler/logical.debug.wat @@ -7,7 +7,7 @@ (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $logical/i (mut i32) (i32.const 0)) @@ -1039,32 +1039,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1089,8 +1087,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1110,7 +1108,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1143,7 +1141,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1199,11 +1197,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1349,8 +1347,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1386,7 +1385,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1715,7 +1714,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2017,8 +2016,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2158,7 +2158,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2178,7 +2178,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/logical.release.wat b/tests/compiler/logical.release.wat index 0b92fa8d46..5a368d6b60 100644 --- a/tests/compiler/logical.release.wat +++ b/tests/compiler/logical.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -624,20 +624,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -662,7 +659,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -690,18 +687,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -711,10 +709,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -728,13 +726,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -813,8 +811,9 @@ i32.const 34304 i32.const 35876 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34304 global.set $~lib/rt/tlsf/ROOT @@ -1055,7 +1054,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1244,8 +1243,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1254,7 +1254,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1269,7 +1269,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.debug.wat b/tests/compiler/managed-cast.debug.wat index 1186dbbbf8..e18897dfca 100644 --- a/tests/compiler/managed-cast.debug.wat +++ b/tests/compiler/managed-cast.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1012,32 +1012,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1062,8 +1060,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1083,7 +1081,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1116,7 +1114,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1172,11 +1170,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1322,8 +1320,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1359,7 +1358,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1688,7 +1687,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1990,8 +1989,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2131,7 +2131,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2151,7 +2151,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.release.wat b/tests/compiler/managed-cast.release.wat index 193feabe15..19cbe6d573 100644 --- a/tests/compiler/managed-cast.release.wat +++ b/tests/compiler/managed-cast.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -614,20 +614,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -652,7 +649,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -680,18 +677,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -701,10 +699,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -718,13 +716,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -803,8 +801,9 @@ i32.const 34496 i32.const 36068 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34496 global.set $~lib/rt/tlsf/ROOT @@ -1045,7 +1044,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1234,8 +1233,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1244,7 +1244,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1259,7 +1259,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/new.debug.wat b/tests/compiler/new.debug.wat index 776e3e24ec..fecb460f29 100644 --- a/tests/compiler/new.debug.wat +++ b/tests/compiler/new.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $new/ref (mut i32) (i32.const 0)) @@ -1015,32 +1015,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1065,8 +1063,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1086,7 +1084,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1119,7 +1117,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1175,11 +1173,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1325,8 +1323,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1362,7 +1361,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1691,7 +1690,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1993,8 +1992,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2134,7 +2134,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2154,7 +2154,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/new.release.wat b/tests/compiler/new.release.wat index 72c7e35eda..f99abb0702 100644 --- a/tests/compiler/new.release.wat +++ b/tests/compiler/new.release.wat @@ -5,7 +5,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $new/ref (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -650,20 +650,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -688,7 +685,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -716,18 +713,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -737,10 +735,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -754,13 +752,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -839,8 +837,9 @@ i32.const 34256 i32.const 35828 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34256 global.set $~lib/rt/tlsf/ROOT @@ -1081,7 +1080,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1270,8 +1269,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1280,7 +1280,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1295,7 +1295,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.debug.wat b/tests/compiler/object-literal.debug.wat index 9a31a33122..b520990ae2 100644 --- a/tests/compiler/object-literal.debug.wat +++ b/tests/compiler/object-literal.debug.wat @@ -7,14 +7,15 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_=>_f64 (func (param i32) (result f64))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_=>_i64 (func (param i32) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_=>_f32 (func (param i32) (result f32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -1106,32 +1107,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1156,8 +1155,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1177,7 +1176,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1210,7 +1209,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1266,11 +1265,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1416,8 +1415,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1453,7 +1453,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1782,7 +1782,7 @@ if i32.const 288 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2084,8 +2084,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2225,7 +2226,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2245,7 +2246,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.release.wat b/tests/compiler/object-literal.release.wat index 8dd4739af3..18760fe16f 100644 --- a/tests/compiler/object-literal.release.wat +++ b/tests/compiler/object-literal.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -624,20 +624,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -662,7 +659,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -690,18 +687,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -711,10 +709,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -728,13 +726,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -813,8 +811,9 @@ i32.const 34528 i32.const 36100 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34528 global.set $~lib/rt/tlsf/ROOT @@ -856,7 +855,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1228,7 +1227,7 @@ if i32.const 1312 i32.const 1440 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1307,8 +1306,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $3 @@ -1318,7 +1318,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1333,7 +1333,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/optional-typeparameters.debug.wat b/tests/compiler/optional-typeparameters.debug.wat index 40be808299..39e9976fbe 100644 --- a/tests/compiler/optional-typeparameters.debug.wat +++ b/tests/compiler/optional-typeparameters.debug.wat @@ -5,9 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f64_f64_=>_f64 (func (param i32 f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1022,32 +1023,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1072,8 +1071,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1093,7 +1092,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1126,7 +1125,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1182,11 +1181,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1332,8 +1331,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1369,7 +1369,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1698,7 +1698,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2000,8 +2000,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2141,7 +2142,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2161,7 +2162,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/optional-typeparameters.release.wat b/tests/compiler/optional-typeparameters.release.wat index 8ed9b7e499..59d641d65d 100644 --- a/tests/compiler/optional-typeparameters.release.wat +++ b/tests/compiler/optional-typeparameters.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -636,20 +636,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -674,7 +671,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -702,18 +699,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -723,10 +721,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -740,13 +738,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -825,8 +823,9 @@ i32.const 34256 i32.const 35828 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34256 global.set $~lib/rt/tlsf/ROOT @@ -1067,7 +1066,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1256,8 +1255,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1266,7 +1266,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1281,7 +1281,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/reexport.debug.wat b/tests/compiler/reexport.debug.wat index e038e8ea57..b1c039ccac 100644 --- a/tests/compiler/reexport.debug.wat +++ b/tests/compiler/reexport.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1056,32 +1056,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1106,8 +1104,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1127,7 +1125,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1160,7 +1158,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1216,11 +1214,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1366,8 +1364,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1403,7 +1402,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1732,7 +1731,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2034,8 +2033,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2175,7 +2175,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2195,7 +2195,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/reexport.release.wat b/tests/compiler/reexport.release.wat index d6091d1ac5..9baabf7a00 100644 --- a/tests/compiler/reexport.release.wat +++ b/tests/compiler/reexport.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -643,20 +643,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -681,7 +678,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -709,18 +706,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -730,10 +728,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -747,13 +745,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -832,8 +830,9 @@ i32.const 34288 i32.const 35860 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34288 global.set $~lib/rt/tlsf/ROOT @@ -1074,7 +1073,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1263,8 +1262,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1273,7 +1273,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1288,7 +1288,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rereexport.debug.wat b/tests/compiler/rereexport.debug.wat index d2742f5251..7cdcb0dad0 100644 --- a/tests/compiler/rereexport.debug.wat +++ b/tests/compiler/rereexport.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1049,32 +1049,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1099,8 +1097,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1120,7 +1118,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1153,7 +1151,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1209,11 +1207,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1359,8 +1357,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1396,7 +1395,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1725,7 +1724,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2027,8 +2026,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2168,7 +2168,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2188,7 +2188,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rereexport.release.wat b/tests/compiler/rereexport.release.wat index f02fc42b88..61f2435b7e 100644 --- a/tests/compiler/rereexport.release.wat +++ b/tests/compiler/rereexport.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -641,20 +641,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -679,7 +676,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -707,18 +704,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -728,10 +726,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -745,13 +743,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -830,8 +828,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1072,7 +1071,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1261,8 +1260,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1271,7 +1271,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1286,7 +1286,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-access.debug.wat b/tests/compiler/resolve-access.debug.wat index 994159c4f5..8d2e51b106 100644 --- a/tests/compiler/resolve-access.debug.wat +++ b/tests/compiler/resolve-access.debug.wat @@ -7,9 +7,10 @@ (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i64_=>_none (func (param i32 i64))) @@ -1030,32 +1031,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1080,8 +1079,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1101,7 +1100,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1134,7 +1133,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1190,11 +1189,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1340,8 +1339,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1377,7 +1377,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1706,7 +1706,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2008,8 +2008,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2149,7 +2150,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2169,7 +2170,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-access.release.wat b/tests/compiler/resolve-access.release.wat index b17de4fab5..0482bf6e60 100644 --- a/tests/compiler/resolve-access.release.wat +++ b/tests/compiler/resolve-access.release.wat @@ -3,9 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -631,20 +632,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -669,7 +667,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -697,18 +695,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -718,10 +717,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -735,13 +734,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -820,8 +819,9 @@ i32.const 36096 i32.const 37668 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 36096 global.set $~lib/rt/tlsf/ROOT @@ -1062,7 +1062,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1297,7 +1297,7 @@ if i32.const 1088 i32.const 1424 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1376,8 +1376,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1387,7 +1388,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1402,7 +1403,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-binary.debug.wat b/tests/compiler/resolve-binary.debug.wat index 8cef9d7888..ff19ed12e8 100644 --- a/tests/compiler/resolve-binary.debug.wat +++ b/tests/compiler/resolve-binary.debug.wat @@ -5,15 +5,16 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) @@ -1250,32 +1251,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 720 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1300,8 +1299,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1321,7 +1320,7 @@ if i32.const 0 i32.const 720 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1354,7 +1353,7 @@ if i32.const 0 i32.const 720 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1410,11 +1409,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1560,8 +1559,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1597,7 +1597,7 @@ if i32.const 0 i32.const 720 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1926,7 +1926,7 @@ if i32.const 384 i32.const 720 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2228,8 +2228,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2369,7 +2370,7 @@ if i32.const 0 i32.const 720 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2389,7 +2390,7 @@ if i32.const 0 i32.const 720 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-binary.release.wat b/tests/compiler/resolve-binary.release.wat index 0835b4cfb4..030896d69b 100644 --- a/tests/compiler/resolve-binary.release.wat +++ b/tests/compiler/resolve-binary.release.wat @@ -4,9 +4,10 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_i64_i32_i64_=>_i32 (func (param i64 i64 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-binary/a (mut i32) (i32.const 0)) @@ -840,20 +841,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1744 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -878,7 +876,7 @@ if i32.const 0 i32.const 1744 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -906,18 +904,19 @@ if i32.const 0 i32.const 1744 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -927,10 +926,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -944,13 +943,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1029,8 +1028,9 @@ i32.const 44016 i32.const 45588 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 44016 global.set $~lib/rt/tlsf/ROOT @@ -1271,7 +1271,7 @@ if i32.const 0 i32.const 1744 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1506,7 +1506,7 @@ if i32.const 1408 i32.const 1744 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1585,8 +1585,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1596,7 +1597,7 @@ if i32.const 0 i32.const 1744 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1611,7 +1612,7 @@ if i32.const 0 i32.const 1744 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-elementaccess.debug.wat b/tests/compiler/resolve-elementaccess.debug.wat index a5ce7426ab..1dc9378ea1 100644 --- a/tests/compiler/resolve-elementaccess.debug.wat +++ b/tests/compiler/resolve-elementaccess.debug.wat @@ -7,6 +7,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) @@ -1053,32 +1054,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 480 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1103,8 +1102,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1124,7 +1123,7 @@ if i32.const 0 i32.const 480 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1157,7 +1156,7 @@ if i32.const 0 i32.const 480 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1213,11 +1212,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1363,8 +1362,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1400,7 +1400,7 @@ if i32.const 0 i32.const 480 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1729,7 +1729,7 @@ if i32.const 144 i32.const 480 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2031,8 +2031,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2172,7 +2173,7 @@ if i32.const 0 i32.const 480 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2192,7 +2193,7 @@ if i32.const 0 i32.const 480 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-elementaccess.release.wat b/tests/compiler/resolve-elementaccess.release.wat index 8c569dfc68..1951c93145 100644 --- a/tests/compiler/resolve-elementaccess.release.wat +++ b/tests/compiler/resolve-elementaccess.release.wat @@ -5,6 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i64_i64_i32_i64_i32_=>_i32 (func (param i64 i64 i32 i64 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -683,20 +684,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1504 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -721,7 +719,7 @@ if i32.const 0 i32.const 1504 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -749,18 +747,19 @@ if i32.const 0 i32.const 1504 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -770,10 +769,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -787,13 +786,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -872,8 +871,9 @@ i32.const 37600 i32.const 39172 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 37600 global.set $~lib/rt/tlsf/ROOT @@ -1114,7 +1114,7 @@ if i32.const 0 i32.const 1504 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1349,7 +1349,7 @@ if i32.const 1168 i32.const 1504 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1428,8 +1428,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1439,7 +1440,7 @@ if i32.const 0 i32.const 1504 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1454,7 +1455,7 @@ if i32.const 0 i32.const 1504 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-function-expression.debug.wat b/tests/compiler/resolve-function-expression.debug.wat index 82683c31a3..94f52e0a6d 100644 --- a/tests/compiler/resolve-function-expression.debug.wat +++ b/tests/compiler/resolve-function-expression.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) @@ -1097,32 +1097,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 768 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1147,8 +1145,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1168,7 +1166,7 @@ if i32.const 0 i32.const 768 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1201,7 +1199,7 @@ if i32.const 0 i32.const 768 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1257,11 +1255,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1407,8 +1405,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1444,7 +1443,7 @@ if i32.const 0 i32.const 768 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1773,7 +1772,7 @@ if i32.const 432 i32.const 768 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2075,8 +2074,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2216,7 +2216,7 @@ if i32.const 0 i32.const 768 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2236,7 +2236,7 @@ if i32.const 0 i32.const 768 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-function-expression.release.wat b/tests/compiler/resolve-function-expression.release.wat index 01dcc2860b..733cf16d8e 100644 --- a/tests/compiler/resolve-function-expression.release.wat +++ b/tests/compiler/resolve-function-expression.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -651,20 +651,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1792 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -689,7 +686,7 @@ if i32.const 0 i32.const 1792 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -717,18 +714,19 @@ if i32.const 0 i32.const 1792 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -738,10 +736,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -755,13 +753,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -840,8 +838,9 @@ i32.const 36224 i32.const 37796 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 36224 global.set $~lib/rt/tlsf/ROOT @@ -1082,7 +1081,7 @@ if i32.const 0 i32.const 1792 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1415,7 +1414,7 @@ if i32.const 1456 i32.const 1792 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1494,8 +1493,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $7 local.get $8 @@ -1505,7 +1505,7 @@ if i32.const 0 i32.const 1792 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1520,7 +1520,7 @@ if i32.const 0 i32.const 1792 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-new.debug.wat b/tests/compiler/resolve-new.debug.wat index 867908c1a7..75e158d7ce 100644 --- a/tests/compiler/resolve-new.debug.wat +++ b/tests/compiler/resolve-new.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1010,32 +1010,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1060,8 +1058,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1081,7 +1079,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1114,7 +1112,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1170,11 +1168,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1320,8 +1318,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1357,7 +1356,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1686,7 +1685,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1988,8 +1987,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2129,7 +2129,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2149,7 +2149,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-new.release.wat b/tests/compiler/resolve-new.release.wat index 33dc3e6c0c..6b37e50151 100644 --- a/tests/compiler/resolve-new.release.wat +++ b/tests/compiler/resolve-new.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -615,20 +615,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -653,7 +650,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -681,18 +678,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -702,10 +700,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -719,13 +717,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -804,8 +802,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1046,7 +1045,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1235,8 +1234,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1245,7 +1245,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1260,7 +1260,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-propertyaccess.debug.wat b/tests/compiler/resolve-propertyaccess.debug.wat index 86bd4819cc..18abec093b 100644 --- a/tests/compiler/resolve-propertyaccess.debug.wat +++ b/tests/compiler/resolve-propertyaccess.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) @@ -1097,32 +1097,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 592 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1147,8 +1145,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1168,7 +1166,7 @@ if i32.const 0 i32.const 592 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1201,7 +1199,7 @@ if i32.const 0 i32.const 592 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1257,11 +1255,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1407,8 +1405,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1444,7 +1443,7 @@ if i32.const 0 i32.const 592 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1773,7 +1772,7 @@ if i32.const 256 i32.const 592 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2075,8 +2074,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2216,7 +2216,7 @@ if i32.const 0 i32.const 592 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2236,7 +2236,7 @@ if i32.const 0 i32.const 592 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-propertyaccess.release.wat b/tests/compiler/resolve-propertyaccess.release.wat index d3d380ac1c..83043d29eb 100644 --- a/tests/compiler/resolve-propertyaccess.release.wat +++ b/tests/compiler/resolve-propertyaccess.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -650,20 +650,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1616 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -688,7 +685,7 @@ if i32.const 0 i32.const 1616 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -716,18 +713,19 @@ if i32.const 0 i32.const 1616 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -737,10 +735,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -754,13 +752,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -839,8 +837,9 @@ i32.const 36480 i32.const 38052 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 36480 global.set $~lib/rt/tlsf/ROOT @@ -1081,7 +1080,7 @@ if i32.const 0 i32.const 1616 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1316,7 +1315,7 @@ if i32.const 1280 i32.const 1616 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1395,8 +1394,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1406,7 +1406,7 @@ if i32.const 0 i32.const 1616 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1421,7 +1421,7 @@ if i32.const 0 i32.const 1616 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.debug.wat b/tests/compiler/resolve-ternary.debug.wat index c26d7579c0..821f870592 100644 --- a/tests/compiler/resolve-ternary.debug.wat +++ b/tests/compiler/resolve-ternary.debug.wat @@ -5,14 +5,15 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) @@ -1104,32 +1105,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 592 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1154,8 +1153,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1175,7 +1174,7 @@ if i32.const 0 i32.const 592 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1208,7 +1207,7 @@ if i32.const 0 i32.const 592 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1264,11 +1263,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1414,8 +1413,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1451,7 +1451,7 @@ if i32.const 0 i32.const 592 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1780,7 +1780,7 @@ if i32.const 256 i32.const 592 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2082,8 +2082,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2223,7 +2224,7 @@ if i32.const 0 i32.const 592 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2243,7 +2244,7 @@ if i32.const 0 i32.const 592 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.release.wat b/tests/compiler/resolve-ternary.release.wat index 6e4587a7d2..6cf4ecb8c6 100644 --- a/tests/compiler/resolve-ternary.release.wat +++ b/tests/compiler/resolve-ternary.release.wat @@ -4,9 +4,10 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_i64_i32_i64_=>_i32 (func (param i64 i64 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -655,20 +656,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1616 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -693,7 +691,7 @@ if i32.const 0 i32.const 1616 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -721,18 +719,19 @@ if i32.const 0 i32.const 1616 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -742,10 +741,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -759,13 +758,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -844,8 +843,9 @@ i32.const 37408 i32.const 38980 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 37408 global.set $~lib/rt/tlsf/ROOT @@ -1086,7 +1086,7 @@ if i32.const 0 i32.const 1616 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1321,7 +1321,7 @@ if i32.const 1280 i32.const 1616 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1400,8 +1400,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $3 local.get $4 @@ -1411,7 +1412,7 @@ if i32.const 0 i32.const 1616 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1426,7 +1427,7 @@ if i32.const 0 i32.const 1616 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-unary.debug.wat b/tests/compiler/resolve-unary.debug.wat index 0c320f6ec8..8050d737ca 100644 --- a/tests/compiler/resolve-unary.debug.wat +++ b/tests/compiler/resolve-unary.debug.wat @@ -6,7 +6,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) @@ -1097,32 +1097,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 592 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1147,8 +1145,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1168,7 +1166,7 @@ if i32.const 0 i32.const 592 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1201,7 +1199,7 @@ if i32.const 0 i32.const 592 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1257,11 +1255,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1407,8 +1405,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1444,7 +1443,7 @@ if i32.const 0 i32.const 592 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1773,7 +1772,7 @@ if i32.const 256 i32.const 592 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2075,8 +2074,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2216,7 +2216,7 @@ if i32.const 0 i32.const 592 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2236,7 +2236,7 @@ if i32.const 0 i32.const 592 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-unary.release.wat b/tests/compiler/resolve-unary.release.wat index e79a5049af..c9f0c6ac9f 100644 --- a/tests/compiler/resolve-unary.release.wat +++ b/tests/compiler/resolve-unary.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -676,20 +676,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1616 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -714,7 +711,7 @@ if i32.const 0 i32.const 1616 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -742,18 +739,19 @@ if i32.const 0 i32.const 1616 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -763,10 +761,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -780,13 +778,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -865,8 +863,9 @@ i32.const 36640 i32.const 38212 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 36640 global.set $~lib/rt/tlsf/ROOT @@ -1107,7 +1106,7 @@ if i32.const 0 i32.const 1616 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1342,7 +1341,7 @@ if i32.const 1280 i32.const 1616 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1421,8 +1420,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1432,7 +1432,7 @@ if i32.const 0 i32.const 1616 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1447,7 +1447,7 @@ if i32.const 0 i32.const 1616 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/return-unreachable.debug.wat b/tests/compiler/return-unreachable.debug.wat index 484ee54a4b..d74a223b13 100644 --- a/tests/compiler/return-unreachable.debug.wat +++ b/tests/compiler/return-unreachable.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) @@ -1013,32 +1013,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 464 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1063,8 +1061,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1084,7 +1082,7 @@ if i32.const 0 i32.const 464 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1117,7 +1115,7 @@ if i32.const 0 i32.const 464 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1173,11 +1171,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1323,8 +1321,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1360,7 +1359,7 @@ if i32.const 0 i32.const 464 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1689,7 +1688,7 @@ if i32.const 128 i32.const 464 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1991,8 +1990,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2132,7 +2132,7 @@ if i32.const 0 i32.const 464 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2152,7 +2152,7 @@ if i32.const 0 i32.const 464 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/return-unreachable.release.wat b/tests/compiler/return-unreachable.release.wat index 556e651b83..3242386a34 100644 --- a/tests/compiler/return-unreachable.release.wat +++ b/tests/compiler/return-unreachable.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -616,20 +616,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1488 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -654,7 +651,7 @@ if i32.const 0 i32.const 1488 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -682,18 +679,19 @@ if i32.const 0 i32.const 1488 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -703,10 +701,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -720,13 +718,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -805,8 +803,9 @@ i32.const 34336 i32.const 35908 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34336 global.set $~lib/rt/tlsf/ROOT @@ -1047,7 +1046,7 @@ if i32.const 0 i32.const 1488 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1282,7 +1281,7 @@ if i32.const 1152 i32.const 1488 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1361,8 +1360,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1372,7 +1372,7 @@ if i32.const 0 i32.const 1488 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1387,7 +1387,7 @@ if i32.const 0 i32.const 1488 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/alloc-large-memory.debug.wat b/tests/compiler/rt/alloc-large-memory.debug.wat index b21bddbf59..a2586176b7 100644 --- a/tests/compiler/rt/alloc-large-memory.debug.wat +++ b/tests/compiler/rt/alloc-large-memory.debug.wat @@ -4,7 +4,7 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -13,8 +13,8 @@ (global $~lib/memory/__stack_pointer (mut i32) (i32.const 32908)) (global $~lib/memory/__heap_base i32 (i32.const 32908)) (memory $0 1) - (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") + (data $0 (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data $1 (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") (table $0 1 1 funcref) (elem $0 (i32.const 1)) (export "memory" (memory $0)) @@ -655,32 +655,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 32 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -705,8 +703,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -726,7 +724,7 @@ if i32.const 0 i32.const 32 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -759,7 +757,7 @@ if i32.const 0 i32.const 32 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -815,11 +813,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -965,8 +963,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1000,7 +999,7 @@ if i32.const 96 i32.const 32 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1302,8 +1301,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -1443,7 +1443,7 @@ if i32.const 0 i32.const 32 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1463,7 +1463,7 @@ if i32.const 0 i32.const 32 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/alloc-large-memory.release.wat b/tests/compiler/rt/alloc-large-memory.release.wat index d73c209ce4..52be1f0c56 100644 --- a/tests/compiler/rt/alloc-large-memory.release.wat +++ b/tests/compiler/rt/alloc-large-memory.release.wat @@ -1,17 +1,17 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (memory $0 1) - (data (i32.const 1036) "<") - (data (i32.const 1048) "\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 1100) "<") - (data (i32.const 1112) "\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data $0 (i32.const 1036) "<") + (data $0.1 (i32.const 1048) "\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data $1 (i32.const 1100) "<") + (data $1.1 (i32.const 1112) "\02\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") (export "memory" (memory $0)) (start $~start) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) @@ -413,20 +413,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1056 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -451,7 +448,7 @@ if i32.const 0 i32.const 1056 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -479,18 +476,19 @@ if i32.const 0 i32.const 1056 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -500,10 +498,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -517,13 +515,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -733,8 +731,9 @@ i32.const 33936 i32.const 35508 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 33936 global.set $~lib/rt/tlsf/ROOT @@ -747,7 +746,7 @@ if i32.const 1120 i32.const 1056 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -826,8 +825,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $3 local.get $0 @@ -837,7 +837,7 @@ if i32.const 0 i32.const 1056 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -852,7 +852,7 @@ if i32.const 0 i32.const 1056 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/finalize.debug.wat b/tests/compiler/rt/finalize.debug.wat index b84bbcd2b7..06dbe11c5e 100644 --- a/tests/compiler/rt/finalize.debug.wat +++ b/tests/compiler/rt/finalize.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $rt/finalize/expect (mut i32) (i32.const 0)) @@ -1029,32 +1029,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1079,8 +1077,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1100,7 +1098,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1133,7 +1131,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1189,11 +1187,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1339,8 +1337,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1376,7 +1375,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1709,7 +1708,7 @@ if i32.const 32 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2011,8 +2010,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2152,7 +2152,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2172,7 +2172,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/finalize.release.wat b/tests/compiler/rt/finalize.release.wat index 1421fd86cf..eb2ad2c237 100644 --- a/tests/compiler/rt/finalize.release.wat +++ b/tests/compiler/rt/finalize.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $rt/finalize/expect (mut i32) (i32.const 0)) @@ -613,20 +613,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -651,7 +648,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -679,18 +676,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -700,10 +698,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -717,13 +715,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -802,8 +800,9 @@ i32.const 34288 i32.const 35860 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34288 global.set $~lib/rt/tlsf/ROOT @@ -1059,7 +1058,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1248,8 +1247,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1258,7 +1258,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1273,7 +1273,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/runtime-incremental-export.debug.wat b/tests/compiler/rt/runtime-incremental-export.debug.wat index 19aebb2f07..8f69345eb5 100644 --- a/tests/compiler/rt/runtime-incremental-export.debug.wat +++ b/tests/compiler/rt/runtime-incremental-export.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1016,32 +1016,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1066,8 +1064,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1087,7 +1085,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1120,7 +1118,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1176,11 +1174,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1326,8 +1324,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1363,7 +1362,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1692,7 +1691,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1994,8 +1993,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2135,7 +2135,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2155,7 +2155,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/runtime-incremental-export.release.wat b/tests/compiler/rt/runtime-incremental-export.release.wat index 9effd21443..caf4fb6744 100644 --- a/tests/compiler/rt/runtime-incremental-export.release.wat +++ b/tests/compiler/rt/runtime-incremental-export.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -625,20 +625,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -663,7 +660,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -691,18 +688,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -712,10 +710,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -729,13 +727,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -814,8 +812,9 @@ i32.const 34368 i32.const 35940 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34368 global.set $~lib/rt/tlsf/ROOT @@ -1056,7 +1055,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1291,7 +1290,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1370,8 +1369,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1381,7 +1381,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1396,7 +1396,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/runtime-minimal-export.debug.wat b/tests/compiler/rt/runtime-minimal-export.debug.wat index 08a64fb2bc..54358318b2 100644 --- a/tests/compiler/rt/runtime-minimal-export.debug.wat +++ b/tests/compiler/rt/runtime-minimal-export.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) @@ -672,32 +672,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 160 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -722,8 +720,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -743,7 +741,7 @@ if i32.const 0 i32.const 160 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -776,7 +774,7 @@ if i32.const 0 i32.const 160 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -832,11 +830,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -982,8 +980,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1017,7 +1016,7 @@ if i32.const 32 i32.const 160 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1319,8 +1318,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -1460,7 +1460,7 @@ if i32.const 0 i32.const 160 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1480,7 +1480,7 @@ if i32.const 0 i32.const 160 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable @@ -1791,7 +1791,7 @@ if i32.const 0 i32.const 160 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/runtime-minimal-export.release.wat b/tests/compiler/rt/runtime-minimal-export.release.wat index 1d2a716de4..75dd8c40f7 100644 --- a/tests/compiler/rt/runtime-minimal-export.release.wat +++ b/tests/compiler/rt/runtime-minimal-export.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -432,20 +432,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1184 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -470,7 +467,7 @@ if i32.const 0 i32.const 1184 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -498,18 +495,19 @@ if i32.const 0 i32.const 1184 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -519,10 +517,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -536,13 +534,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -621,8 +619,9 @@ i32.const 1488 i32.const 3060 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 1488 global.set $~lib/rt/tlsf/ROOT @@ -786,7 +785,7 @@ if i32.const 1056 i32.const 1184 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -865,8 +864,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -876,7 +876,7 @@ if i32.const 0 i32.const 1184 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -891,7 +891,7 @@ if i32.const 0 i32.const 1184 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable @@ -1338,7 +1338,7 @@ if i32.const 0 i32.const 1184 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.debug.wat b/tests/compiler/simd.debug.wat index bac19bf5fc..6e5e3bd2ff 100644 --- a/tests/compiler/simd.debug.wat +++ b/tests/compiler/simd.debug.wat @@ -6,9 +6,10 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_v128 (func (param i32 i32 i32) (result v128))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_v128 (func (result v128))) (type $v128_=>_v128 (func (param v128) (result v128))) (type $i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_i32_=>_v128 (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result v128))) @@ -1048,32 +1049,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1098,8 +1097,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1119,7 +1118,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1152,7 +1151,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1208,11 +1207,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1358,8 +1357,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1395,7 +1395,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1724,7 +1724,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2026,8 +2026,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2167,7 +2168,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2187,7 +2188,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/simd.release.wat b/tests/compiler/simd.release.wat index da7e4d3194..f21a01e086 100644 --- a/tests/compiler/simd.release.wat +++ b/tests/compiler/simd.release.wat @@ -5,7 +5,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $v128_=>_v128 (func (param v128) (result v128))) @@ -641,20 +641,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -679,7 +676,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -707,18 +704,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -728,10 +726,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -745,13 +743,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -830,8 +828,9 @@ i32.const 34384 i32.const 35956 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34384 global.set $~lib/rt/tlsf/ROOT @@ -873,7 +872,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1245,7 +1244,7 @@ if i32.const 1104 i32.const 1440 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1324,8 +1323,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $3 @@ -1335,7 +1335,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1350,7 +1350,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.debug.wat b/tests/compiler/std/array-literal.debug.wat index b736993aa7..0deecacc2b 100644 --- a/tests/compiler/std/array-literal.debug.wat +++ b/tests/compiler/std/array-literal.debug.wat @@ -6,8 +6,9 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/array-literal/staticArrayI8 i32 (i32.const 64)) @@ -1044,32 +1045,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 720 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1094,8 +1093,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1115,7 +1114,7 @@ if i32.const 0 i32.const 720 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1148,7 +1147,7 @@ if i32.const 0 i32.const 720 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1204,11 +1203,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1354,8 +1353,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1391,7 +1391,7 @@ if i32.const 0 i32.const 720 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1720,7 +1720,7 @@ if i32.const 448 i32.const 720 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2022,8 +2022,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2163,7 +2164,7 @@ if i32.const 0 i32.const 720 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2183,7 +2184,7 @@ if i32.const 0 i32.const 720 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.release.wat b/tests/compiler/std/array-literal.release.wat index accd1042fe..ae18a3e5d8 100644 --- a/tests/compiler/std/array-literal.release.wat +++ b/tests/compiler/std/array-literal.release.wat @@ -1,11 +1,12 @@ (module - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -670,20 +671,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1744 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -708,7 +706,7 @@ if i32.const 0 i32.const 1744 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -736,18 +734,19 @@ if i32.const 0 i32.const 1744 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -757,10 +756,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -774,13 +773,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -859,8 +858,9 @@ i32.const 34656 i32.const 36228 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34656 global.set $~lib/rt/tlsf/ROOT @@ -1101,7 +1101,7 @@ if i32.const 0 i32.const 1744 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1336,7 +1336,7 @@ if i32.const 1472 i32.const 1744 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1415,8 +1415,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1426,7 +1427,7 @@ if i32.const 0 i32.const 1744 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1441,7 +1442,7 @@ if i32.const 0 i32.const 1744 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.debug.wat b/tests/compiler/std/array.debug.wat index 7fcab89607..c369626cc6 100644 --- a/tests/compiler/std/array.debug.wat +++ b/tests/compiler/std/array.debug.wat @@ -22,6 +22,7 @@ (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_f32_i32_i32_=>_none (func (param i32 i32 f32 i32 i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) @@ -1353,32 +1354,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 464 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1403,8 +1402,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1424,7 +1423,7 @@ if i32.const 0 i32.const 464 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1457,7 +1456,7 @@ if i32.const 0 i32.const 464 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1513,11 +1512,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1663,8 +1662,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1700,7 +1700,7 @@ if i32.const 0 i32.const 464 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2029,7 +2029,7 @@ if i32.const 128 i32.const 464 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2331,8 +2331,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2472,7 +2473,7 @@ if i32.const 0 i32.const 464 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2492,7 +2493,7 @@ if i32.const 0 i32.const 464 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.release.wat b/tests/compiler/std/array.release.wat index b9876c8850..a4ec0c631e 100644 --- a/tests/compiler/std/array.release.wat +++ b/tests/compiler/std/array.release.wat @@ -17,6 +17,7 @@ (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i64_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i64 i32 i64 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_f32_i32_i32_=>_none (func (param i32 f32 i32 i32))) @@ -1265,20 +1266,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1488 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1303,7 +1301,7 @@ if i32.const 0 i32.const 1488 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1331,18 +1329,19 @@ if i32.const 0 i32.const 1488 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -1352,10 +1351,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -1369,13 +1368,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1454,8 +1453,9 @@ i32.const 48960 i32.const 50532 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 48960 global.set $~lib/rt/tlsf/ROOT @@ -1497,7 +1497,7 @@ if i32.const 0 i32.const 1488 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1869,7 +1869,7 @@ if i32.const 1152 i32.const 1488 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1948,8 +1948,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $3 @@ -1959,7 +1960,7 @@ if i32.const 0 i32.const 1488 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1974,7 +1975,7 @@ if i32.const 0 i32.const 1488 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.debug.wat b/tests/compiler/std/arraybuffer.debug.wat index abc218b660..c530705661 100644 --- a/tests/compiler/std/arraybuffer.debug.wat +++ b/tests/compiler/std/arraybuffer.debug.wat @@ -4,10 +4,11 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) @@ -1017,32 +1018,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 480 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1067,8 +1066,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1088,7 +1087,7 @@ if i32.const 0 i32.const 480 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1121,7 +1120,7 @@ if i32.const 0 i32.const 480 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1177,11 +1176,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1327,8 +1326,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1364,7 +1364,7 @@ if i32.const 0 i32.const 480 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1693,7 +1693,7 @@ if i32.const 144 i32.const 480 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1995,8 +1995,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2136,7 +2137,7 @@ if i32.const 0 i32.const 480 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2156,7 +2157,7 @@ if i32.const 0 i32.const 480 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.release.wat b/tests/compiler/std/arraybuffer.release.wat index 22c7fa7b92..4721f6b330 100644 --- a/tests/compiler/std/arraybuffer.release.wat +++ b/tests/compiler/std/arraybuffer.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -622,20 +622,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1504 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -660,7 +657,7 @@ if i32.const 0 i32.const 1504 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -688,18 +685,19 @@ if i32.const 0 i32.const 1504 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -709,10 +707,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -726,13 +724,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -811,8 +809,9 @@ i32.const 34560 i32.const 36132 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34560 global.set $~lib/rt/tlsf/ROOT @@ -1053,7 +1052,7 @@ if i32.const 0 i32.const 1504 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1288,7 +1287,7 @@ if i32.const 1168 i32.const 1504 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1367,8 +1366,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1378,7 +1378,7 @@ if i32.const 0 i32.const 1504 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1393,7 +1393,7 @@ if i32.const 0 i32.const 1504 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.debug.wat b/tests/compiler/std/dataview.debug.wat index 3b19178e5e..473b0b0151 100644 --- a/tests/compiler/std/dataview.debug.wat +++ b/tests/compiler/std/dataview.debug.wat @@ -3,13 +3,14 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) (type $i32_i32_i64_i32_=>_none (func (param i32 i32 i64 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i32_i32_i32_=>_f64 (func (param i32 i32 i32) (result f64))) @@ -1023,32 +1024,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 480 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1073,8 +1072,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1094,7 +1093,7 @@ if i32.const 0 i32.const 480 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1127,7 +1126,7 @@ if i32.const 0 i32.const 480 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1183,11 +1182,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1333,8 +1332,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1370,7 +1370,7 @@ if i32.const 0 i32.const 480 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1699,7 +1699,7 @@ if i32.const 144 i32.const 480 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2001,8 +2001,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2142,7 +2143,7 @@ if i32.const 0 i32.const 480 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2162,7 +2163,7 @@ if i32.const 0 i32.const 480 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.release.wat b/tests/compiler/std/dataview.release.wat index 5707da84a2..656ba6b9f3 100644 --- a/tests/compiler/std/dataview.release.wat +++ b/tests/compiler/std/dataview.release.wat @@ -8,6 +8,7 @@ (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) @@ -629,20 +630,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1504 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -667,7 +665,7 @@ if i32.const 0 i32.const 1504 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -695,18 +693,19 @@ if i32.const 0 i32.const 1504 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -716,10 +715,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -733,13 +732,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -818,8 +817,9 @@ i32.const 34544 i32.const 36116 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34544 global.set $~lib/rt/tlsf/ROOT @@ -1060,7 +1060,7 @@ if i32.const 0 i32.const 1504 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1295,7 +1295,7 @@ if i32.const 1168 i32.const 1504 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1374,8 +1374,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1385,7 +1386,7 @@ if i32.const 0 i32.const 1504 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1400,7 +1401,7 @@ if i32.const 0 i32.const 1504 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/date.debug.wat b/tests/compiler/std/date.debug.wat index 24edf3b56e..bec755f84e 100644 --- a/tests/compiler/std/date.debug.wat +++ b/tests/compiler/std/date.debug.wat @@ -10,6 +10,7 @@ (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_=>_i64 (func (param i32) (result i64))) @@ -1401,32 +1402,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 512 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1451,8 +1450,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1472,7 +1471,7 @@ if i32.const 0 i32.const 512 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1505,7 +1504,7 @@ if i32.const 0 i32.const 512 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1561,11 +1560,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1711,8 +1710,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1748,7 +1748,7 @@ if i32.const 0 i32.const 512 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2077,7 +2077,7 @@ if i32.const 176 i32.const 512 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2379,8 +2379,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2520,7 +2521,7 @@ if i32.const 0 i32.const 512 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2540,7 +2541,7 @@ if i32.const 0 i32.const 512 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/date.release.wat b/tests/compiler/std/date.release.wat index 294fdcc7bd..32d84a1f6a 100644 --- a/tests/compiler/std/date.release.wat +++ b/tests/compiler/std/date.release.wat @@ -4,11 +4,12 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i64_=>_i64 (func (param i32 i32 i32 i64) (result i64))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) @@ -995,20 +996,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1536 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1033,7 +1031,7 @@ if i32.const 0 i32.const 1536 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1061,18 +1059,19 @@ if i32.const 0 i32.const 1536 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -1082,10 +1081,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -1099,13 +1098,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1184,8 +1183,9 @@ i32.const 40608 i32.const 42180 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 40608 global.set $~lib/rt/tlsf/ROOT @@ -1426,7 +1426,7 @@ if i32.const 0 i32.const 1536 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1661,7 +1661,7 @@ if i32.const 1200 i32.const 1536 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1740,8 +1740,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1751,7 +1752,7 @@ if i32.const 0 i32.const 1536 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1766,7 +1767,7 @@ if i32.const 0 i32.const 1536 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.debug.wat b/tests/compiler/std/map.debug.wat index c706959ea1..01a174d157 100644 --- a/tests/compiler/std/map.debug.wat +++ b/tests/compiler/std/map.debug.wat @@ -23,6 +23,7 @@ (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) @@ -1040,32 +1041,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1090,8 +1089,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1111,7 +1110,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1144,7 +1143,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1200,11 +1199,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1350,8 +1349,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1387,7 +1387,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1716,7 +1716,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2018,8 +2018,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2159,7 +2160,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2179,7 +2180,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.release.wat b/tests/compiler/std/map.release.wat index ed39c0634d..758503f2bd 100644 --- a/tests/compiler/std/map.release.wat +++ b/tests/compiler/std/map.release.wat @@ -1,13 +1,14 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) @@ -15,7 +16,6 @@ (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) (type $i32_f32_f32_=>_none (func (param i32 f32 f32))) @@ -642,20 +642,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -680,7 +677,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -708,18 +705,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -729,10 +727,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -746,13 +744,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -831,8 +829,9 @@ i32.const 34672 i32.const 36244 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34672 global.set $~lib/rt/tlsf/ROOT @@ -1073,7 +1072,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1308,7 +1307,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1387,8 +1386,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1398,7 +1398,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1413,7 +1413,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/math.release.wat b/tests/compiler/std/math.release.wat index 233a263ee1..2af003d42d 100644 --- a/tests/compiler/std/math.release.wat +++ b/tests/compiler/std/math.release.wat @@ -49900,7 +49900,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -49944,7 +49944,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -49966,7 +49966,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50032,7 +50032,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50098,7 +50098,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50164,7 +50164,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50252,7 +50252,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50362,7 +50362,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -50516,7 +50516,7 @@ call $~lib/builtins/abort unreachable end - f64.const -nan:0x8000000000000 + f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 f64.const 0 call $std/math/check @@ -51748,7 +51748,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51774,7 +51774,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51787,7 +51787,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51826,7 +51826,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51865,7 +51865,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51904,7 +51904,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -51956,7 +51956,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -52021,7 +52021,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check @@ -52047,7 +52047,7 @@ call $~lib/builtins/abort unreachable end - f32.const -nan:0x400000 + f32.const nan:0x400000 f32.const nan:0x400000 f32.const 0 call $std/math/check diff --git a/tests/compiler/std/new.debug.wat b/tests/compiler/std/new.debug.wat index 86a580cb1f..aac8f3b069 100644 --- a/tests/compiler/std/new.debug.wat +++ b/tests/compiler/std/new.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1027,32 +1027,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1077,8 +1075,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1098,7 +1096,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1131,7 +1129,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1187,11 +1185,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1337,8 +1335,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1374,7 +1373,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1703,7 +1702,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2005,8 +2004,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2146,7 +2146,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2166,7 +2166,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/new.release.wat b/tests/compiler/std/new.release.wat index 3001001489..0ca01c2f2c 100644 --- a/tests/compiler/std/new.release.wat +++ b/tests/compiler/std/new.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -615,20 +615,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -653,7 +650,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -681,18 +678,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -702,10 +700,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -719,13 +717,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -804,8 +802,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1046,7 +1045,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1235,8 +1234,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $1 call $~lib/rt/tlsf/searchBlock @@ -1245,7 +1245,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1260,7 +1260,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index ef54d3cd4e..8ad0f46599 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -3,10 +3,11 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1082,32 +1083,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1132,8 +1131,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1153,7 +1152,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1186,7 +1185,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1242,11 +1241,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1392,8 +1391,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1429,7 +1429,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1758,7 +1758,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2060,8 +2060,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2201,7 +2202,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2221,7 +2222,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/operator-overloading.release.wat b/tests/compiler/std/operator-overloading.release.wat index 8190cc2223..909368dfce 100644 --- a/tests/compiler/std/operator-overloading.release.wat +++ b/tests/compiler/std/operator-overloading.release.wat @@ -3,10 +3,11 @@ (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -547,20 +548,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -585,7 +583,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -613,18 +611,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -634,10 +633,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -651,13 +650,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -736,8 +735,9 @@ i32.const 34400 i32.const 35972 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34400 global.set $~lib/rt/tlsf/ROOT @@ -978,7 +978,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1167,8 +1167,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1177,7 +1178,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1192,7 +1193,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.debug.wat b/tests/compiler/std/set.debug.wat index 0f609905e1..a04dae3ba0 100644 --- a/tests/compiler/std/set.debug.wat +++ b/tests/compiler/std/set.debug.wat @@ -16,6 +16,7 @@ (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $i32_=>_f32 (func (param i32) (result f32))) @@ -1035,32 +1036,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1085,8 +1084,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1106,7 +1105,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1139,7 +1138,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1195,11 +1194,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1345,8 +1344,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1382,7 +1382,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1711,7 +1711,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2013,8 +2013,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2154,7 +2155,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2174,7 +2175,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.release.wat b/tests/compiler/std/set.release.wat index 98aecb4643..ad66b0a6d0 100644 --- a/tests/compiler/std/set.release.wat +++ b/tests/compiler/std/set.release.wat @@ -5,16 +5,16 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_=>_none (func (param i32 f64))) - (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) @@ -633,20 +633,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -671,7 +668,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -699,18 +696,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -720,10 +718,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -737,13 +735,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -822,8 +820,9 @@ i32.const 34528 i32.const 36100 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34528 global.set $~lib/rt/tlsf/ROOT @@ -1064,7 +1063,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1299,7 +1298,7 @@ if i32.const 1056 i32.const 1392 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1378,8 +1377,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1389,7 +1389,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1404,7 +1404,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/static-array.debug.wat b/tests/compiler/std/static-array.debug.wat index 8cd10c67ad..e01afe16c2 100644 --- a/tests/compiler/std/static-array.debug.wat +++ b/tests/compiler/std/static-array.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) @@ -1052,32 +1052,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 880 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1102,8 +1100,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1123,7 +1121,7 @@ if i32.const 0 i32.const 880 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1156,7 +1154,7 @@ if i32.const 0 i32.const 880 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1212,11 +1210,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1362,8 +1360,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1399,7 +1398,7 @@ if i32.const 0 i32.const 880 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1728,7 +1727,7 @@ if i32.const 608 i32.const 880 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2030,8 +2029,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2171,7 +2171,7 @@ if i32.const 0 i32.const 880 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2191,7 +2191,7 @@ if i32.const 0 i32.const 880 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/static-array.release.wat b/tests/compiler/std/static-array.release.wat index a3d44e9573..d502efedf2 100644 --- a/tests/compiler/std/static-array.release.wat +++ b/tests/compiler/std/static-array.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i64 (func (param i32) (result i64))) @@ -645,20 +645,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1904 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -683,7 +680,7 @@ if i32.const 0 i32.const 1904 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -711,18 +708,19 @@ if i32.const 0 i32.const 1904 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -732,10 +730,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -749,13 +747,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -834,8 +832,9 @@ i32.const 34768 i32.const 36340 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34768 global.set $~lib/rt/tlsf/ROOT @@ -1076,7 +1075,7 @@ if i32.const 0 i32.const 1904 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1556,7 +1555,7 @@ if i32.const 1632 i32.const 1904 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1635,8 +1634,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $8 @@ -1646,7 +1646,7 @@ if i32.const 0 i32.const 1904 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1661,7 +1661,7 @@ if i32.const 0 i32.const 1904 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.debug.wat b/tests/compiler/std/staticarray.debug.wat index cc9e272749..a3c675da3c 100644 --- a/tests/compiler/std/staticarray.debug.wat +++ b/tests/compiler/std/staticarray.debug.wat @@ -11,6 +11,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) @@ -1112,32 +1113,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 592 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1162,8 +1161,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1183,7 +1182,7 @@ if i32.const 0 i32.const 592 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1216,7 +1215,7 @@ if i32.const 0 i32.const 592 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1272,11 +1271,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1422,8 +1421,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1459,7 +1459,7 @@ if i32.const 0 i32.const 592 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1788,7 +1788,7 @@ if i32.const 320 i32.const 592 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2090,8 +2090,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2231,7 +2232,7 @@ if i32.const 0 i32.const 592 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2251,7 +2252,7 @@ if i32.const 0 i32.const 592 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.release.wat b/tests/compiler/std/staticarray.release.wat index 65af6fcbe3..a04bc8b7d8 100644 --- a/tests/compiler/std/staticarray.release.wat +++ b/tests/compiler/std/staticarray.release.wat @@ -1,14 +1,15 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -758,20 +759,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1616 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -796,7 +794,7 @@ if i32.const 0 i32.const 1616 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -824,18 +822,19 @@ if i32.const 0 i32.const 1616 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -845,10 +844,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -862,13 +861,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -947,8 +946,9 @@ i32.const 36576 i32.const 38148 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 36576 global.set $~lib/rt/tlsf/ROOT @@ -990,7 +990,7 @@ if i32.const 0 i32.const 1616 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1362,7 +1362,7 @@ if i32.const 1344 i32.const 1616 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1441,8 +1441,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $3 @@ -1452,7 +1453,7 @@ if i32.const 0 i32.const 1616 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1467,7 +1468,7 @@ if i32.const 0 i32.const 1616 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.debug.wat b/tests/compiler/std/string-casemapping.debug.wat index 90ae9edfd0..52f384ab23 100644 --- a/tests/compiler/std/string-casemapping.debug.wat +++ b/tests/compiler/std/string-casemapping.debug.wat @@ -8,7 +8,7 @@ (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) @@ -1204,32 +1204,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 400 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1254,8 +1252,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1275,7 +1273,7 @@ if i32.const 0 i32.const 400 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1308,7 +1306,7 @@ if i32.const 0 i32.const 400 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1364,11 +1362,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1514,8 +1512,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1551,7 +1550,7 @@ if i32.const 0 i32.const 400 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1880,7 +1879,7 @@ if i32.const 64 i32.const 400 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2182,8 +2181,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2323,7 +2323,7 @@ if i32.const 0 i32.const 400 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2343,7 +2343,7 @@ if i32.const 0 i32.const 400 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.release.wat b/tests/compiler/std/string-casemapping.release.wat index d296aa00f9..07b351bde9 100644 --- a/tests/compiler/std/string-casemapping.release.wat +++ b/tests/compiler/std/string-casemapping.release.wat @@ -4,10 +4,11 @@ (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) @@ -1063,20 +1064,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1424 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1101,7 +1099,7 @@ if i32.const 0 i32.const 1424 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1129,18 +1127,19 @@ if i32.const 0 i32.const 1424 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -1150,10 +1149,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -1167,13 +1166,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1252,8 +1251,9 @@ i32.const 53856 i32.const 55428 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 53856 global.set $~lib/rt/tlsf/ROOT @@ -1494,7 +1494,7 @@ if i32.const 0 i32.const 1424 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1729,7 +1729,7 @@ if i32.const 1088 i32.const 1424 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1808,8 +1808,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1819,7 +1820,7 @@ if i32.const 0 i32.const 1424 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1834,7 +1835,7 @@ if i32.const 0 i32.const 1424 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.debug.wat b/tests/compiler/std/string-encoding.debug.wat index 7ed6df3291..4460a39e87 100644 --- a/tests/compiler/std/string-encoding.debug.wat +++ b/tests/compiler/std/string-encoding.debug.wat @@ -8,6 +8,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string-encoding/str (mut i32) (i32.const 32)) @@ -1042,32 +1043,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 464 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1092,8 +1091,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1113,7 +1112,7 @@ if i32.const 0 i32.const 464 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1146,7 +1145,7 @@ if i32.const 0 i32.const 464 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1202,11 +1201,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1352,8 +1351,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1389,7 +1389,7 @@ if i32.const 0 i32.const 464 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1718,7 +1718,7 @@ if i32.const 128 i32.const 464 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2020,8 +2020,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2161,7 +2162,7 @@ if i32.const 0 i32.const 464 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2181,7 +2182,7 @@ if i32.const 0 i32.const 464 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.release.wat b/tests/compiler/std/string-encoding.release.wat index 1c6215ae19..abe6d3822a 100644 --- a/tests/compiler/std/string-encoding.release.wat +++ b/tests/compiler/std/string-encoding.release.wat @@ -6,7 +6,7 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -651,20 +651,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1488 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -689,7 +686,7 @@ if i32.const 0 i32.const 1488 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -717,18 +714,19 @@ if i32.const 0 i32.const 1488 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -738,10 +736,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -755,13 +753,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -840,8 +838,9 @@ i32.const 55584 i32.const 57156 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 55584 global.set $~lib/rt/tlsf/ROOT @@ -1082,7 +1081,7 @@ if i32.const 0 i32.const 1488 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1317,7 +1316,7 @@ if i32.const 1152 i32.const 1488 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1396,8 +1395,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1407,7 +1407,7 @@ if i32.const 0 i32.const 1488 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1422,7 +1422,7 @@ if i32.const 0 i32.const 1488 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.debug.wat b/tests/compiler/std/string.debug.wat index 1d6aae6937..f0e0fa679f 100644 --- a/tests/compiler/std/string.debug.wat +++ b/tests/compiler/std/string.debug.wat @@ -14,6 +14,7 @@ (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) @@ -1633,32 +1634,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 624 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1683,8 +1682,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1704,7 +1703,7 @@ if i32.const 0 i32.const 624 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1737,7 +1736,7 @@ if i32.const 0 i32.const 624 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1793,11 +1792,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1943,8 +1942,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1980,7 +1980,7 @@ if i32.const 0 i32.const 624 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2309,7 +2309,7 @@ if i32.const 352 i32.const 624 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2611,8 +2611,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2752,7 +2753,7 @@ if i32.const 0 i32.const 624 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2772,7 +2773,7 @@ if i32.const 0 i32.const 624 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.release.wat b/tests/compiler/std/string.release.wat index 0726dc2849..a5c74289b8 100644 --- a/tests/compiler/std/string.release.wat +++ b/tests/compiler/std/string.release.wat @@ -5,14 +5,15 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_=>_f64 (func (param i32) (result f64))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) @@ -1642,20 +1643,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1648 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1680,7 +1678,7 @@ if i32.const 0 i32.const 1648 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1708,18 +1706,19 @@ if i32.const 0 i32.const 1648 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -1729,10 +1728,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -1746,13 +1745,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1831,8 +1830,9 @@ i32.const 59216 i32.const 60788 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 59216 global.set $~lib/rt/tlsf/ROOT @@ -2073,7 +2073,7 @@ if i32.const 0 i32.const 1648 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2308,7 +2308,7 @@ if i32.const 1376 i32.const 1648 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2387,8 +2387,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -2398,7 +2399,7 @@ if i32.const 0 i32.const 1648 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2413,7 +2414,7 @@ if i32.const 0 i32.const 1648 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/symbol.debug.wat b/tests/compiler/std/symbol.debug.wat index 5ebbdf6fa4..e97c478ab3 100644 --- a/tests/compiler/std/symbol.debug.wat +++ b/tests/compiler/std/symbol.debug.wat @@ -3,10 +3,11 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1071,32 +1072,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 448 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1121,8 +1120,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1142,7 +1141,7 @@ if i32.const 0 i32.const 448 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1175,7 +1174,7 @@ if i32.const 0 i32.const 448 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1231,11 +1230,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1381,8 +1380,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1418,7 +1418,7 @@ if i32.const 0 i32.const 448 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1747,7 +1747,7 @@ if i32.const 112 i32.const 448 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2049,8 +2049,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2190,7 +2191,7 @@ if i32.const 0 i32.const 448 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2210,7 +2211,7 @@ if i32.const 0 i32.const 448 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/symbol.release.wat b/tests/compiler/std/symbol.release.wat index b79779652b..5a815c1b93 100644 --- a/tests/compiler/std/symbol.release.wat +++ b/tests/compiler/std/symbol.release.wat @@ -4,10 +4,11 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/symbol/nextId (mut i32) (i32.const 12)) (global $std/symbol/sym1 (mut i32) (i32.const 0)) @@ -713,20 +714,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1472 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -751,7 +749,7 @@ if i32.const 0 i32.const 1472 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -779,18 +777,19 @@ if i32.const 0 i32.const 1472 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -800,10 +799,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -817,13 +816,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -902,8 +901,9 @@ i32.const 35520 i32.const 37092 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 35520 global.set $~lib/rt/tlsf/ROOT @@ -1144,7 +1144,7 @@ if i32.const 0 i32.const 1472 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1379,7 +1379,7 @@ if i32.const 1136 i32.const 1472 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1458,8 +1458,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1469,7 +1470,7 @@ if i32.const 0 i32.const 1472 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1484,7 +1485,7 @@ if i32.const 0 i32.const 1472 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.debug.wat b/tests/compiler/std/typedarray.debug.wat index bc5e36428e..c1cb45a49d 100644 --- a/tests/compiler/std/typedarray.debug.wat +++ b/tests/compiler/std/typedarray.debug.wat @@ -40,6 +40,7 @@ (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) @@ -1380,32 +1381,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 480 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1430,8 +1429,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1451,7 +1450,7 @@ if i32.const 0 i32.const 480 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1484,7 +1483,7 @@ if i32.const 0 i32.const 480 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1540,11 +1539,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1690,8 +1689,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1727,7 +1727,7 @@ if i32.const 0 i32.const 480 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2056,7 +2056,7 @@ if i32.const 144 i32.const 480 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2358,8 +2358,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2499,7 +2500,7 @@ if i32.const 0 i32.const 480 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2519,7 +2520,7 @@ if i32.const 0 i32.const 480 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.release.wat b/tests/compiler/std/typedarray.release.wat index 32229e77fc..a321d5a075 100644 --- a/tests/compiler/std/typedarray.release.wat +++ b/tests/compiler/std/typedarray.release.wat @@ -20,6 +20,7 @@ (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) @@ -29,7 +30,6 @@ (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) - (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) @@ -1275,20 +1275,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1504 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1313,7 +1310,7 @@ if i32.const 0 i32.const 1504 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1341,18 +1338,19 @@ if i32.const 0 i32.const 1504 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -1362,10 +1360,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -1379,13 +1377,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -1464,8 +1462,9 @@ i32.const 49088 i32.const 50660 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 49088 global.set $~lib/rt/tlsf/ROOT @@ -1507,7 +1506,7 @@ if i32.const 0 i32.const 1504 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1879,7 +1878,7 @@ if i32.const 1168 i32.const 1504 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1958,8 +1957,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $0 local.get $3 @@ -1969,7 +1969,7 @@ if i32.const 0 i32.const 1504 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1984,7 +1984,7 @@ if i32.const 0 i32.const 1504 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/uri.debug.wat b/tests/compiler/std/uri.debug.wat index 6d8952cba8..2ebe24dff2 100644 --- a/tests/compiler/std/uri.debug.wat +++ b/tests/compiler/std/uri.debug.wat @@ -7,6 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1085,32 +1086,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 496 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1135,8 +1134,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1156,7 +1155,7 @@ if i32.const 0 i32.const 496 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1189,7 +1188,7 @@ if i32.const 0 i32.const 496 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1245,11 +1244,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1395,8 +1394,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1432,7 +1432,7 @@ if i32.const 0 i32.const 496 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1761,7 +1761,7 @@ if i32.const 160 i32.const 496 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2063,8 +2063,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2204,7 +2205,7 @@ if i32.const 0 i32.const 496 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2224,7 +2225,7 @@ if i32.const 0 i32.const 496 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/uri.release.wat b/tests/compiler/std/uri.release.wat index 1eb030c2ff..19c6803f62 100644 --- a/tests/compiler/std/uri.release.wat +++ b/tests/compiler/std/uri.release.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -731,20 +731,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1520 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -769,7 +766,7 @@ if i32.const 0 i32.const 1520 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -797,18 +794,19 @@ if i32.const 0 i32.const 1520 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -818,10 +816,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -835,13 +833,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -920,8 +918,9 @@ i32.const 37136 i32.const 38708 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 37136 global.set $~lib/rt/tlsf/ROOT @@ -1162,7 +1161,7 @@ if i32.const 0 i32.const 1520 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1397,7 +1396,7 @@ if i32.const 1184 i32.const 1520 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1476,8 +1475,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1487,7 +1487,7 @@ if i32.const 0 i32.const 1520 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 1520 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/super-inline.debug.wat b/tests/compiler/super-inline.debug.wat index ea15d504a7..f308e52d90 100644 --- a/tests/compiler/super-inline.debug.wat +++ b/tests/compiler/super-inline.debug.wat @@ -6,7 +6,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1011,32 +1011,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 368 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1061,8 +1059,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1082,7 +1080,7 @@ if i32.const 0 i32.const 368 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1115,7 +1113,7 @@ if i32.const 0 i32.const 368 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1171,11 +1169,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1321,8 +1319,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1358,7 +1357,7 @@ if i32.const 0 i32.const 368 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1687,7 +1686,7 @@ if i32.const 32 i32.const 368 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1989,8 +1988,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2130,7 +2130,7 @@ if i32.const 0 i32.const 368 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2150,7 +2150,7 @@ if i32.const 0 i32.const 368 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/super-inline.release.wat b/tests/compiler/super-inline.release.wat index 10e908df64..19e7500ee8 100644 --- a/tests/compiler/super-inline.release.wat +++ b/tests/compiler/super-inline.release.wat @@ -4,7 +4,7 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -622,20 +622,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1392 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -660,7 +657,7 @@ if i32.const 0 i32.const 1392 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -688,18 +685,19 @@ if i32.const 0 i32.const 1392 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -709,10 +707,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -726,13 +724,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -811,8 +809,9 @@ i32.const 34240 i32.const 35812 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34240 global.set $~lib/rt/tlsf/ROOT @@ -1053,7 +1052,7 @@ if i32.const 0 i32.const 1392 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1242,8 +1241,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1252,7 +1252,7 @@ if i32.const 0 i32.const 1392 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1267,7 +1267,7 @@ if i32.const 0 i32.const 1392 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/templateliteral.debug.wat b/tests/compiler/templateliteral.debug.wat index dd65372618..df057be5d8 100644 --- a/tests/compiler/templateliteral.debug.wat +++ b/tests/compiler/templateliteral.debug.wat @@ -8,6 +8,7 @@ (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) @@ -1191,32 +1192,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 528 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1241,8 +1240,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1262,7 +1261,7 @@ if i32.const 0 i32.const 528 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1295,7 +1294,7 @@ if i32.const 0 i32.const 528 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1351,11 +1350,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1501,8 +1500,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1538,7 +1538,7 @@ if i32.const 0 i32.const 528 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1867,7 +1867,7 @@ if i32.const 192 i32.const 528 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2169,8 +2169,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2310,7 +2311,7 @@ if i32.const 0 i32.const 528 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2330,7 +2331,7 @@ if i32.const 0 i32.const 528 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/templateliteral.release.wat b/tests/compiler/templateliteral.release.wat index 209c431e5b..9f8bf21cc3 100644 --- a/tests/compiler/templateliteral.release.wat +++ b/tests/compiler/templateliteral.release.wat @@ -2,11 +2,12 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i64_i64_i32_i64_i32_=>_i32 (func (param i64 i64 i32 i64 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -710,20 +711,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1552 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -748,7 +746,7 @@ if i32.const 0 i32.const 1552 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -776,18 +774,19 @@ if i32.const 0 i32.const 1552 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -797,10 +796,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -814,13 +813,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -899,8 +898,9 @@ i32.const 38464 i32.const 40036 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 38464 global.set $~lib/rt/tlsf/ROOT @@ -1141,7 +1141,7 @@ if i32.const 0 i32.const 1552 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1376,7 +1376,7 @@ if i32.const 1216 i32.const 1552 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -1455,8 +1455,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $4 local.get $5 @@ -1466,7 +1467,7 @@ if i32.const 0 i32.const 1552 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1481,7 +1482,7 @@ if i32.const 0 i32.const 1552 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/throw.debug.wat b/tests/compiler/throw.debug.wat index 45688f81a9..48e30b244d 100644 --- a/tests/compiler/throw.debug.wat +++ b/tests/compiler/throw.debug.wat @@ -5,7 +5,7 @@ (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -1123,32 +1123,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 608 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1173,8 +1171,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1194,7 +1192,7 @@ if i32.const 0 i32.const 608 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1227,7 +1225,7 @@ if i32.const 0 i32.const 608 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1283,11 +1281,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1433,8 +1431,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1470,7 +1469,7 @@ if i32.const 0 i32.const 608 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/throw.release.wat b/tests/compiler/throw.release.wat index 862246bd8c..0ad7784a30 100644 --- a/tests/compiler/throw.release.wat +++ b/tests/compiler/throw.release.wat @@ -634,8 +634,9 @@ (func $~lib/rt/itcms/step (local $0 i32) (local $1 i32) - (local $2 i32) + (local $2 i64) (local $3 i32) + (local $4 i32) block $break|0 block $case2|0 block $case1|0 @@ -717,9 +718,9 @@ if local.get $0 i32.load $0 - local.tee $2 + local.tee $3 if - local.get $2 + local.get $3 call $byn-split-outlined-A$~lib/rt/itcms/__visit end local.get $0 @@ -786,11 +787,11 @@ return end global.get $~lib/rt/itcms/iter - local.tee $1 + local.tee $0 global.get $~lib/rt/itcms/toSpace i32.ne if - local.get $1 + local.get $0 i32.load $0 offset=4 local.tee $3 i32.const -4 @@ -810,19 +811,19 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 34516 i32.lt_u if - local.get $1 + local.get $0 i32.const 0 i32.store $0 offset=4 - local.get $1 + local.get $0 i32.const 0 i32.store $0 offset=8 else global.get $~lib/rt/itcms/total - local.get $1 + local.get $0 i32.load $0 i32.const -4 i32.and @@ -830,7 +831,7 @@ i32.add i32.sub global.set $~lib/rt/itcms/total - local.get $1 + local.get $0 i32.const 4 i32.add local.tee $3 @@ -841,12 +842,12 @@ i32.eqz if memory.size $0 - local.tee $1 + local.tee $0 i32.const 0 i32.le_s if (result i32) i32.const 1 - local.get $1 + local.get $0 i32.sub memory.grow $0 i32.const 0 @@ -864,11 +865,11 @@ i32.const 0 i32.store $0 loop $for-loop|0 - local.get $0 + local.get $1 i32.const 23 i32.lt_u if - local.get $0 + local.get $1 i32.const 2 i32.shl i32.const 34528 @@ -876,16 +877,16 @@ i32.const 0 i32.store $0 offset=4 i32.const 0 - local.set $1 + local.set $0 loop $for-loop|1 - local.get $1 + local.get $0 i32.const 16 i32.lt_u if - local.get $0 + local.get $1 i32.const 4 i32.shl - local.get $1 + local.get $0 i32.add i32.const 2 i32.shl @@ -893,41 +894,40 @@ i32.add i32.const 0 i32.store $0 offset=96 - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|0 end end memory.size $0 - i32.const 16 - i32.shl - local.tee $0 - i32.eqz - local.get $0 - i32.const 36100 - i32.ge_u - i32.or - i32.eqz + i64.extend_i32_s + i64.const 16 + i64.shl + local.tee $2 + i32.wrap_i64 + local.set $4 + local.get $2 + i64.const 36100 + i64.lt_u if i32.const 0 i32.const 1632 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable end - local.get $0 - i32.const -16 - i32.and + i32.const 36108 + local.set $1 i32.const 36096 i32.load $0 local.tee $0 @@ -940,7 +940,7 @@ if i32.const 0 i32.const 1632 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -949,53 +949,57 @@ i32.const 36092 i32.eq if (result i32) + i32.const 36092 + local.set $1 local.get $0 i32.load $0 - local.set $2 - i32.const 36092 else - i32.const 36108 + i32.const 0 end else - i32.const 36108 + i32.const 0 end - local.tee $0 + local.set $0 + local.get $4 + i32.const -16 + i32.and + local.get $1 i32.sub - local.tee $1 + local.tee $4 i32.const 20 i32.ge_u if + local.get $1 local.get $0 - local.get $2 i32.const 2 i32.and - local.get $1 + local.get $4 i32.const 8 i32.sub - local.tee $1 + local.tee $0 i32.const 1 i32.or i32.or i32.store $0 - local.get $0 + local.get $1 i32.const 0 i32.store $0 offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store $0 offset=8 - local.get $0 + local.get $1 i32.const 4 i32.add - local.get $1 + local.get $0 i32.add - local.tee $1 + local.tee $0 i32.const 2 i32.store $0 i32.const 36096 - local.get $1 + local.get $0 i32.store $0 i32.const 34528 - local.get $0 + local.get $1 call $~lib/rt/tlsf/insertBlock end i32.const 34528 @@ -1024,7 +1028,7 @@ if i32.const 0 i32.const 1632 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/typeof.debug.wat b/tests/compiler/typeof.debug.wat index 69c0f89ca3..09f0b882ed 100644 --- a/tests/compiler/typeof.debug.wat +++ b/tests/compiler/typeof.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) @@ -1150,32 +1150,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 672 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1200,8 +1198,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1221,7 +1219,7 @@ if i32.const 0 i32.const 672 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1254,7 +1252,7 @@ if i32.const 0 i32.const 672 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1310,11 +1308,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1460,8 +1458,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1497,7 +1496,7 @@ if i32.const 0 i32.const 672 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1826,7 +1825,7 @@ if i32.const 336 i32.const 672 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2128,8 +2127,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2269,7 +2269,7 @@ if i32.const 0 i32.const 672 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2289,7 +2289,7 @@ if i32.const 0 i32.const 672 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/typeof.release.wat b/tests/compiler/typeof.release.wat index 0e12ebbd4b..cd688379c0 100644 --- a/tests/compiler/typeof.release.wat +++ b/tests/compiler/typeof.release.wat @@ -4,7 +4,7 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -638,20 +638,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1696 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -676,7 +673,7 @@ if i32.const 0 i32.const 1696 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -704,18 +701,19 @@ if i32.const 0 i32.const 1696 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -725,10 +723,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -742,13 +740,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -827,8 +825,9 @@ i32.const 34592 i32.const 36164 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34592 global.set $~lib/rt/tlsf/ROOT @@ -1069,7 +1068,7 @@ if i32.const 0 i32.const 1696 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1258,8 +1257,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1268,7 +1268,7 @@ if i32.const 0 i32.const 1696 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1283,7 +1283,7 @@ if i32.const 0 i32.const 1696 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.debug.wat b/tests/compiler/while.debug.wat index 627f78ab66..2e2d3d5025 100644 --- a/tests/compiler/while.debug.wat +++ b/tests/compiler/while.debug.wat @@ -7,7 +7,7 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $while/ran (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1433,32 +1433,30 @@ local.get $slMap i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $root|3 i32) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $endU64 i64) (result i32) + (local $end i32) + (local $root|4 i32) (local $tail i32) (local $tailInfo i32) (local $size i32) (local $leftSize i32) (local $left i32) - (local $root|9 i32) - (local $tail|10 i32) + (local $root|10 i32) + (local $tail|11 i32) + local.get $endU64 + i32.wrap_i64 + local.set $end i32.const 1 drop local.get $start - local.get $end - i32.le_u - if (result i32) - i32.const 1 - else - local.get $end - i32.const 0 - i32.eq - end + i64.extend_i32_u + local.get $endU64 + i64.le_u i32.eqz if i32.const 0 i32.const 416 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -1483,8 +1481,8 @@ local.set $end block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) local.get $root - local.set $root|3 - local.get $root|3 + local.set $root|4 + local.get $root|4 i32.load $0 offset=1568 br $~lib/rt/tlsf/GETTAIL|inlined.0 end @@ -1504,7 +1502,7 @@ if i32.const 0 i32.const 416 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -1537,7 +1535,7 @@ if i32.const 0 i32.const 416 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable @@ -1593,11 +1591,11 @@ i32.or call $~lib/rt/common/BLOCK#set:mmInfo local.get $root - local.set $root|9 + local.set $root|10 local.get $tail - local.set $tail|10 - local.get $root|9 - local.get $tail|10 + local.set $tail|11 + local.get $root|10 + local.get $tail|11 i32.store $0 offset=1568 local.get $root local.get $left @@ -1743,8 +1741,9 @@ local.get $root local.get $memStart memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop local.get $root @@ -1780,7 +1779,7 @@ if i32.const 0 i32.const 416 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -2109,7 +2108,7 @@ if i32.const 80 i32.const 416 - i32.const 458 + i32.const 459 i32.const 29 call $~lib/builtins/abort unreachable @@ -2411,8 +2410,9 @@ i32.const 16 i32.shl local.get $pagesAfter - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory drop ) @@ -2552,7 +2552,7 @@ if i32.const 0 i32.const 416 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -2572,7 +2572,7 @@ if i32.const 0 i32.const 416 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.release.wat b/tests/compiler/while.release.wat index 93203cc24a..1c6e3ebbe4 100644 --- a/tests/compiler/while.release.wat +++ b/tests/compiler/while.release.wat @@ -5,7 +5,7 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -610,20 +610,17 @@ i32.or i32.store $0 offset=4 ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) local.get $2 - i32.eqz local.get $1 - local.get $2 - i32.le_u - i32.or - i32.eqz + i64.extend_i32_u + i64.lt_u if i32.const 0 i32.const 1440 - i32.const 377 + i32.const 378 i32.const 14 call $~lib/builtins/abort unreachable @@ -648,7 +645,7 @@ if i32.const 0 i32.const 1440 - i32.const 384 + i32.const 385 i32.const 16 call $~lib/builtins/abort unreachable @@ -676,18 +673,19 @@ if i32.const 0 i32.const 1440 - i32.const 397 + i32.const 398 i32.const 5 call $~lib/builtins/abort unreachable end end local.get $2 + i32.wrap_i64 i32.const -16 i32.and local.get $1 i32.sub - local.tee $2 + local.tee $4 i32.const 20 i32.lt_u if @@ -697,10 +695,10 @@ local.get $3 i32.const 2 i32.and - local.get $2 + local.get $4 i32.const 8 i32.sub - local.tee $2 + local.tee $3 i32.const 1 i32.or i32.or @@ -714,13 +712,13 @@ local.get $1 i32.const 4 i32.add - local.get $2 + local.get $3 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.store $0 local.get $0 - local.get $2 + local.get $3 i32.store $0 offset=1568 local.get $0 local.get $1 @@ -799,8 +797,9 @@ i32.const 34288 i32.const 35860 memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory i32.const 34288 global.set $~lib/rt/tlsf/ROOT @@ -1041,7 +1040,7 @@ if i32.const 0 i32.const 1440 - i32.const 559 + i32.const 560 i32.const 3 call $~lib/builtins/abort unreachable @@ -1230,8 +1229,9 @@ i32.const 16 i32.shl memory.size $0 - i32.const 16 - i32.shl + i64.extend_i32_s + i64.const 16 + i64.shl call $~lib/rt/tlsf/addMemory local.get $2 call $~lib/rt/tlsf/searchBlock @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 1440 - i32.const 496 + i32.const 497 i32.const 16 call $~lib/builtins/abort unreachable @@ -1255,7 +1255,7 @@ if i32.const 0 i32.const 1440 - i32.const 498 + i32.const 499 i32.const 14 call $~lib/builtins/abort unreachable