From 7000f4b536f73e7fd8737ecd7177d86ec0779de8 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Thu, 25 Aug 2022 22:28:10 +0300 Subject: [PATCH 01/13] init --- src/compiler.ts | 11 +- .../std/operator-overloading.debug.wat | 431 ++- .../std/operator-overloading.release.wat | 3043 +++++++++-------- tests/compiler/std/operator-overloading.ts | 29 + 4 files changed, 2134 insertions(+), 1380 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index a606d6873b..77d1104b78 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -4629,6 +4629,7 @@ export class Compiler extends DiagnosticEmitter { this.currentType, right, resolver.currentThisExpression, + Type.i32, resolver.currentElementExpression, contextualType != Type.void ); @@ -5477,6 +5478,7 @@ export class Compiler extends DiagnosticEmitter { if (!target) return this.module.unreachable(); var thisExpression = resolver.currentThisExpression; var elementExpression = resolver.currentElementExpression; + var elementType = Type.i32; // to compile just the value, we need to know the target's type var targetType: Type; @@ -5544,6 +5546,7 @@ export class Compiler extends DiagnosticEmitter { return this.module.unreachable(); } assert(indexedSet.signature.parameterTypes.length == 2); // parser must guarantee this + elementType = indexedSet.signature.parameterTypes[0]; // 1st parameter is the index targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element if (indexedSet.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(expression); if (!isUnchecked && this.options.pedantic) { @@ -5573,6 +5576,7 @@ export class Compiler extends DiagnosticEmitter { valueType, valueExpression, thisExpression, + elementType, elementExpression, contextualType != Type.void ); @@ -5590,6 +5594,8 @@ export class Compiler extends DiagnosticEmitter { valueExpression: Expression, /** `this` expression reference if a field or property set. */ thisExpression: Expression | null, + /** Index expression type. */ + indexType: Type, /** Index expression reference if an indexed set. */ indexExpression: Expression | null, /** Whether to tee the value. */ @@ -5735,7 +5741,7 @@ export class Compiler extends DiagnosticEmitter { thisType, Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); - let elementExpr = this.compileExpression(assert(indexExpression), Type.i32, Constraints.CONV_IMPLICIT); + let elementExpr = this.compileExpression(assert(indexExpression), indexType, Constraints.CONV_IMPLICIT); let elementType = this.currentType; if (tee) { let tempTarget = flow.getTempLocal(thisType); @@ -9164,6 +9170,7 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, + Type.i32, resolver.currentElementExpression, false ); @@ -9176,6 +9183,7 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, + Type.i32, resolver.currentElementExpression, false ); @@ -9541,6 +9549,7 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, + Type.i32, resolver.currentElementExpression, contextualType != Type.void ); diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index d61fc6632c..a9c0f7858d 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -6,8 +6,13 @@ (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_f32_=>_none (func (param i32 f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (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)) @@ -91,10 +96,11 @@ (global $std/operator-overloading/aii1 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 496)) - (global $~lib/memory/__data_end i32 (i32.const 548)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16932)) - (global $~lib/memory/__heap_base i32 (i32.const 16932)) + (global $std/operator-overloading/tea (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 560)) + (global $~lib/memory/__data_end i32 (i32.const 620)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17004)) + (global $~lib/memory/__heap_base i32 (i32.const 17004)) (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") @@ -105,7 +111,9 @@ (data (i32.const 320) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 348) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 412) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00\00\00\00\00\00\00") - (data (i32.const 496) "\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") + (data (i32.const 492) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00x\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 524) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00y\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 560) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 1 funcref) (elem $0 (i32.const 1)) (export "memory" (memory $0)) @@ -2787,6 +2795,171 @@ local.get $1 i32.store offset=4 ) + (func $std/operator-overloading/TesterElementAccess#set:x (param $0 i32) (param $1 f32) + local.get $0 + local.get $1 + f32.store + ) + (func $std/operator-overloading/TesterElementAccess#set:y (param $0 i32) (param $1 f32) + local.get $0 + local.get $1 + f32.store offset=4 + ) + (func $~lib/string/String#get:length (param $this i32) (result i32) + local.get $this + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (param $str1 i32) (param $index1 i32) (param $str2 i32) (param $index2 i32) (param $len i32) (result i32) + (local $ptr1 i32) + (local $ptr2 i32) + (local $var$7 i32) + (local $a i32) + (local $b i32) + local.get $str1 + local.get $index1 + i32.const 1 + i32.shl + i32.add + local.set $ptr1 + local.get $str2 + local.get $index2 + i32.const 1 + i32.shl + i32.add + local.set $ptr2 + i32.const 0 + i32.const 2 + i32.lt_s + drop + local.get $len + i32.const 4 + i32.ge_u + if (result i32) + local.get $ptr1 + i32.const 7 + i32.and + local.get $ptr2 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end + if + block $do-break|0 + loop $do-loop|0 + local.get $ptr1 + i64.load + local.get $ptr2 + i64.load + i64.ne + if + br $do-break|0 + end + local.get $ptr1 + i32.const 8 + i32.add + local.set $ptr1 + local.get $ptr2 + i32.const 8 + i32.add + local.set $ptr2 + local.get $len + i32.const 4 + i32.sub + local.set $len + local.get $len + i32.const 4 + i32.ge_u + br_if $do-loop|0 + end + end + end + loop $while-continue|1 + local.get $len + local.tee $var$7 + i32.const 1 + i32.sub + local.set $len + local.get $var$7 + local.set $var$7 + local.get $var$7 + if + local.get $ptr1 + i32.load16_u + local.set $a + local.get $ptr2 + i32.load16_u + local.set $b + local.get $a + local.get $b + i32.ne + if + local.get $a + local.get $b + i32.sub + return + end + local.get $ptr1 + i32.const 2 + i32.add + local.set $ptr1 + local.get $ptr2 + i32.const 2 + i32.add + local.set $ptr2 + br $while-continue|1 + end + end + i32.const 0 + ) + (func $~lib/string/String.__eq (param $left i32) (param $right i32) (result i32) + (local $leftLength i32) + local.get $left + local.get $right + i32.eq + if + i32.const 1 + return + end + local.get $left + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $right + i32.const 0 + i32.eq + end + if + i32.const 0 + return + end + local.get $left + call $~lib/string/String#get:length + local.set $leftLength + local.get $leftLength + local.get $right + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + return + end + local.get $left + i32.const 0 + local.get $right + i32.const 0 + local.get $leftLength + call $~lib/util/string/compareImpl + i32.eqz + ) (func $~lib/rt/__visit_globals (param $0 i32) (local $1 i32) global.get $std/operator-overloading/a1 @@ -3202,6 +3375,13 @@ local.get $0 call $~lib/rt/itcms/__visit end + global.get $std/operator-overloading/tea + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end i32.const 224 local.get $0 call $~lib/rt/itcms/__visit @@ -3222,25 +3402,28 @@ ) (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) block $invalid - block $std/operator-overloading/TesterInlineInstance - block $std/operator-overloading/TesterInlineStatic - block $std/operator-overloading/Tester - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $invalid + block $std/operator-overloading/TesterElementAccess + block $std/operator-overloading/TesterInlineInstance + block $std/operator-overloading/TesterInlineStatic + block $std/operator-overloading/Tester + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $std/operator-overloading/TesterElementAccess $invalid + end + return end return end + local.get $0 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView~visit return end - local.get $0 - local.get $1 - call $~lib/arraybuffer/ArrayBufferView~visit return end return @@ -3259,14 +3442,79 @@ global.get $~lib/memory/__data_end i32.lt_s if - i32.const 16960 - i32.const 17008 + i32.const 17024 + i32.const 17072 i32.const 1 i32.const 1 call $~lib/builtins/abort unreachable end ) + (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 f32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + i32.const 512 + local.set $3 + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + call $~lib/string/String.__eq + if + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:x + else + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:y + end + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result f32) + (local $2 i32) + (local $3 f32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $~lib/string/String.__eq + if (result f32) + local.get $0 + f32.load + else + local.get $0 + f32.load offset=4 + end + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) (func $start:std/operator-overloading (local $0 i32) (local $1 i32) @@ -4548,6 +4796,113 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + f32.const 1 + f32.const 2 + call $std/operator-overloading/TesterElementAccess#constructor + global.set $std/operator-overloading/tea + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + f32.const -1 + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + f32.const -2 + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + f32.load + f32.const -1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 357 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + f32.const -1 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 358 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + f32.load offset=4 + f32.const -2 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 360 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + f32.const -2 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 361 + i32.const 1 + call $~lib/builtins/abort + unreachable + end global.get $~lib/memory/__stack_pointer i32.const 16 i32.add @@ -4655,4 +5010,38 @@ global.set $~lib/memory/__stack_pointer local.get $3 ) + (func $std/operator-overloading/TesterElementAccess#constructor (param $0 i32) (param $1 f32) (param $2 f32) (result i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.const 6 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.get $1 + call $std/operator-overloading/TesterElementAccess#set:x + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:y + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) ) diff --git a/tests/compiler/std/operator-overloading.release.wat b/tests/compiler/std/operator-overloading.release.wat index 80006220a0..1ef1e5049d 100644 --- a/tests/compiler/std/operator-overloading.release.wat +++ b/tests/compiler/std/operator-overloading.release.wat @@ -1,12 +1,14 @@ (module (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (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)) @@ -84,7 +86,8 @@ (global $std/operator-overloading/aii1 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii (mut i32) (i32.const 0)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17956)) + (global $std/operator-overloading/tea (mut i32) (i32.const 0)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 18028)) (memory $0 1) (data (i32.const 1036) "<") (data (i32.const 1048) "\01\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") @@ -98,8 +101,12 @@ (data (i32.const 1384) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") (data (i32.const 1436) "L") (data (i32.const 1448) "\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s") - (data (i32.const 1520) "\06\00\00\00 \00\00\00\00\00\00\00 ") - (data (i32.const 1548) " \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 ") + (data (i32.const 1516) "\1c") + (data (i32.const 1528) "\01\00\00\00\02\00\00\00x") + (data (i32.const 1548) "\1c") + (data (i32.const 1560) "\01\00\00\00\02\00\00\00y") + (data (i32.const 1584) "\07\00\00\00 \00\00\00\00\00\00\00 ") + (data (i32.const 1612) " \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 ") (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/visitRoots @@ -675,10 +682,10 @@ if unreachable end - i32.const 17968 + i32.const 18032 i32.const 0 i32.store - i32.const 19536 + i32.const 19600 i32.const 0 i32.store loop $for-loop|0 @@ -689,7 +696,7 @@ local.get $0 i32.const 2 i32.shl - i32.const 17968 + i32.const 18032 i32.add i32.const 0 i32.store offset=4 @@ -707,7 +714,7 @@ i32.add i32.const 2 i32.shl - i32.const 17968 + i32.const 18032 i32.add i32.const 0 i32.store offset=96 @@ -725,13 +732,13 @@ br $for-loop|0 end end - i32.const 17968 - i32.const 19540 + i32.const 18032 + i32.const 19604 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 17968 + i32.const 18032 global.set $~lib/rt/tlsf/ROOT ) (func $~lib/rt/itcms/step (result i32) @@ -816,7 +823,7 @@ local.set $0 loop $while-continue|0 local.get $0 - i32.const 17956 + i32.const 18028 i32.lt_u if local.get $0 @@ -916,7 +923,7 @@ unreachable end local.get $0 - i32.const 17956 + i32.const 18028 i32.lt_u if local.get $0 @@ -939,7 +946,7 @@ i32.const 4 i32.add local.tee $0 - i32.const 17956 + i32.const 18028 i32.ge_u if global.get $~lib/rt/tlsf/ROOT @@ -1475,6 +1482,117 @@ end local.get $2 ) + (func $~lib/string/String.__eq (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1536 + i32.eq + if + i32.const 1 + return + end + local.get $0 + i32.eqz + if + i32.const 0 + return + end + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + local.tee $2 + i32.const 1532 + i32.load + i32.const 1 + i32.shr_u + i32.ne + if + i32.const 0 + return + end + i32.const 1536 + local.set $3 + local.get $0 + local.tee $1 + i32.const 7 + i32.and + i32.eqz + local.get $2 + local.tee $0 + i32.const 4 + i32.ge_u + i32.and + if + loop $do-loop|0 + local.get $1 + i64.load + local.get $3 + i64.load + i64.eq + if + local.get $1 + i32.const 8 + i32.add + local.set $1 + local.get $3 + i32.const 8 + i32.add + local.set $3 + local.get $0 + i32.const 4 + i32.sub + local.tee $0 + i32.const 4 + i32.ge_u + br_if $do-loop|0 + end + end + end + block $__inlined_func$~lib/util/string/compareImpl + loop $while-continue|1 + local.get $0 + local.tee $2 + i32.const 1 + i32.sub + local.set $0 + local.get $2 + if + local.get $1 + i32.load16_u + local.tee $4 + local.get $3 + i32.load16_u + local.tee $5 + i32.sub + local.set $2 + local.get $4 + local.get $5 + i32.ne + br_if $__inlined_func$~lib/util/string/compareImpl + local.get $1 + i32.const 2 + i32.add + local.set $1 + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $while-continue|1 + end + end + i32.const 0 + local.set $2 + end + local.get $2 + i32.eqz + ) (func $~lib/rt/__visit_globals (local $0 i32) global.get $std/operator-overloading/a1 @@ -1831,6 +1949,12 @@ local.get $0 call $byn-split-outlined-A$~lib/rt/itcms/__visit end + global.get $std/operator-overloading/tea + local.tee $0 + if + local.get $0 + call $byn-split-outlined-A$~lib/rt/itcms/__visit + end i32.const 1248 call $byn-split-outlined-A$~lib/rt/itcms/__visit i32.const 1056 @@ -1838,28 +1962,31 @@ ) (func $~lib/rt/__visit_members (param $0 i32) block $invalid - block $std/operator-overloading/TesterInlineInstance - block $std/operator-overloading/TesterInlineStatic - block $std/operator-overloading/Tester - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $invalid + block $std/operator-overloading/TesterElementAccess + block $std/operator-overloading/TesterInlineInstance + block $std/operator-overloading/TesterInlineStatic + block $std/operator-overloading/Tester + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $std/operator-overloading/TesterElementAccess $invalid + end + return end return end - return - end - local.get $0 - i32.load - local.tee $0 - if local.get $0 - call $byn-split-outlined-A$~lib/rt/itcms/__visit + i32.load + local.tee $0 + if + local.get $0 + call $byn-split-outlined-A$~lib/rt/itcms/__visit + end + return end return end @@ -1874,1453 +2001,1653 @@ (func $~start call $start:std/operator-overloading ) - (func $start:std/operator-overloading - (local $0 i32) - (local $1 i32) + (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 f32) + (local $3 i32) global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 4 i32.sub global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - i32.const 1572 + i32.const 1644 i32.lt_s if - i32.const 17984 - i32.const 18032 + i32.const 18048 + i32.const 18096 i32.const 1 i32.const 1 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i64.const 0 - i64.store offset=8 - memory.size - i32.const 16 - i32.shl - i32.const 17956 - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 1172 - i32.const 1168 - i32.store - i32.const 1176 - i32.const 1168 - i32.store - i32.const 1168 - global.set $~lib/rt/itcms/pinSpace - i32.const 1204 - i32.const 1200 - i32.store - i32.const 1208 - i32.const 1200 - i32.store - i32.const 1200 - global.set $~lib/rt/itcms/toSpace - i32.const 1348 - i32.const 1344 - i32.store - i32.const 1352 - i32.const 1344 + local.tee $3 + i32.const 0 i32.store - i32.const 1344 - global.set $~lib/rt/itcms/fromSpace - i32.const 1 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/a1 - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/a2 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/a1 - local.tee $0 + local.get $3 + i32.const 1536 i32.store - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/a2 - local.tee $1 - i32.store offset=4 - local.get $0 - i32.load local.get $1 - i32.load - i32.add - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.add - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/a - global.get $std/operator-overloading/a - i32.load - i32.const 3 - i32.eq - if (result i32) - global.get $std/operator-overloading/a - i32.load offset=4 - i32.const 5 - i32.eq - else - i32.const 0 - end - i32.eqz + call $~lib/string/String.__eq if - i32.const 0 - i32.const 1456 - i32.const 145 - i32.const 1 - call $~lib/builtins/abort - unreachable + local.get $0 + local.get $2 + f32.store + else + local.get $0 + local.get $2 + f32.store offset=4 end - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/s1 - i32.const 2 - i32.const -3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/s2 global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/s1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/s2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.sub - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result f32) + (local $2 i32) + (local $3 f32) + global.get $~lib/memory/__stack_pointer + i32.const 4 i32.sub - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/s - global.get $std/operator-overloading/s - i32.load - if (result i32) - i32.const 0 - else - global.get $std/operator-overloading/s - i32.load offset=4 - i32.const 6 - i32.eq - end - i32.eqz + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1644 + i32.lt_s if - i32.const 0 - i32.const 1456 - i32.const 151 + i32.const 18048 + i32.const 18096 + i32.const 1 i32.const 1 call $~lib/builtins/abort unreachable end - i32.const 2 - i32.const 5 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/m1 - i32.const 3 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/m2 global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/m1 - local.tee $1 + local.tee $2 + i32.const 0 + i32.store + local.get $2 + i32.const 1536 i32.store - local.get $0 - global.get $std/operator-overloading/m2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.mul local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.mul - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/m - global.get $std/operator-overloading/m - i32.load - i32.const 6 - i32.eq - if (result i32) - global.get $std/operator-overloading/m - i32.load offset=4 - i32.const 10 - i32.eq + call $~lib/string/String.__eq + if (result f32) + local.get $0 + f32.load else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 157 - i32.const 1 - call $~lib/builtins/abort - unreachable + local.get $0 + f32.load offset=4 end - i32.const 6 - i32.const 50 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/d1 - i32.const 3 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/d2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/d1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/d2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.div_s - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.div_s - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/d - global.get $std/operator-overloading/d - i32.load - i32.const 2 - i32.eq - if (result i32) - global.get $std/operator-overloading/d - i32.load offset=4 - i32.const 5 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 163 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 10 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/f1 - i32.const 6 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/f2 + local.set $3 global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/f1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/f2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.rem_s - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.rem_s - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/f - global.get $std/operator-overloading/f - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/f - i32.load offset=4 - else - i32.const 1 - end - if - i32.const 0 - i32.const 1456 - i32.const 169 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/p1 i32.const 4 - i32.const 5 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/p2 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) + (func $start:std/operator-overloading + (local $0 i32) + (local $1 i32) global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/p1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/p2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - call $~lib/math/ipow32 - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - call $~lib/math/ipow32 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/p - global.get $std/operator-overloading/p - i32.load i32.const 16 - i32.eq - if (result i32) - global.get $std/operator-overloading/p + i32.sub + global.set $~lib/memory/__stack_pointer + block $folding-inner0 + global.get $~lib/memory/__stack_pointer + i32.const 1644 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i64.const 0 + i64.store + local.get $0 + i64.const 0 + i64.store offset=8 + memory.size + i32.const 16 + i32.shl + i32.const 18028 + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 1172 + i32.const 1168 + i32.store + i32.const 1176 + i32.const 1168 + i32.store + i32.const 1168 + global.set $~lib/rt/itcms/pinSpace + i32.const 1204 + i32.const 1200 + i32.store + i32.const 1208 + i32.const 1200 + i32.store + i32.const 1200 + global.set $~lib/rt/itcms/toSpace + i32.const 1348 + i32.const 1344 + i32.store + i32.const 1352 + i32.const 1344 + i32.store + i32.const 1344 + global.set $~lib/rt/itcms/fromSpace + i32.const 1 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/a1 + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/a2 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/a1 + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/a2 + local.tee $1 + i32.store offset=4 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 i32.load offset=4 - i32.const 243 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/a + global.get $std/operator-overloading/a + i32.load + i32.const 3 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 175 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 255 - i32.const 15 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/n1 - i32.const 15 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/n2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/n1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/n2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.and - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.and - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/n - global.get $std/operator-overloading/n - i32.load - i32.const 15 - i32.eq - if (result i32) - global.get $std/operator-overloading/n + if (result i32) + global.get $std/operator-overloading/a + i32.load offset=4 + i32.const 5 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 145 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/s1 + i32.const 2 + i32.const -3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/s2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/s1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/s2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.sub + local.get $1 i32.load offset=4 - i32.const 15 + local.get $0 + i32.load offset=4 + i32.sub + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/s + global.get $std/operator-overloading/s + i32.load + if (result i32) + i32.const 0 + else + global.get $std/operator-overloading/s + i32.load offset=4 + i32.const 6 + i32.eq + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 151 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 5 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/m1 + i32.const 3 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/m2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/m1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/m2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.mul + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.mul + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/m + global.get $std/operator-overloading/m + i32.load + i32.const 6 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 181 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 3855 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/o1 - i32.const 61680 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/o2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/o1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/o2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.or - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.or - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/o - global.get $std/operator-overloading/o - i32.load - i32.const 65535 - i32.eq - if (result i32) - global.get $std/operator-overloading/o + if (result i32) + global.get $std/operator-overloading/m + i32.load offset=4 + i32.const 10 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 157 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 6 + i32.const 50 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/d1 + i32.const 3 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/d2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/d1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/d2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.div_s + local.get $1 i32.load offset=4 - i32.const 255 + local.get $0 + i32.load offset=4 + i32.div_s + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/d + global.get $std/operator-overloading/d + i32.load + i32.const 2 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 187 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 255 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/x1 - i32.const 65280 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/x2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/x1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/x2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.xor - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.xor - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/x - global.get $std/operator-overloading/x - i32.load - i32.const 65535 - i32.eq - if (result i32) - global.get $std/operator-overloading/x + if (result i32) + global.get $std/operator-overloading/d + i32.load offset=4 + i32.const 5 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 163 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 10 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/f1 + i32.const 6 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/f2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/f1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/f2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.rem_s + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.rem_s + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/f + global.get $std/operator-overloading/f + i32.load + i32.const 4 + i32.eq + if (result i32) + global.get $std/operator-overloading/f + i32.load offset=4 + else + i32.const 1 + end + if + i32.const 0 + i32.const 1456 + i32.const 169 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/p1 + i32.const 4 + i32.const 5 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/p2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/p1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/p2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + call $~lib/math/ipow32 + local.get $1 + i32.load offset=4 + local.get $0 i32.load offset=4 + call $~lib/math/ipow32 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/p + global.get $std/operator-overloading/p + i32.load + i32.const 16 + i32.eq + if (result i32) + global.get $std/operator-overloading/p + i32.load offset=4 + i32.const 243 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 175 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 255 + i32.const 15 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/n1 + i32.const 15 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/n2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/n1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/n2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.and + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.and + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/n + global.get $std/operator-overloading/n + i32.load + i32.const 15 i32.eq - else - i32.const 0 - end - i32.eqz - if + if (result i32) + global.get $std/operator-overloading/n + i32.load offset=4 + i32.const 15 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 181 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 3855 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/o1 + i32.const 61680 i32.const 0 - i32.const 1456 - i32.const 193 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq1 - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/eq1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/eq2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.eq - if (result i32) + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/o2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/o1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/o2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.or local.get $1 i32.load offset=4 local.get $0 i32.load offset=4 + i32.or + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/o + global.get $std/operator-overloading/o + i32.load + i32.const 65535 i32.eq - else - i32.const 0 - end - global.set $std/operator-overloading/eq - global.get $std/operator-overloading/eq - i32.const 1 - i32.ne - if + if (result i32) + global.get $std/operator-overloading/o + i32.load offset=4 + i32.const 255 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 187 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 255 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/x1 + i32.const 65280 i32.const 0 - i32.const 1456 - i32.const 199 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq3 - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq4 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/eq3 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/eq4 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.eq - if (result i32) + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/x2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/x1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/x2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.xor local.get $1 i32.load offset=4 local.get $0 i32.load offset=4 + i32.xor + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/x + global.get $std/operator-overloading/x + i32.load + i32.const 65535 i32.eq - else + if (result i32) + global.get $std/operator-overloading/x + i32.load offset=4 + i32.const 255 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 193 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq1 + i32.const 1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/eq1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/eq2 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.eq + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.eq + else + i32.const 0 + end + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 199 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 1 i32.const 0 - end - global.set $std/operator-overloading/eqf - global.get $std/operator-overloading/eqf - if + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq3 i32.const 0 - i32.const 1456 - i32.const 205 i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/eq1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/eq2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.ne - if (result i32) + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq4 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/eq3 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/eq4 + local.tee $0 + i32.store offset=4 + local.get $1 + i32.load + local.get $0 + i32.load + i32.eq + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.eq + else + i32.const 0 + end + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf + if + i32.const 0 + i32.const 1456 + i32.const 205 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/eq1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/eq2 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.ne - else - i32.const 0 - end - global.set $std/operator-overloading/eq - global.get $std/operator-overloading/eq - if - i32.const 0 - i32.const 1456 - i32.const 209 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/eq3 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/eq4 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.ne - if (result i32) + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.ne + else + i32.const 0 + end + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq + if + i32.const 0 + i32.const 1456 + i32.const 209 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/eq3 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/eq4 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.ne - else - i32.const 0 - end - global.set $std/operator-overloading/eqf - global.get $std/operator-overloading/eqf - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 213 + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.ne + else + i32.const 0 + end + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2147483647 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gt1 - i32.const 1 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gt2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/gt1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/gt2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.gt_s - if (result i32) + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 213 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2147483647 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gt1 + i32.const 1 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gt2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/gt1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/gt2 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.gt_s - else - i32.const 0 - end - global.set $std/operator-overloading/gt - global.get $std/operator-overloading/gt - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 219 + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.gt_s + else + i32.const 0 + end + global.set $std/operator-overloading/gt + global.get $std/operator-overloading/gt i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gte1 - i32.const 2 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gte2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/gte1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/gte2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.ge_s - if (result i32) + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 219 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gte1 + i32.const 2 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gte2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/gte1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/gte2 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.ge_s - else - i32.const 0 - end - global.set $std/operator-overloading/gte - global.get $std/operator-overloading/gte - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 225 + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.ge_s + else + i32.const 0 + end + global.set $std/operator-overloading/gte + global.get $std/operator-overloading/gte i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const -1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/le1 - i32.const 6 - i32.const 6 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/le2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/le1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/le2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.lt_s - if (result i32) + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 225 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const -1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/le1 + i32.const 6 + i32.const 6 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/le2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/le1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/le2 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.lt_s - else - i32.const 0 - end - global.set $std/operator-overloading/le - global.get $std/operator-overloading/le - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 231 + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.lt_s + else + i32.const 0 + end + global.set $std/operator-overloading/le + global.get $std/operator-overloading/le i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 4 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/leq1 - i32.const 4 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/leq2 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/leq1 - local.tee $1 - i32.store - local.get $0 - global.get $std/operator-overloading/leq2 - local.tee $0 - i32.store offset=4 - local.get $1 - i32.load - local.get $0 - i32.load - i32.le_s - if (result i32) + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 231 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/leq1 + i32.const 4 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/leq2 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/leq1 + local.tee $1 + i32.store + local.get $0 + global.get $std/operator-overloading/leq2 + local.tee $0 + i32.store offset=4 local.get $1 - i32.load offset=4 + i32.load local.get $0 - i32.load offset=4 + i32.load i32.le_s - else - i32.const 0 - end - global.set $std/operator-overloading/leq - global.get $std/operator-overloading/leq - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 237 + if (result i32) + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.le_s + else + i32.const 0 + end + global.set $std/operator-overloading/leq + global.get $std/operator-overloading/leq i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 8 - i32.const 16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shr - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/shr - local.tee $0 - i32.store - local.get $0 - i32.load - i32.const 3 - i32.shr_s - local.get $0 - i32.load offset=4 - i32.const 3 - i32.shr_s - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/sres - global.get $std/operator-overloading/sres - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/sres + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 237 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shr + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/shr + local.tee $0 + i32.store + local.get $0 + i32.load + i32.const 3 + i32.shr_s + local.get $0 i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 242 + i32.const 3 + i32.shr_s + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres + i32.load i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -8 - i32.const -16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shu - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/shu - local.tee $0 - i32.store - local.get $0 - i32.load - i32.const 3 - i32.shr_u - local.get $0 - i32.load offset=4 - i32.const 3 - i32.shr_u - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/ures - global.get $std/operator-overloading/ures - i32.load - i32.const 536870911 - i32.eq - if (result i32) - global.get $std/operator-overloading/ures + i32.eq + if (result i32) + global.get $std/operator-overloading/sres + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 242 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const -8 + i32.const -16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shu + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/shu + local.tee $0 + i32.store + local.get $0 + i32.load + i32.const 3 + i32.shr_u + local.get $0 i32.load offset=4 - i32.const 536870910 + i32.const 3 + i32.shr_u + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/ures + global.get $std/operator-overloading/ures + i32.load + i32.const 536870911 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 247 + if (result i32) + global.get $std/operator-overloading/ures + i32.load offset=4 + i32.const 536870910 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 247 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shl - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/shl - local.tee $0 - i32.store - local.get $0 - i32.load - i32.const 3 - i32.shl - local.get $0 - i32.load offset=4 - i32.const 3 - i32.shl - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/sres - global.get $std/operator-overloading/sres - i32.load - i32.const 8 - i32.eq - if (result i32) - global.get $std/operator-overloading/sres + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shl + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/shl + local.tee $0 + i32.store + local.get $0 + i32.load + i32.const 3 + i32.shl + local.get $0 i32.load offset=4 - i32.const 16 + i32.const 3 + i32.shl + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres + i32.load + i32.const 8 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 252 + if (result i32) + global.get $std/operator-overloading/sres + i32.load offset=4 + i32.const 16 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 252 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/pos - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/pos - local.tee $0 - i32.store - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/pres - global.get $std/operator-overloading/pres - i32.load - global.get $std/operator-overloading/pos - i32.load - i32.eq - if (result i32) - global.get $std/operator-overloading/pres + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/pos + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/pos + local.tee $0 + i32.store + local.get $0 + i32.load + local.get $0 i32.load offset=4 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/pres + global.get $std/operator-overloading/pres + i32.load global.get $std/operator-overloading/pos - i32.load offset=4 + i32.load i32.eq - else + if (result i32) + global.get $std/operator-overloading/pres + i32.load offset=4 + global.get $std/operator-overloading/pos + i32.load offset=4 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 257 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const -1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/neg + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/neg + local.tee $0 + i32.store i32.const 0 - end - i32.eqz - if + local.get $0 + i32.load + i32.sub i32.const 0 - i32.const 1456 - i32.const 257 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/neg - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/neg - local.tee $0 - i32.store - i32.const 0 - local.get $0 - i32.load - i32.sub - i32.const 0 - local.get $0 - i32.load offset=4 - i32.sub - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/nres - global.get $std/operator-overloading/nres - i32.load - i32.const 0 - global.get $std/operator-overloading/neg - i32.load - i32.sub - i32.eq - if (result i32) - global.get $std/operator-overloading/nres + local.get $0 i32.load offset=4 + i32.sub + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/nres + global.get $std/operator-overloading/nres + i32.load i32.const 0 global.get $std/operator-overloading/neg - i32.load offset=4 + i32.load i32.sub i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 262 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 255 - i32.const 16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/not - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/not - local.tee $0 - i32.store - local.get $0 - i32.load - i32.const -1 - i32.xor - local.get $0 - i32.load offset=4 - i32.const -1 - i32.xor - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/res - global.get $std/operator-overloading/res - i32.load - global.get $std/operator-overloading/not - i32.load - i32.const -1 - i32.xor - i32.eq - if (result i32) - global.get $std/operator-overloading/res - i32.load offset=4 + if (result i32) + global.get $std/operator-overloading/nres + i32.load offset=4 + i32.const 0 + global.get $std/operator-overloading/neg + i32.load offset=4 + i32.sub + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 262 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 255 + i32.const 16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/not + global.get $~lib/memory/__stack_pointer global.get $std/operator-overloading/not + local.tee $0 + i32.store + local.get $0 + i32.load + i32.const -1 + i32.xor + local.get $0 i32.load offset=4 i32.const -1 i32.xor + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/res + global.get $std/operator-overloading/res + i32.load + global.get $std/operator-overloading/not + i32.load + i32.const -1 + i32.xor i32.eq - else + if (result i32) + global.get $std/operator-overloading/res + i32.load offset=4 + global.get $std/operator-overloading/not + i32.load offset=4 + i32.const -1 + i32.xor + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 267 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 0 - end - i32.eqz - if i32.const 0 - i32.const 1456 - i32.const 267 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/excl - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/excl - local.tee $0 - i32.store - local.get $0 - i32.load - if (result i32) - i32.const 1 - else + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/excl + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/excl + local.tee $0 + i32.store local.get $0 - i32.load offset=4 - end - i32.eqz - global.set $std/operator-overloading/bres - global.get $std/operator-overloading/bres - global.get $std/operator-overloading/excl - i32.load - if (result i32) - i32.const 1 - else + i32.load + if (result i32) + i32.const 1 + else + local.get $0 + i32.load offset=4 + end + i32.eqz + global.set $std/operator-overloading/bres + global.get $std/operator-overloading/bres global.get $std/operator-overloading/excl - i32.load offset=4 - end - i32.eqz - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 272 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/bres - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1456 - i32.const 273 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.add - i32.store - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.add - i32.store offset=4 - local.get $0 - global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/incdec - i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 279 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.sub - i32.store - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - i32.load - if (result i32) + i32.load + if (result i32) + i32.const 1 + else + global.get $std/operator-overloading/excl + i32.load offset=4 + end + i32.eqz + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 272 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/bres + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 273 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 0 - else + i32.const 1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + global.get $~lib/memory/__stack_pointer global.get $std/operator-overloading/incdec + local.tee $0 + i32.store + local.get $0 + local.get $0 + i32.load + i32.const 1 + i32.add + i32.store + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + i32.load + i32.const 1 i32.eq - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 282 + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 279 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/incdec + local.tee $0 + i32.store + local.get $0 + local.get $0 + i32.load i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store offset=8 - local.get $0 - i32.load - i32.const 1 - i32.add - local.get $0 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - local.get $0 - global.set $std/operator-overloading/tmp - global.get $std/operator-overloading/tmp - i32.load - if (result i32) - i32.const 0 - else - global.get $std/operator-overloading/tmp + i32.sub + i32.store + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 - i32.eq - end - i32.eqz - if + i32.sub + i32.store offset=4 + local.get $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + i32.load + if (result i32) + i32.const 0 + else + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 1 + i32.eq + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 282 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 1456 - i32.const 287 i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/incdec - i32.load - i32.const 1 - i32.eq - if (result i32) + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + global.get $~lib/memory/__stack_pointer global.get $std/operator-overloading/incdec + local.tee $0 + i32.store offset=8 + local.get $0 + i32.load + i32.const 1 + i32.add + local.get $0 i32.load offset=4 - i32.const 2 + i32.const 1 + i32.add + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp + i32.load + if (result i32) + i32.const 0 + else + global.get $std/operator-overloading/tmp + i32.load offset=4 + i32.const 1 + i32.eq + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 287 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/incdec + i32.load + i32.const 1 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 288 + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 288 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/incdec + local.tee $0 + i32.store offset=8 + local.get $0 + i32.load i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store offset=8 - local.get $0 - i32.load - i32.const 1 - i32.sub - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - local.get $0 - global.set $std/operator-overloading/tmp - global.get $std/operator-overloading/tmp - i32.load - i32.const 1 - i32.eq - if (result i32) + i32.sub + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp global.get $std/operator-overloading/tmp + i32.load + i32.const 1 + i32.eq + if (result i32) + global.get $std/operator-overloading/tmp + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 291 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/incdec + i32.load + if (result i32) + i32.const 0 + else + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 1 + i32.eq + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 292 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + i32.const 2 + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais1 + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/ais1 + local.tee $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=8 + local.get $1 + i32.load + i32.const 1 + i32.add + local.get $1 + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais1 + i32.const 2 + i32.const 3 + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais2 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/ais1 + local.tee $0 + i32.store offset=12 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/ais2 + local.tee $1 + i32.store offset=8 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 i32.load offset=4 - i32.const 2 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais + global.get $std/operator-overloading/ais + i32.load + i32.const 4 i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 291 + if (result i32) + global.get $std/operator-overloading/ais + i32.load offset=4 + i32.const 6 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 312 + i32.const 1 + call $~lib/builtins/abort + unreachable + end i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/incdec - i32.load - if (result i32) - i32.const 0 - else - global.get $std/operator-overloading/incdec - i32.load offset=4 + i32.const 2 + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii1 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii1 + local.tee $0 + i32.store offset=8 + local.get $0 + i32.load i32.const 1 - i32.eq - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 292 + i32.add + local.get $0 + i32.load offset=4 i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const 2 - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais1 - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $std/operator-overloading/ais1 - local.tee $1 - i32.store - local.get $0 - local.get $1 - i32.store offset=8 - local.get $1 - i32.load - i32.const 1 - i32.add - local.get $1 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais1 - i32.const 2 - i32.const 3 - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais2 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/ais1 - local.tee $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/ais2 - local.tee $1 - i32.store offset=8 - local.get $0 - i32.load - local.get $1 - i32.load - i32.add - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais - global.get $std/operator-overloading/ais - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/ais + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii1 + i32.const 2 + i32.const 3 + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii2 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii1 + local.tee $0 + i32.store offset=8 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii2 + local.tee $1 + i32.store offset=12 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 i32.load offset=4 - i32.const 6 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii + global.get $std/operator-overloading/aii + i32.load + i32.const 4 i32.eq - else - i32.const 0 - end - i32.eqz - if + if (result i32) + global.get $std/operator-overloading/aii + i32.load offset=4 + i32.const 6 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1456 + i32.const 332 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1644 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 i32.const 0 - i32.const 1456 - i32.const 312 - i32.const 1 - call $~lib/builtins/abort - unreachable + i32.store + local.get $0 + i32.const 6 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + local.get $0 + f32.const 1 + f32.store + local.get $0 + f32.const 2 + f32.store offset=4 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $0 + global.set $std/operator-overloading/tea + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/tea + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 1536 + i32.store offset=4 + local.get $0 + i32.const 1536 + f32.const -1 + call $std/operator-overloading/TesterElementAccess#__set + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/tea + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 1568 + i32.store offset=4 + local.get $0 + i32.const 1568 + f32.const -2 + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + f32.load + f32.const -1 + f32.ne + if + i32.const 0 + i32.const 1456 + i32.const 357 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/tea + local.tee $1 + i32.store + local.get $0 + i32.const 1536 + i32.store offset=4 + local.get $1 + i32.const 1536 + call $std/operator-overloading/TesterElementAccess#__get + f32.const -1 + f32.ne + if + i32.const 0 + i32.const 1456 + i32.const 358 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + f32.load offset=4 + f32.const -2 + f32.ne + if + i32.const 0 + i32.const 1456 + i32.const 360 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/tea + local.tee $1 + i32.store + local.get $0 + i32.const 1568 + i32.store offset=4 + local.get $1 + i32.const 1568 + call $std/operator-overloading/TesterElementAccess#__get + f32.const -2 + f32.ne + if + i32.const 0 + i32.const 1456 + i32.const 361 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 16 + i32.add + global.set $~lib/memory/__stack_pointer + return end + i32.const 18048 + i32.const 18096 i32.const 1 - i32.const 2 - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii1 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii1 - local.tee $0 - i32.store offset=8 - local.get $0 - i32.load - i32.const 1 - i32.add - local.get $0 - i32.load offset=4 i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii1 - i32.const 2 - i32.const 3 - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii2 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii1 - local.tee $0 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii2 - local.tee $1 - i32.store offset=12 - local.get $0 - i32.load - local.get $1 - i32.load - i32.add - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii - global.get $std/operator-overloading/aii - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/aii - i32.load offset=4 - i32.const 6 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1456 - i32.const 332 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 16 - i32.add - global.set $~lib/memory/__stack_pointer + call $~lib/builtins/abort + unreachable ) (func $std/operator-overloading/Tester#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3329,11 +3656,11 @@ i32.sub global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - i32.const 1572 + i32.const 1644 i32.lt_s if - i32.const 17984 - i32.const 18032 + i32.const 18048 + i32.const 18096 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -3367,11 +3694,11 @@ i32.sub global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - i32.const 1572 + i32.const 1644 i32.lt_s if - i32.const 17984 - i32.const 18032 + i32.const 18048 + i32.const 18096 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -3405,11 +3732,11 @@ i32.sub global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - i32.const 1572 + i32.const 1644 i32.lt_s if - i32.const 17984 - i32.const 18032 + i32.const 18048 + i32.const 18096 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -3479,7 +3806,7 @@ if i32.const 0 local.get $1 - i32.const 17956 + i32.const 18028 i32.lt_u local.get $1 i32.load offset=8 @@ -3530,7 +3857,7 @@ i32.const 1 else local.get $0 - i32.const 1520 + i32.const 1584 i32.load i32.gt_u if @@ -3544,7 +3871,7 @@ local.get $0 i32.const 3 i32.shl - i32.const 1524 + i32.const 1588 i32.add i32.load i32.const 32 diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index 314f5cc9fa..e2b095db61 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -330,3 +330,32 @@ aii1++; // 2, 3 var aii2 = new TesterInlineInstance(2, 3); var aii = aii1 + aii2; assert(aii.x == 4 && aii.y == 6); + +// test custom element access overloading with string keys +class TesterElementAccess { + [key: string]: number; + constructor( + public x: f32, + public y: f32 + ) {} + @operator("[]") + __get(key: string): f32 { + return key == "x" ? this.x : this.y; + } + @operator("[]=") + __set(key: string, value: f32): void { + if (key == "x") this.x = value; + else this.y = value; + } +} + +var tea = new TesterElementAccess(1, 2); + +tea["x"] = -1.0; +tea["y"] = -2.0; + +assert(tea.x == f32(-1.0)); +assert(tea["x"] == f32(-1.0)); + +assert(tea.y == f32(-2.0)); +assert(tea["y"] == f32(-2.0)); From 5eb944810c3a4d22ab3e90bc4d5668033f85f8e3 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Thu, 25 Aug 2022 22:49:46 +0300 Subject: [PATCH 02/13] refactor --- src/compiler.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index 77d1104b78..bf0b0b5a0e 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5545,9 +5545,12 @@ export class Compiler extends DiagnosticEmitter { } return this.module.unreachable(); } - assert(indexedSet.signature.parameterTypes.length == 2); // parser must guarantee this - elementType = indexedSet.signature.parameterTypes[0]; // 1st parameter is the index - targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element + let parameterTypes = indexedSet.signature.parameterTypes; + + assert(parameterTypes.length == 2); // parser must guarantee this + elementType = parameterTypes[0]; // 1st parameter is the index + targetType = parameterTypes[1]; // 2nd parameter is the element + if (indexedSet.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(expression); if (!isUnchecked && this.options.pedantic) { this.pedantic( From 3595af7573e89333430254badc20537576fb8305 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 07:37:41 +0300 Subject: [PATCH 03/13] refactor tests --- tests/compiler/std/operator-overloading.debug.wat | 8 ++++---- tests/compiler/std/operator-overloading.release.wat | 8 ++++---- tests/compiler/std/operator-overloading.ts | 9 ++++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index a9c0f7858d..9c36ad3aae 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -4837,7 +4837,7 @@ if i32.const 0 i32.const 432 - i32.const 357 + i32.const 360 i32.const 1 call $~lib/builtins/abort unreachable @@ -4861,7 +4861,7 @@ if i32.const 0 i32.const 432 - i32.const 358 + i32.const 361 i32.const 1 call $~lib/builtins/abort unreachable @@ -4874,7 +4874,7 @@ if i32.const 0 i32.const 432 - i32.const 360 + i32.const 363 i32.const 1 call $~lib/builtins/abort unreachable @@ -4898,7 +4898,7 @@ if i32.const 0 i32.const 432 - i32.const 361 + i32.const 364 i32.const 1 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/operator-overloading.release.wat b/tests/compiler/std/operator-overloading.release.wat index 1ef1e5049d..055cab5f8a 100644 --- a/tests/compiler/std/operator-overloading.release.wat +++ b/tests/compiler/std/operator-overloading.release.wat @@ -3577,7 +3577,7 @@ if i32.const 0 i32.const 1456 - i32.const 357 + i32.const 360 i32.const 1 call $~lib/builtins/abort unreachable @@ -3598,7 +3598,7 @@ if i32.const 0 i32.const 1456 - i32.const 358 + i32.const 361 i32.const 1 call $~lib/builtins/abort unreachable @@ -3610,7 +3610,7 @@ if i32.const 0 i32.const 1456 - i32.const 360 + i32.const 363 i32.const 1 call $~lib/builtins/abort unreachable @@ -3631,7 +3631,7 @@ if i32.const 0 i32.const 1456 - i32.const 361 + i32.const 364 i32.const 1 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index e2b095db61..984ed98904 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -340,12 +340,15 @@ class TesterElementAccess { ) {} @operator("[]") __get(key: string): f32 { - return key == "x" ? this.x : this.y; + return key == "x" + ? this.x + : this.y; } @operator("[]=") __set(key: string, value: f32): void { - if (key == "x") this.x = value; - else this.y = value; + key == "x" + ? this.x = value + : this.y = value; } } From 102e5f0b55b3effe08e681e90d97ddbc083584eb Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 08:12:18 +0300 Subject: [PATCH 04/13] wip --- .../std/operator-overloading.debug.wat | 5047 ----------------- tests/compiler/std/operator-overloading.ts | 6 + 2 files changed, 6 insertions(+), 5047 deletions(-) diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index 9c36ad3aae..e69de29bb2 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -1,5047 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param 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_f32_=>_none (func (param i32 f32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (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)) - (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) - (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) - (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) - (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) - (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) - (global $std/operator-overloading/a1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/a2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/a (mut i32) (i32.const 0)) - (global $std/operator-overloading/s1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/s2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/s (mut i32) (i32.const 0)) - (global $std/operator-overloading/m1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/m2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/m (mut i32) (i32.const 0)) - (global $std/operator-overloading/d1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/d2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/d (mut i32) (i32.const 0)) - (global $std/operator-overloading/f1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/f2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/f (mut i32) (i32.const 0)) - (global $std/operator-overloading/p1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/p2 (mut i32) (i32.const 0)) - (global $~lib/native/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $std/operator-overloading/p (mut i32) (i32.const 0)) - (global $std/operator-overloading/n1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/n2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/n (mut i32) (i32.const 0)) - (global $std/operator-overloading/o1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/o2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/o (mut i32) (i32.const 0)) - (global $std/operator-overloading/x1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/x2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/x (mut i32) (i32.const 0)) - (global $std/operator-overloading/eq1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/eq2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/eq (mut i32) (i32.const 0)) - (global $std/operator-overloading/eq3 (mut i32) (i32.const 0)) - (global $std/operator-overloading/eq4 (mut i32) (i32.const 0)) - (global $std/operator-overloading/eqf (mut i32) (i32.const 0)) - (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $std/operator-overloading/gt1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/gt2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/gt (mut i32) (i32.const 0)) - (global $std/operator-overloading/gte1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/gte2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/gte (mut i32) (i32.const 0)) - (global $std/operator-overloading/le1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/le2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/le (mut i32) (i32.const 0)) - (global $std/operator-overloading/leq1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/leq2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/leq (mut i32) (i32.const 0)) - (global $std/operator-overloading/shr (mut i32) (i32.const 0)) - (global $std/operator-overloading/sres (mut i32) (i32.const 0)) - (global $std/operator-overloading/shu (mut i32) (i32.const 0)) - (global $std/operator-overloading/ures (mut i32) (i32.const 0)) - (global $std/operator-overloading/shl (mut i32) (i32.const 0)) - (global $std/operator-overloading/pos (mut i32) (i32.const 0)) - (global $std/operator-overloading/pres (mut i32) (i32.const 0)) - (global $std/operator-overloading/neg (mut i32) (i32.const 0)) - (global $std/operator-overloading/nres (mut i32) (i32.const 0)) - (global $std/operator-overloading/not (mut i32) (i32.const 0)) - (global $std/operator-overloading/res (mut i32) (i32.const 0)) - (global $std/operator-overloading/excl (mut i32) (i32.const 0)) - (global $std/operator-overloading/bres (mut i32) (i32.const 0)) - (global $std/operator-overloading/incdec (mut i32) (i32.const 0)) - (global $std/operator-overloading/tmp (mut i32) (i32.const 0)) - (global $std/operator-overloading/ais1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/ais2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/ais (mut i32) (i32.const 0)) - (global $std/operator-overloading/aii1 (mut i32) (i32.const 0)) - (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) - (global $std/operator-overloading/aii (mut i32) (i32.const 0)) - (global $std/operator-overloading/tea (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 560)) - (global $~lib/memory/__data_end i32 (i32.const 620)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17004)) - (global $~lib/memory/__heap_base i32 (i32.const 17004)) - (memory $0 1) - (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 144) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 176) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 204) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") - (data (i32.const 268) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") - (data (i32.const 320) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 348) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 412) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00\00\00\00\00\00\00") - (data (i32.const 492) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00x\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 524) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00y\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 560) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") - (table $0 1 1 funcref) - (elem $0 (i32.const 1)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/rt/itcms/Object#set:prev (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=8 - ) - (func $~lib/rt/itcms/initLazy (param $space i32) (result i32) - local.get $space - local.get $space - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $space - local.get $space - call $~lib/rt/itcms/Object#set:prev - local.get $space - ) - (func $~lib/rt/itcms/Object#get:next (param $this i32) (result i32) - local.get $this - i32.load offset=4 - i32.const 3 - i32.const -1 - i32.xor - i32.and - ) - (func $~lib/rt/itcms/Object#get:color (param $this i32) (result i32) - local.get $this - i32.load offset=4 - i32.const 3 - i32.and - ) - (func $~lib/rt/itcms/visitRoots (param $cookie i32) - (local $pn i32) - (local $iter i32) - (local $var$3 i32) - local.get $cookie - call $~lib/rt/__visit_globals - global.get $~lib/rt/itcms/pinSpace - local.set $pn - local.get $pn - call $~lib/rt/itcms/Object#get:next - local.set $iter - loop $while-continue|0 - local.get $iter - local.get $pn - i32.ne - local.set $var$3 - local.get $var$3 - if - i32.const 1 - drop - local.get $iter - call $~lib/rt/itcms/Object#get:color - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 96 - i32.const 159 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $iter - i32.const 20 - i32.add - local.get $cookie - call $~lib/rt/__visit_members - local.get $iter - call $~lib/rt/itcms/Object#get:next - local.set $iter - br $while-continue|0 - end - end - ) - (func $~lib/rt/itcms/Object#set:color (param $this i32) (param $color i32) - local.get $this - local.get $this - i32.load offset=4 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $color - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor - ) - (func $~lib/rt/itcms/Object#set:next (param $this i32) (param $obj i32) - local.get $this - local.get $obj - local.get $this - i32.load offset=4 - i32.const 3 - i32.and - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor - ) - (func $~lib/rt/itcms/Object#unlink (param $this i32) - (local $next i32) - (local $prev i32) - local.get $this - call $~lib/rt/itcms/Object#get:next - local.set $next - local.get $next - i32.const 0 - i32.eq - if - i32.const 1 - drop - local.get $this - i32.load offset=8 - i32.const 0 - i32.eq - if (result i32) - local.get $this - global.get $~lib/memory/__heap_base - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 96 - i32.const 127 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - return - end - local.get $this - i32.load offset=8 - local.set $prev - i32.const 1 - drop - local.get $prev - i32.eqz - if - i32.const 0 - i32.const 96 - i32.const 131 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $next - local.get $prev - call $~lib/rt/itcms/Object#set:prev - local.get $prev - local.get $next - call $~lib/rt/itcms/Object#set:next - ) - (func $~lib/rt/__typeinfo (param $id i32) (result i32) - (local $ptr i32) - global.get $~lib/rt/__rtti_base - local.set $ptr - local.get $id - local.get $ptr - i32.load - i32.gt_u - if - i32.const 224 - i32.const 288 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $ptr - i32.const 4 - i32.add - local.get $id - i32.const 8 - i32.mul - i32.add - i32.load - ) - (func $~lib/rt/itcms/Object#get:isPointerfree (param $this i32) (result i32) - (local $rtId i32) - local.get $this - i32.load offset=12 - local.set $rtId - local.get $rtId - i32.const 1 - i32.le_u - if (result i32) - i32.const 1 - else - local.get $rtId - call $~lib/rt/__typeinfo - i32.const 32 - i32.and - i32.const 0 - i32.ne - end - ) - (func $~lib/rt/itcms/Object#linkTo (param $this i32) (param $list i32) (param $withColor i32) - (local $prev i32) - local.get $list - i32.load offset=8 - local.set $prev - local.get $this - local.get $list - local.get $withColor - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $this - local.get $prev - call $~lib/rt/itcms/Object#set:prev - local.get $prev - local.get $this - call $~lib/rt/itcms/Object#set:next - local.get $list - local.get $this - call $~lib/rt/itcms/Object#set:prev - ) - (func $~lib/rt/itcms/Object#makeGray (param $this i32) - (local $var$1 i32) - local.get $this - global.get $~lib/rt/itcms/iter - i32.eq - if - local.get $this - i32.load offset=8 - local.tee $var$1 - i32.eqz - if (result i32) - i32.const 0 - i32.const 96 - i32.const 147 - i32.const 30 - call $~lib/builtins/abort - unreachable - else - local.get $var$1 - end - global.set $~lib/rt/itcms/iter - end - local.get $this - call $~lib/rt/itcms/Object#unlink - local.get $this - global.get $~lib/rt/itcms/toSpace - local.get $this - call $~lib/rt/itcms/Object#get:isPointerfree - if (result i32) - global.get $~lib/rt/itcms/white - i32.eqz - else - i32.const 2 - end - call $~lib/rt/itcms/Object#linkTo - ) - (func $~lib/rt/itcms/__visit (param $ptr i32) (param $cookie i32) - (local $obj i32) - local.get $ptr - i32.eqz - if - return - end - local.get $ptr - i32.const 20 - i32.sub - local.set $obj - i32.const 0 - drop - local.get $obj - call $~lib/rt/itcms/Object#get:color - global.get $~lib/rt/itcms/white - i32.eq - if - local.get $obj - call $~lib/rt/itcms/Object#makeGray - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.add - global.set $~lib/rt/itcms/visitCount - end - ) - (func $~lib/rt/itcms/visitStack (param $cookie i32) - (local $ptr i32) - (local $var$2 i32) - global.get $~lib/memory/__stack_pointer - local.set $ptr - loop $while-continue|0 - local.get $ptr - global.get $~lib/memory/__heap_base - i32.lt_u - local.set $var$2 - local.get $var$2 - if - local.get $ptr - i32.load - local.get $cookie - call $~lib/rt/itcms/__visit - local.get $ptr - i32.const 4 - i32.add - local.set $ptr - br $while-continue|0 - end - end - ) - (func $~lib/rt/itcms/Object#get:size (param $this i32) (result i32) - i32.const 4 - local.get $this - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - ) - (func $~lib/rt/tlsf/Root#set:flMap (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $~lib/rt/common/BLOCK#set:mmInfo (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $~lib/rt/tlsf/Block#set:prev (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/Block#set:next (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=8 - ) - (func $~lib/rt/tlsf/removeBlock (param $root i32) (param $block i32) - (local $blockInfo i32) - (local $size i32) - (local $fl i32) - (local $sl i32) - (local $var$6 i32) - (local $var$7 i32) - (local $prev i32) - (local $next i32) - (local $var$10 i32) - (local $var$11 i32) - local.get $block - i32.load - local.set $blockInfo - i32.const 1 - drop - local.get $blockInfo - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 368 - 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 368 - 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 $var$6 - i32.const 1073741820 - local.tee $var$7 - local.get $var$6 - local.get $var$7 - i32.lt_u - select - local.set $var$6 - i32.const 31 - local.get $var$6 - i32.clz - i32.sub - local.set $fl - local.get $var$6 - 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 368 - i32.const 284 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $block - i32.load offset=4 - local.set $prev - local.get $block - i32.load offset=8 - 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 - local.get $root - local.set $var$10 - local.get $fl - local.set $var$6 - local.get $sl - local.set $var$7 - local.get $var$10 - local.get $var$6 - i32.const 4 - i32.shl - local.get $var$7 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $root - local.set $var$11 - local.get $fl - local.set $var$10 - local.get $sl - local.set $var$6 - local.get $next - local.set $var$7 - local.get $var$11 - local.get $var$10 - i32.const 4 - i32.shl - local.get $var$6 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $var$7 - i32.store offset=96 - local.get $next - i32.eqz - if - local.get $root - local.set $var$6 - local.get $fl - local.set $var$7 - local.get $var$6 - local.get $var$7 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $var$6 - local.get $root - local.set $var$7 - local.get $fl - local.set $var$11 - local.get $var$6 - i32.const 1 - local.get $sl - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $var$6 - local.set $var$10 - local.get $var$7 - local.get $var$11 - i32.const 2 - i32.shl - i32.add - local.get $var$10 - i32.store offset=4 - local.get $var$6 - i32.eqz - if - local.get $root - local.get $root - i32.load - 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 $var$3 i32) - (local $right i32) - (local $rightInfo i32) - (local $var$6 i32) - (local $size i32) - (local $fl i32) - (local $sl i32) - (local $var$10 i32) - (local $head i32) - (local $var$12 i32) - (local $var$13 i32) - i32.const 1 - drop - local.get $block - i32.eqz - if - i32.const 0 - i32.const 368 - i32.const 201 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $block - i32.load - local.set $blockInfo - i32.const 1 - drop - local.get $blockInfo - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 368 - i32.const 203 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $block - local.set $var$3 - local.get $var$3 - i32.const 4 - i32.add - local.get $var$3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $right - local.get $right - i32.load - 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 - local.get $block - local.set $var$3 - local.get $var$3 - i32.const 4 - i32.add - local.get $var$3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $right - local.get $right - i32.load - local.set $rightInfo - end - local.get $blockInfo - i32.const 2 - i32.and - if - local.get $block - local.set $var$3 - local.get $var$3 - i32.const 4 - i32.sub - i32.load - local.set $var$3 - local.get $var$3 - i32.load - local.set $var$6 - i32.const 1 - drop - local.get $var$6 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 368 - i32.const 221 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $root - local.get $var$3 - call $~lib/rt/tlsf/removeBlock - local.get $var$3 - local.set $block - local.get $block - local.get $var$6 - 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 368 - 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 368 - 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 - 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 $var$3 - i32.const 1073741820 - local.tee $var$6 - local.get $var$3 - local.get $var$6 - i32.lt_u - select - local.set $var$3 - i32.const 31 - local.get $var$3 - i32.clz - i32.sub - local.set $fl - local.get $var$3 - 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 368 - i32.const 251 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $root - local.set $var$10 - local.get $fl - local.set $var$3 - local.get $sl - local.set $var$6 - local.get $var$10 - local.get $var$3 - i32.const 4 - i32.shl - local.get $var$6 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - 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 $var$12 - local.get $fl - local.set $var$10 - local.get $sl - local.set $var$3 - local.get $block - local.set $var$6 - local.get $var$12 - local.get $var$10 - i32.const 4 - i32.shl - local.get $var$3 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $var$6 - i32.store offset=96 - local.get $root - local.get $root - i32.load - i32.const 1 - local.get $fl - i32.shl - i32.or - call $~lib/rt/tlsf/Root#set:flMap - local.get $root - local.set $var$13 - local.get $fl - local.set $var$12 - local.get $root - local.set $var$3 - local.get $fl - local.set $var$6 - local.get $var$3 - local.get $var$6 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 1 - local.get $sl - i32.shl - i32.or - local.set $var$10 - local.get $var$13 - local.get $var$12 - i32.const 2 - i32.shl - i32.add - local.get $var$10 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) - (local $var$3 i32) - (local $tail i32) - (local $tailInfo i32) - (local $size i32) - (local $leftSize i32) - (local $left i32) - (local $var$9 i32) - i32.const 1 - drop - local.get $start - local.get $end - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 368 - 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 - local.get $root - local.set $var$3 - local.get $var$3 - i32.load offset=1568 - 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 368 - 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 - i32.load - 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 368 - 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 $var$9 - local.get $tail - local.set $var$3 - local.get $var$9 - local.get $var$3 - i32.store offset=1568 - local.get $root - local.get $left - call $~lib/rt/tlsf/insertBlock - i32.const 1 - ) - (func $~lib/rt/tlsf/initialize - (local $rootOffset i32) - (local $pagesBefore i32) - (local $pagesNeeded i32) - (local $root i32) - (local $var$4 i32) - (local $var$5 i32) - (local $var$6 i32) - (local $var$7 i32) - (local $var$8 i32) - (local $var$9 i32) - (local $var$10 i32) - (local $var$11 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 - 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 - 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 $var$5 - i32.const 0 - local.set $var$4 - local.get $var$5 - local.get $var$4 - i32.store offset=1568 - i32.const 0 - local.set $var$5 - loop $for-loop|0 - local.get $var$5 - i32.const 23 - i32.lt_u - local.set $var$4 - local.get $var$4 - if - local.get $root - local.set $var$8 - local.get $var$5 - local.set $var$7 - i32.const 0 - local.set $var$6 - local.get $var$8 - local.get $var$7 - i32.const 2 - i32.shl - i32.add - local.get $var$6 - i32.store offset=4 - i32.const 0 - local.set $var$8 - loop $for-loop|1 - local.get $var$8 - i32.const 16 - i32.lt_u - local.set $var$7 - local.get $var$7 - if - local.get $root - local.set $var$11 - local.get $var$5 - local.set $var$10 - local.get $var$8 - local.set $var$9 - i32.const 0 - local.set $var$6 - local.get $var$11 - local.get $var$10 - i32.const 4 - i32.shl - local.get $var$9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $var$6 - i32.store offset=96 - local.get $var$8 - i32.const 1 - i32.add - local.set $var$8 - br $for-loop|1 - end - end - local.get $var$5 - i32.const 1 - i32.add - local.set $var$5 - 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 - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $root - global.set $~lib/rt/tlsf/ROOT - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $ptr i32) (result i32) - (local $block i32) - local.get $ptr - i32.const 4 - i32.sub - local.set $block - local.get $ptr - i32.const 0 - i32.ne - if (result i32) - local.get $ptr - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $block - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 368 - i32.const 559 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $block - ) - (func $~lib/rt/tlsf/freeBlock (param $root i32) (param $block i32) - i32.const 0 - drop - local.get $block - local.get $block - i32.load - i32.const 1 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $root - local.get $block - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/__free (param $ptr i32) - local.get $ptr - global.get $~lib/memory/__heap_base - i32.lt_u - if - return - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $ptr - call $~lib/rt/tlsf/checkUsedBlock - call $~lib/rt/tlsf/freeBlock - ) - (func $~lib/rt/itcms/free (param $obj i32) - local.get $obj - global.get $~lib/memory/__heap_base - i32.lt_u - if - local.get $obj - i32.const 0 - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $obj - i32.const 0 - call $~lib/rt/itcms/Object#set:prev - else - global.get $~lib/rt/itcms/total - local.get $obj - call $~lib/rt/itcms/Object#get:size - i32.sub - global.set $~lib/rt/itcms/total - i32.const 0 - drop - local.get $obj - i32.const 4 - i32.add - call $~lib/rt/tlsf/__free - end - ) - (func $~lib/rt/itcms/step (result i32) - (local $obj i32) - (local $var$1 i32) - (local $var$2 i32) - block $break|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/rt/itcms/state - local.set $var$1 - local.get $var$1 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $var$1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $var$1 - i32.const 2 - i32.eq - br_if $case2|0 - br $break|0 - end - i32.const 1 - global.set $~lib/rt/itcms/state - i32.const 0 - global.set $~lib/rt/itcms/visitCount - i32.const 0 - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/iter - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - global.get $~lib/rt/itcms/white - i32.eqz - local.set $var$1 - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $obj - loop $while-continue|1 - local.get $obj - global.get $~lib/rt/itcms/toSpace - i32.ne - local.set $var$2 - local.get $var$2 - if - local.get $obj - global.set $~lib/rt/itcms/iter - local.get $obj - call $~lib/rt/itcms/Object#get:color - local.get $var$1 - i32.ne - if - local.get $obj - local.get $var$1 - call $~lib/rt/itcms/Object#set:color - i32.const 0 - global.set $~lib/rt/itcms/visitCount - local.get $obj - i32.const 20 - i32.add - i32.const 0 - call $~lib/rt/__visit_members - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - local.get $obj - call $~lib/rt/itcms/Object#get:next - local.set $obj - br $while-continue|1 - end - end - i32.const 0 - global.set $~lib/rt/itcms/visitCount - i32.const 0 - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $obj - local.get $obj - global.get $~lib/rt/itcms/toSpace - i32.eq - if - i32.const 0 - call $~lib/rt/itcms/visitStack - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $obj - loop $while-continue|2 - local.get $obj - global.get $~lib/rt/itcms/toSpace - i32.ne - local.set $var$2 - local.get $var$2 - if - local.get $obj - call $~lib/rt/itcms/Object#get:color - local.get $var$1 - i32.ne - if - local.get $obj - local.get $var$1 - call $~lib/rt/itcms/Object#set:color - local.get $obj - i32.const 20 - i32.add - i32.const 0 - call $~lib/rt/__visit_members - end - local.get $obj - call $~lib/rt/itcms/Object#get:next - local.set $obj - br $while-continue|2 - end - end - global.get $~lib/rt/itcms/fromSpace - local.set $var$2 - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/fromSpace - local.get $var$2 - global.set $~lib/rt/itcms/toSpace - local.get $var$1 - global.set $~lib/rt/itcms/white - local.get $var$2 - call $~lib/rt/itcms/Object#get:next - global.set $~lib/rt/itcms/iter - i32.const 2 - global.set $~lib/rt/itcms/state - end - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - global.get $~lib/rt/itcms/iter - local.set $obj - local.get $obj - global.get $~lib/rt/itcms/toSpace - i32.ne - if - local.get $obj - call $~lib/rt/itcms/Object#get:next - global.set $~lib/rt/itcms/iter - i32.const 1 - drop - local.get $obj - call $~lib/rt/itcms/Object#get:color - global.get $~lib/rt/itcms/white - i32.eqz - i32.eq - i32.eqz - if - i32.const 0 - i32.const 96 - i32.const 228 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - local.get $obj - call $~lib/rt/itcms/free - i32.const 10 - return - end - global.get $~lib/rt/itcms/toSpace - global.get $~lib/rt/itcms/toSpace - call $~lib/rt/itcms/Object#set:nextWithColor - global.get $~lib/rt/itcms/toSpace - global.get $~lib/rt/itcms/toSpace - call $~lib/rt/itcms/Object#set:prev - i32.const 0 - global.set $~lib/rt/itcms/state - br $break|0 - end - i32.const 0 - ) - (func $~lib/rt/itcms/interrupt - (local $budget i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1024 - i32.const 200 - i32.mul - i32.const 100 - i32.div_u - local.set $budget - loop $do-loop|0 - local.get $budget - call $~lib/rt/itcms/step - i32.sub - local.set $budget - global.get $~lib/rt/itcms/state - i32.const 0 - i32.eq - if - i32.const 0 - drop - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i32.const 200 - i64.extend_i32_u - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - i32.const 0 - drop - return - end - local.get $budget - i32.const 0 - i32.gt_s - br_if $do-loop|0 - end - i32.const 0 - drop - global.get $~lib/rt/itcms/total - i32.const 1024 - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.mul - i32.add - global.set $~lib/rt/itcms/threshold - i32.const 0 - drop - ) - (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 - ) - (func $~lib/rt/tlsf/prepareSize (param $size i32) (result i32) - local.get $size - i32.const 1073741820 - i32.gt_u - if - i32.const 32 - i32.const 368 - i32.const 458 - i32.const 29 - call $~lib/builtins/abort - unreachable - end - local.get $size - call $~lib/rt/tlsf/computeSize - ) - (func $~lib/rt/tlsf/searchBlock (param $root i32) (param $size i32) (result i32) - (local $fl i32) - (local $sl i32) - (local $var$4 i32) - (local $var$5 i32) - (local $slMap i32) - (local $head i32) - (local $var$8 i32) - (local $var$9 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 $var$4 - i32.const 31 - local.get $var$4 - i32.clz - i32.sub - local.set $fl - local.get $var$4 - 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 368 - i32.const 330 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $root - local.set $var$5 - local.get $fl - local.set $var$4 - local.get $var$5 - local.get $var$4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - 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 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $fl - i32.const 1 - i32.add - i32.shl - i32.and - local.set $var$5 - local.get $var$5 - i32.eqz - if - i32.const 0 - local.set $head - else - local.get $var$5 - i32.ctz - local.set $fl - local.get $root - local.set $var$8 - local.get $fl - local.set $var$4 - local.get $var$8 - local.get $var$4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $slMap - i32.const 1 - drop - local.get $slMap - i32.eqz - if - i32.const 0 - i32.const 368 - i32.const 343 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $root - local.set $var$9 - local.get $fl - local.set $var$8 - local.get $slMap - i32.ctz - local.set $var$4 - local.get $var$9 - local.get $var$8 - i32.const 4 - i32.shl - local.get $var$4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $head - end - else - local.get $root - local.set $var$9 - local.get $fl - local.set $var$8 - local.get $slMap - i32.ctz - local.set $var$4 - local.get $var$9 - local.get $var$8 - i32.const 4 - i32.shl - local.get $var$4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $head - end - local.get $head - ) - (func $~lib/rt/tlsf/growMemory (param $root i32) (param $size i32) - (local $pagesBefore i32) - (local $var$3 i32) - (local $pagesNeeded i32) - (local $var$5 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 - local.set $pagesBefore - local.get $size - i32.const 4 - local.get $pagesBefore - i32.const 16 - i32.shl - i32.const 4 - i32.sub - local.get $root - local.set $var$3 - local.get $var$3 - i32.load offset=1568 - 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 $var$3 - local.get $pagesNeeded - local.tee $var$5 - local.get $var$3 - local.get $var$5 - i32.gt_s - select - local.set $pagesWanted - local.get $pagesWanted - memory.grow - i32.const 0 - i32.lt_s - if - local.get $pagesNeeded - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - memory.size - 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 $var$5 i32) - local.get $block - i32.load - 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 368 - 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 $var$5 - local.get $var$5 - 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 $var$5 - 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 - local.get $block - local.set $var$5 - local.get $var$5 - i32.const 4 - i32.add - local.get $var$5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.get $block - local.set $var$5 - local.get $var$5 - i32.const 4 - i32.add - local.get $var$5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - i32.load - 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 368 - i32.const 496 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - end - i32.const 1 - drop - local.get $block - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $payloadSize - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 368 - 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 - ) - (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 - ) - (func $~lib/rt/itcms/Object#set:rtId (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=12 - ) - (func $~lib/rt/itcms/Object#set:rtSize (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=16 - ) - (func $~lib/rt/itcms/__new (param $size i32) (param $id i32) (result i32) - (local $obj i32) - (local $ptr i32) - local.get $size - i32.const 1073741804 - i32.ge_u - if - i32.const 32 - i32.const 96 - i32.const 260 - i32.const 31 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - call $~lib/rt/itcms/interrupt - end - i32.const 16 - local.get $size - i32.add - call $~lib/rt/tlsf/__alloc - i32.const 4 - i32.sub - local.set $obj - local.get $obj - local.get $id - call $~lib/rt/itcms/Object#set:rtId - local.get $obj - local.get $size - call $~lib/rt/itcms/Object#set:rtSize - local.get $obj - global.get $~lib/rt/itcms/fromSpace - global.get $~lib/rt/itcms/white - call $~lib/rt/itcms/Object#linkTo - global.get $~lib/rt/itcms/total - local.get $obj - call $~lib/rt/itcms/Object#get:size - i32.add - global.set $~lib/rt/itcms/total - local.get $obj - i32.const 20 - i32.add - local.set $ptr - local.get $ptr - i32.const 0 - local.get $size - memory.fill - local.get $ptr - ) - (func $std/operator-overloading/Tester#set:x (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $std/operator-overloading/Tester#set:y (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $std/operator-overloading/Tester.add (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.add - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.add - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.sub (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.sub - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.sub - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.mul (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.mul - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.mul - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.div (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.div_s - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.div_s - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.mod (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.rem_s - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.rem_s - call $std/operator-overloading/Tester#constructor - ) - (func $~lib/math/ipow32 (param $x i32) (param $e i32) (result i32) - (local $out i32) - (local $var$3 i32) - (local $var$4 i32) - i32.const 1 - local.set $out - i32.const 0 - i32.const 1 - i32.lt_s - drop - local.get $x - i32.const 2 - i32.eq - if - i32.const 1 - local.get $e - i32.shl - i32.const 0 - local.get $e - i32.const 32 - i32.lt_u - select - return - end - local.get $e - i32.const 0 - i32.le_s - if - local.get $x - i32.const -1 - i32.eq - if - i32.const -1 - i32.const 1 - local.get $e - i32.const 1 - i32.and - select - return - end - local.get $e - i32.const 0 - i32.eq - local.get $x - i32.const 1 - i32.eq - i32.or - return - else - local.get $e - i32.const 1 - i32.eq - if - local.get $x - return - else - local.get $e - i32.const 2 - i32.eq - if - local.get $x - local.get $x - i32.mul - return - else - local.get $e - i32.const 32 - i32.lt_s - if - i32.const 32 - local.get $e - i32.clz - i32.sub - local.set $var$3 - block $break|0 - block $case4|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - local.get $var$3 - local.set $var$4 - local.get $var$4 - i32.const 5 - i32.eq - br_if $case0|0 - local.get $var$4 - i32.const 4 - i32.eq - br_if $case1|0 - local.get $var$4 - i32.const 3 - i32.eq - br_if $case2|0 - local.get $var$4 - i32.const 2 - i32.eq - br_if $case3|0 - local.get $var$4 - i32.const 1 - i32.eq - br_if $case4|0 - br $break|0 - end - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - local.get $e - i32.const 1 - i32.shr_u - local.set $e - local.get $x - local.get $x - i32.mul - local.set $x - end - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - local.get $e - i32.const 1 - i32.shr_u - local.set $e - local.get $x - local.get $x - i32.mul - local.set $x - end - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - local.get $e - i32.const 1 - i32.shr_u - local.set $e - local.get $x - local.get $x - i32.mul - local.set $x - end - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - local.get $e - i32.const 1 - i32.shr_u - local.set $e - local.get $x - local.get $x - i32.mul - local.set $x - end - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - end - local.get $out - return - end - end - end - end - loop $while-continue|1 - local.get $e - local.set $var$3 - local.get $var$3 - if - local.get $e - i32.const 1 - i32.and - if - local.get $out - local.get $x - i32.mul - local.set $out - end - local.get $e - i32.const 1 - i32.shr_u - local.set $e - local.get $x - local.get $x - i32.mul - local.set $x - br $while-continue|1 - end - end - local.get $out - ) - (func $std/operator-overloading/Tester.pow (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - call $~lib/math/ipow32 - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - call $~lib/math/ipow32 - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.and (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.and - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.and - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.or (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.or - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.or - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.xor (param $a i32) (param $b i32) (result i32) - i32.const 0 - local.get $a - i32.load - local.get $b - i32.load - i32.xor - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.xor - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.equals (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.eq - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.eq - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.notEquals (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.ne - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.ne - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.greater (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.gt_s - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.gt_s - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.greaterEquals (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.ge_s - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.ge_s - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.less (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.lt_s - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.lt_s - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.lessEquals (param $a i32) (param $b i32) (result i32) - local.get $a - i32.load - local.get $b - i32.load - i32.le_s - if (result i32) - local.get $a - i32.load offset=4 - local.get $b - i32.load offset=4 - i32.le_s - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester.shr (param $value i32) (param $shift i32) (result i32) - i32.const 0 - local.get $value - i32.load - local.get $shift - i32.shr_s - local.get $value - i32.load offset=4 - local.get $shift - i32.shr_s - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.shu (param $value i32) (param $shift i32) (result i32) - i32.const 0 - local.get $value - i32.load - local.get $shift - i32.shr_u - local.get $value - i32.load offset=4 - local.get $shift - i32.shr_u - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.shl (param $value i32) (param $shift i32) (result i32) - i32.const 0 - local.get $value - i32.load - local.get $shift - i32.shl - local.get $value - i32.load offset=4 - local.get $shift - i32.shl - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.pos (param $value i32) (result i32) - i32.const 0 - local.get $value - i32.load - local.get $value - i32.load offset=4 - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.neg (param $value i32) (result i32) - i32.const 0 - i32.const 0 - local.get $value - i32.load - i32.sub - i32.const 0 - local.get $value - i32.load offset=4 - i32.sub - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.not (param $value i32) (result i32) - i32.const 0 - local.get $value - i32.load - i32.const -1 - i32.xor - local.get $value - i32.load offset=4 - i32.const -1 - i32.xor - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester.excl (param $value i32) (result i32) - local.get $value - i32.load - i32.eqz - if (result i32) - local.get $value - i32.load offset=4 - i32.eqz - else - i32.const 0 - end - ) - (func $std/operator-overloading/Tester#inc (param $this i32) (result i32) - local.get $this - local.get $this - i32.load - i32.const 1 - i32.add - call $std/operator-overloading/Tester#set:x - local.get $this - local.get $this - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/Tester#set:y - local.get $this - ) - (func $std/operator-overloading/Tester#dec (param $this i32) (result i32) - local.get $this - local.get $this - i32.load - i32.const 1 - i32.sub - call $std/operator-overloading/Tester#set:x - local.get $this - local.get $this - i32.load offset=4 - i32.const 1 - i32.sub - call $std/operator-overloading/Tester#set:y - local.get $this - ) - (func $std/operator-overloading/Tester#postInc (param $this i32) (result i32) - i32.const 0 - local.get $this - i32.load - i32.const 1 - i32.add - local.get $this - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/Tester#postDec (param $this i32) (result i32) - i32.const 0 - local.get $this - i32.load - i32.const 1 - i32.sub - local.get $this - i32.load offset=4 - i32.const 1 - i32.sub - call $std/operator-overloading/Tester#constructor - ) - (func $std/operator-overloading/TesterInlineStatic#set:x (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $std/operator-overloading/TesterInlineStatic#set:y (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $std/operator-overloading/TesterInlineInstance#set:x (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $std/operator-overloading/TesterInlineInstance#set:y (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $std/operator-overloading/TesterElementAccess#set:x (param $0 i32) (param $1 f32) - local.get $0 - local.get $1 - f32.store - ) - (func $std/operator-overloading/TesterElementAccess#set:y (param $0 i32) (param $1 f32) - local.get $0 - local.get $1 - f32.store offset=4 - ) - (func $~lib/string/String#get:length (param $this i32) (result i32) - local.get $this - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - ) - (func $~lib/util/string/compareImpl (param $str1 i32) (param $index1 i32) (param $str2 i32) (param $index2 i32) (param $len i32) (result i32) - (local $ptr1 i32) - (local $ptr2 i32) - (local $var$7 i32) - (local $a i32) - (local $b i32) - local.get $str1 - local.get $index1 - i32.const 1 - i32.shl - i32.add - local.set $ptr1 - local.get $str2 - local.get $index2 - i32.const 1 - i32.shl - i32.add - local.set $ptr2 - i32.const 0 - i32.const 2 - i32.lt_s - drop - local.get $len - i32.const 4 - i32.ge_u - if (result i32) - local.get $ptr1 - i32.const 7 - i32.and - local.get $ptr2 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end - if - block $do-break|0 - loop $do-loop|0 - local.get $ptr1 - i64.load - local.get $ptr2 - i64.load - i64.ne - if - br $do-break|0 - end - local.get $ptr1 - i32.const 8 - i32.add - local.set $ptr1 - local.get $ptr2 - i32.const 8 - i32.add - local.set $ptr2 - local.get $len - i32.const 4 - i32.sub - local.set $len - local.get $len - i32.const 4 - i32.ge_u - br_if $do-loop|0 - end - end - end - loop $while-continue|1 - local.get $len - local.tee $var$7 - i32.const 1 - i32.sub - local.set $len - local.get $var$7 - local.set $var$7 - local.get $var$7 - if - local.get $ptr1 - i32.load16_u - local.set $a - local.get $ptr2 - i32.load16_u - local.set $b - local.get $a - local.get $b - i32.ne - if - local.get $a - local.get $b - i32.sub - return - end - local.get $ptr1 - i32.const 2 - i32.add - local.set $ptr1 - local.get $ptr2 - i32.const 2 - i32.add - local.set $ptr2 - br $while-continue|1 - end - end - i32.const 0 - ) - (func $~lib/string/String.__eq (param $left i32) (param $right i32) (result i32) - (local $leftLength i32) - local.get $left - local.get $right - i32.eq - if - i32.const 1 - return - end - local.get $left - i32.const 0 - i32.eq - if (result i32) - i32.const 1 - else - local.get $right - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end - local.get $left - call $~lib/string/String#get:length - local.set $leftLength - local.get $leftLength - local.get $right - call $~lib/string/String#get:length - i32.ne - if - i32.const 0 - return - end - local.get $left - i32.const 0 - local.get $right - i32.const 0 - local.get $leftLength - call $~lib/util/string/compareImpl - i32.eqz - ) - (func $~lib/rt/__visit_globals (param $0 i32) - (local $1 i32) - global.get $std/operator-overloading/a1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/a2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/a - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/s1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/s2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/s - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/m1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/m2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/m - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/d1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/d2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/d - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/f1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/f2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/f - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/p1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/p2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/p - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/n1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/n2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/n - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/o1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/o2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/o - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/x1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/x2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/x - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/eq1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/eq2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/eq3 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/eq4 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/gt1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/gt2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/gte1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/gte2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/le1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/le2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/leq1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/leq2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/shr - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/sres - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/shu - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/ures - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/shl - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/pos - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/pres - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/neg - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/nres - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/not - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/res - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/excl - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/incdec - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/tmp - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/ais1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/ais2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/ais - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/aii1 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/aii2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/aii - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - global.get $std/operator-overloading/tea - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - i32.const 224 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 32 - local.get $0 - call $~lib/rt/itcms/__visit - ) - (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - end - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - block $invalid - block $std/operator-overloading/TesterElementAccess - block $std/operator-overloading/TesterInlineInstance - block $std/operator-overloading/TesterInlineStatic - block $std/operator-overloading/Tester - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $std/operator-overloading/TesterElementAccess $invalid - end - return - end - return - end - local.get $0 - local.get $1 - call $~lib/arraybuffer/ArrayBufferView~visit - return - end - return - end - return - end - return - end - return - end - unreachable - ) - (func $~start - call $start:std/operator-overloading - ) - (func $~stack_check - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__data_end - i32.lt_s - if - i32.const 17024 - i32.const 17072 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 f32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - i32.const 512 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/string/String.__eq - if - local.get $0 - local.get $2 - call $std/operator-overloading/TesterElementAccess#set:x - else - local.get $0 - local.get $2 - call $std/operator-overloading/TesterElementAccess#set:y - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result f32) - (local $2 i32) - (local $3 f32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - i32.const 512 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $~lib/string/String.__eq - if (result f32) - local.get $0 - f32.load - else - local.get $0 - f32.load offset=4 - end - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $start:std/operator-overloading - (local $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 16 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 - memory.size - i32.const 16 - i32.shl - global.get $~lib/memory/__heap_base - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 144 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/pinSpace - i32.const 176 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/toSpace - i32.const 320 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/fromSpace - i32.const 0 - i32.const 1 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/a1 - i32.const 0 - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/a2 - global.get $std/operator-overloading/a1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/a2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.add - global.set $std/operator-overloading/a - global.get $std/operator-overloading/a - i32.load - i32.const 3 - i32.eq - if (result i32) - global.get $std/operator-overloading/a - i32.load offset=4 - i32.const 5 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 145 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/s1 - i32.const 0 - i32.const 2 - i32.const -3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/s2 - global.get $std/operator-overloading/s1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/s2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.sub - global.set $std/operator-overloading/s - global.get $std/operator-overloading/s - i32.load - i32.const 0 - i32.eq - if (result i32) - global.get $std/operator-overloading/s - i32.load offset=4 - i32.const 6 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 151 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 2 - i32.const 5 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/m1 - i32.const 0 - i32.const 3 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/m2 - global.get $std/operator-overloading/m1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/m2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.mul - global.set $std/operator-overloading/m - global.get $std/operator-overloading/m - i32.load - i32.const 6 - i32.eq - if (result i32) - global.get $std/operator-overloading/m - i32.load offset=4 - i32.const 10 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 157 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 6 - i32.const 50 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/d1 - i32.const 0 - i32.const 3 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/d2 - global.get $std/operator-overloading/d1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/d2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.div - global.set $std/operator-overloading/d - global.get $std/operator-overloading/d - i32.load - i32.const 2 - i32.eq - if (result i32) - global.get $std/operator-overloading/d - i32.load offset=4 - i32.const 5 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 163 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 10 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/f1 - i32.const 0 - i32.const 6 - i32.const 10 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/f2 - global.get $std/operator-overloading/f1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/f2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.mod - global.set $std/operator-overloading/f - global.get $std/operator-overloading/f - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/f - i32.load offset=4 - i32.const 0 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 169 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 2 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/p1 - i32.const 0 - i32.const 4 - i32.const 5 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/p2 - global.get $std/operator-overloading/p1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/p2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.pow - global.set $std/operator-overloading/p - global.get $std/operator-overloading/p - i32.load - i32.const 16 - i32.eq - if (result i32) - global.get $std/operator-overloading/p - i32.load offset=4 - i32.const 243 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 175 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 255 - i32.const 15 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/n1 - i32.const 0 - i32.const 15 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/n2 - global.get $std/operator-overloading/n1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/n2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.and - global.set $std/operator-overloading/n - global.get $std/operator-overloading/n - i32.load - i32.const 15 - i32.eq - if (result i32) - global.get $std/operator-overloading/n - i32.load offset=4 - i32.const 15 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 181 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 3855 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/o1 - i32.const 0 - i32.const 61680 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/o2 - global.get $std/operator-overloading/o1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/o2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.or - global.set $std/operator-overloading/o - global.get $std/operator-overloading/o - i32.load - i32.const 65535 - i32.eq - if (result i32) - global.get $std/operator-overloading/o - i32.load offset=4 - i32.const 255 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 187 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 255 - i32.const 255 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/x1 - i32.const 0 - i32.const 65280 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/x2 - global.get $std/operator-overloading/x1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/x2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.xor - global.set $std/operator-overloading/x - global.get $std/operator-overloading/x - i32.load - i32.const 65535 - i32.eq - if (result i32) - global.get $std/operator-overloading/x - i32.load offset=4 - i32.const 255 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 193 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq1 - i32.const 0 - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq2 - global.get $std/operator-overloading/eq1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/eq2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.equals - global.set $std/operator-overloading/eq - global.get $std/operator-overloading/eq - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 199 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq3 - i32.const 0 - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/eq4 - global.get $std/operator-overloading/eq3 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/eq4 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.equals - global.set $std/operator-overloading/eqf - global.get $std/operator-overloading/eqf - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 205 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/eq1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/eq2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.notEquals - global.set $std/operator-overloading/eq - global.get $std/operator-overloading/eq - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 209 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/eq3 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/eq4 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.notEquals - global.set $std/operator-overloading/eqf - global.get $std/operator-overloading/eqf - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 213 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 2 - global.get $~lib/builtins/i32.MAX_VALUE - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gt1 - i32.const 0 - i32.const 1 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gt2 - global.get $std/operator-overloading/gt1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/gt2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.greater - global.set $std/operator-overloading/gt - global.get $std/operator-overloading/gt - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 219 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 2 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gte1 - i32.const 0 - i32.const 2 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/gte2 - global.get $std/operator-overloading/gte1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/gte2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.greaterEquals - global.set $std/operator-overloading/gte - global.get $std/operator-overloading/gte - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 225 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 5 - i32.const -1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/le1 - i32.const 0 - i32.const 6 - i32.const 6 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/le2 - global.get $std/operator-overloading/le1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/le2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.less - global.set $std/operator-overloading/le - global.get $std/operator-overloading/le - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 231 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 4 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/leq1 - i32.const 0 - i32.const 4 - i32.const 3 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/leq2 - global.get $std/operator-overloading/leq1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - global.get $std/operator-overloading/leq2 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/Tester.lessEquals - global.set $std/operator-overloading/leq - global.get $std/operator-overloading/leq - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 237 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 8 - i32.const 16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shr - global.get $std/operator-overloading/shr - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 3 - call $std/operator-overloading/Tester.shr - global.set $std/operator-overloading/sres - global.get $std/operator-overloading/sres - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/sres - i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 242 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const -8 - i32.const -16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shu - global.get $std/operator-overloading/shu - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 3 - call $std/operator-overloading/Tester.shu - global.set $std/operator-overloading/ures - global.get $std/operator-overloading/ures - i32.load - i32.const 536870911 - i32.eq - if (result i32) - global.get $std/operator-overloading/ures - i32.load offset=4 - i32.const 536870910 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 247 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const 2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/shl - global.get $std/operator-overloading/shl - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 3 - call $std/operator-overloading/Tester.shl - global.set $std/operator-overloading/sres - global.get $std/operator-overloading/sres - i32.load - i32.const 8 - i32.eq - if (result i32) - global.get $std/operator-overloading/sres - i32.load offset=4 - i32.const 16 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 252 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/pos - global.get $std/operator-overloading/pos - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester.pos - global.set $std/operator-overloading/pres - global.get $std/operator-overloading/pres - i32.load - global.get $std/operator-overloading/pos - i32.load - i32.eq - if (result i32) - global.get $std/operator-overloading/pres - i32.load offset=4 - global.get $std/operator-overloading/pos - i32.load offset=4 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 257 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const -1 - i32.const -2 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/neg - global.get $std/operator-overloading/neg - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester.neg - global.set $std/operator-overloading/nres - global.get $std/operator-overloading/nres - i32.load - i32.const 0 - global.get $std/operator-overloading/neg - i32.load - i32.sub - i32.eq - if (result i32) - global.get $std/operator-overloading/nres - i32.load offset=4 - i32.const 0 - global.get $std/operator-overloading/neg - i32.load offset=4 - i32.sub - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 262 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 255 - i32.const 16 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/not - global.get $std/operator-overloading/not - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester.not - global.set $std/operator-overloading/res - global.get $std/operator-overloading/res - i32.load - global.get $std/operator-overloading/not - i32.load - i32.const -1 - i32.xor - i32.eq - if (result i32) - global.get $std/operator-overloading/res - i32.load offset=4 - global.get $std/operator-overloading/not - i32.load offset=4 - i32.const -1 - i32.xor - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 267 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 0 - i32.const 0 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/excl - global.get $std/operator-overloading/excl - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester.excl - global.set $std/operator-overloading/bres - global.get $std/operator-overloading/bres - global.get $std/operator-overloading/excl - i32.load - i32.eqz - if (result i32) - global.get $std/operator-overloading/excl - i32.load offset=4 - i32.eqz - else - i32.const 0 - end - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 272 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/bres - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 273 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester#inc - global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/incdec - i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 279 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/incdec - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $std/operator-overloading/Tester#dec - global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - i32.load - i32.const 0 - i32.eq - if (result i32) - global.get $std/operator-overloading/incdec - i32.load offset=4 - i32.const 1 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 282 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store offset=8 - local.get $0 - call $std/operator-overloading/Tester#postInc - global.set $std/operator-overloading/incdec - local.get $0 - global.set $std/operator-overloading/tmp - global.get $std/operator-overloading/tmp - i32.load - i32.const 0 - i32.eq - if (result i32) - global.get $std/operator-overloading/tmp - i32.load offset=4 - i32.const 1 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 287 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/incdec - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/incdec - i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 288 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/incdec - local.tee $0 - i32.store offset=8 - local.get $0 - call $std/operator-overloading/Tester#postDec - global.set $std/operator-overloading/incdec - local.get $0 - global.set $std/operator-overloading/tmp - global.get $std/operator-overloading/tmp - i32.load - i32.const 1 - i32.eq - if (result i32) - global.get $std/operator-overloading/tmp - i32.load offset=4 - i32.const 2 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 291 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/incdec - i32.load - i32.const 0 - i32.eq - if (result i32) - global.get $std/operator-overloading/incdec - i32.load offset=4 - i32.const 1 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 292 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const 2 - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais1 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/ais1 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - local.tee $0 - i32.store offset=8 - i32.const 0 - local.get $0 - i32.load - i32.const 1 - i32.add - local.get $0 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais1 - i32.const 0 - i32.const 2 - i32.const 3 - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais2 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/ais1 - local.tee $1 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/ais2 - local.tee $0 - i32.store offset=8 - i32.const 0 - local.get $1 - i32.load - local.get $0 - i32.load - i32.add - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor - global.set $std/operator-overloading/ais - global.get $std/operator-overloading/ais - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/ais - i32.load offset=4 - i32.const 6 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 312 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - i32.const 2 - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii1 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii1 - local.tee $0 - i32.store offset=8 - i32.const 0 - local.get $0 - i32.load - i32.const 1 - i32.add - local.get $0 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii1 - i32.const 0 - i32.const 2 - i32.const 3 - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii2 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii1 - local.tee $0 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - global.get $std/operator-overloading/aii2 - local.tee $1 - i32.store offset=12 - i32.const 0 - local.get $0 - i32.load - local.get $1 - i32.load - i32.add - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor - global.set $std/operator-overloading/aii - global.get $std/operator-overloading/aii - i32.load - i32.const 4 - i32.eq - if (result i32) - global.get $std/operator-overloading/aii - i32.load offset=4 - i32.const 6 - i32.eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 332 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - f32.const 1 - f32.const 2 - call $std/operator-overloading/TesterElementAccess#constructor - global.set $std/operator-overloading/tea - global.get $std/operator-overloading/tea - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 512 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - f32.const -1 - call $std/operator-overloading/TesterElementAccess#__set - global.get $std/operator-overloading/tea - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 544 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - f32.const -2 - call $std/operator-overloading/TesterElementAccess#__set - global.get $std/operator-overloading/tea - f32.load - f32.const -1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 360 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/tea - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 512 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/TesterElementAccess#__get - f32.const -1 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 361 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/tea - f32.load offset=4 - f32.const -2 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 363 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/operator-overloading/tea - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - i32.const 544 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $std/operator-overloading/TesterElementAccess#__get - f32.const -2 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 432 - i32.const 364 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 16 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $std/operator-overloading/Tester#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.const 3 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.get $1 - call $std/operator-overloading/Tester#set:x - local.get $0 - local.get $2 - call $std/operator-overloading/Tester#set:y - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $std/operator-overloading/TesterInlineStatic#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.const 4 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.get $1 - call $std/operator-overloading/TesterInlineStatic#set:x - local.get $0 - local.get $2 - call $std/operator-overloading/TesterInlineStatic#set:y - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $std/operator-overloading/TesterInlineInstance#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.const 5 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.get $1 - call $std/operator-overloading/TesterInlineInstance#set:x - local.get $0 - local.get $2 - call $std/operator-overloading/TesterInlineInstance#set:y - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $std/operator-overloading/TesterElementAccess#constructor (param $0 i32) (param $1 f32) (param $2 f32) (result i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.const 6 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.get $1 - call $std/operator-overloading/TesterElementAccess#set:x - local.get $0 - local.get $2 - call $std/operator-overloading/TesterElementAccess#set:y - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) -) diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index 984ed98904..626faa4460 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -362,3 +362,9 @@ assert(tea["x"] == f32(-1.0)); assert(tea.y == f32(-2.0)); assert(tea["y"] == f32(-2.0)); + +tea["x"]++; +--tea["y"]; + +assert(tea["y"] == f32(-1.0)); +assert(tea["y"] == f32(-3.0)); From 659c99472bb86c26c546ee7add4128440149f1d4 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 08:27:31 +0300 Subject: [PATCH 05/13] wip --- tests/compiler/std/operator-overloading.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index 626faa4460..6e65f03e65 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -366,5 +366,5 @@ assert(tea["y"] == f32(-2.0)); tea["x"]++; --tea["y"]; -assert(tea["y"] == f32(-1.0)); +assert(tea["x"] == f32(-1.0)); assert(tea["y"] == f32(-3.0)); From 04d82c81ba56f2480dc8a66b9e5118a585a55547 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 12:59:43 +0300 Subject: [PATCH 06/13] better approach --- src/compiler.ts | 21 +- src/diagnosticMessages.json | 1 + .../std/operator-overloading.debug.wat | 5144 +++++++++++++++++ .../std/operator-overloading.release.wat | 151 +- tests/compiler/std/operator-overloading.ts | 24 +- 5 files changed, 5282 insertions(+), 59 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index bf0b0b5a0e..d68504ce34 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -4629,7 +4629,6 @@ export class Compiler extends DiagnosticEmitter { this.currentType, right, resolver.currentThisExpression, - Type.i32, resolver.currentElementExpression, contextualType != Type.void ); @@ -5478,7 +5477,6 @@ export class Compiler extends DiagnosticEmitter { if (!target) return this.module.unreachable(); var thisExpression = resolver.currentThisExpression; var elementExpression = resolver.currentElementExpression; - var elementType = Type.i32; // to compile just the value, we need to know the target's type var targetType: Type; @@ -5548,7 +5546,6 @@ export class Compiler extends DiagnosticEmitter { let parameterTypes = indexedSet.signature.parameterTypes; assert(parameterTypes.length == 2); // parser must guarantee this - elementType = parameterTypes[0]; // 1st parameter is the index targetType = parameterTypes[1]; // 2nd parameter is the element if (indexedSet.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(expression); @@ -5579,7 +5576,6 @@ export class Compiler extends DiagnosticEmitter { valueType, valueExpression, thisExpression, - elementType, elementExpression, contextualType != Type.void ); @@ -5597,8 +5593,6 @@ export class Compiler extends DiagnosticEmitter { valueExpression: Expression, /** `this` expression reference if a field or property set. */ thisExpression: Expression | null, - /** Index expression type. */ - indexType: Type, /** Index expression reference if an indexed set. */ indexExpression: Expression | null, /** Whether to tee the value. */ @@ -5744,7 +5738,17 @@ export class Compiler extends DiagnosticEmitter { thisType, Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); - let elementExpr = this.compileExpression(assert(indexExpression), indexType, Constraints.CONV_IMPLICIT); + let setterIndexType = setterInstance.signature.parameterTypes[0]; + let getterIndexType = getterInstance.signature.parameterTypes[0]; + if (!setterIndexType.equals(getterIndexType)) { + this.error( + DiagnosticCode.Index_signature_type_should_be_the_same_for_getter_and_setter_in_0_class, + valueExpression.range, classInstance.internalName + ); + this.currentType = tee ? getterInstance.signature.returnType : Type.void; + return module.unreachable(); + } + let elementExpr = this.compileExpression(assert(indexExpression), setterIndexType, Constraints.CONV_IMPLICIT); let elementType = this.currentType; if (tee) { let tempTarget = flow.getTempLocal(thisType); @@ -9173,7 +9177,6 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, - Type.i32, resolver.currentElementExpression, false ); @@ -9186,7 +9189,6 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, - Type.i32, resolver.currentElementExpression, false ); @@ -9552,7 +9554,6 @@ export class Compiler extends DiagnosticEmitter { this.currentType, expression.operand, resolver.currentThisExpression, - Type.i32, resolver.currentElementExpression, contextualType != Type.void ); diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 12265ea713..07fb14c68d 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -12,6 +12,7 @@ "Start function name '{0}' is invalid or conflicts with another export.": 110, "Element '{0}' not found.": 111, "Exchange of '{0}' values is not supported by all embeddings": 112, + "Index signature type should be the same for getter and setter in '{0}' class.": 113, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, diff --git a/tests/compiler/std/operator-overloading.debug.wat b/tests/compiler/std/operator-overloading.debug.wat index e69de29bb2..62d10d9de6 100644 --- a/tests/compiler/std/operator-overloading.debug.wat +++ b/tests/compiler/std/operator-overloading.debug.wat @@ -0,0 +1,5144 @@ +(module + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (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 $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 $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))) + (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) + (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) + (global $std/operator-overloading/a1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/a2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/a (mut i32) (i32.const 0)) + (global $std/operator-overloading/s1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/s2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/s (mut i32) (i32.const 0)) + (global $std/operator-overloading/m1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/m2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/m (mut i32) (i32.const 0)) + (global $std/operator-overloading/d1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/d2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/d (mut i32) (i32.const 0)) + (global $std/operator-overloading/f1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/f2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/f (mut i32) (i32.const 0)) + (global $std/operator-overloading/p1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/p2 (mut i32) (i32.const 0)) + (global $~lib/native/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $std/operator-overloading/p (mut i32) (i32.const 0)) + (global $std/operator-overloading/n1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/n2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/n (mut i32) (i32.const 0)) + (global $std/operator-overloading/o1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/o2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/o (mut i32) (i32.const 0)) + (global $std/operator-overloading/x1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/x2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/x (mut i32) (i32.const 0)) + (global $std/operator-overloading/eq1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/eq2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/eq (mut i32) (i32.const 0)) + (global $std/operator-overloading/eq3 (mut i32) (i32.const 0)) + (global $std/operator-overloading/eq4 (mut i32) (i32.const 0)) + (global $std/operator-overloading/eqf (mut i32) (i32.const 0)) + (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) + (global $std/operator-overloading/gt1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/gt2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/gt (mut i32) (i32.const 0)) + (global $std/operator-overloading/gte1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/gte2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/gte (mut i32) (i32.const 0)) + (global $std/operator-overloading/le1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/le2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/le (mut i32) (i32.const 0)) + (global $std/operator-overloading/leq1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/leq2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/leq (mut i32) (i32.const 0)) + (global $std/operator-overloading/shr (mut i32) (i32.const 0)) + (global $std/operator-overloading/sres (mut i32) (i32.const 0)) + (global $std/operator-overloading/shu (mut i32) (i32.const 0)) + (global $std/operator-overloading/ures (mut i32) (i32.const 0)) + (global $std/operator-overloading/shl (mut i32) (i32.const 0)) + (global $std/operator-overloading/pos (mut i32) (i32.const 0)) + (global $std/operator-overloading/pres (mut i32) (i32.const 0)) + (global $std/operator-overloading/neg (mut i32) (i32.const 0)) + (global $std/operator-overloading/nres (mut i32) (i32.const 0)) + (global $std/operator-overloading/not (mut i32) (i32.const 0)) + (global $std/operator-overloading/res (mut i32) (i32.const 0)) + (global $std/operator-overloading/excl (mut i32) (i32.const 0)) + (global $std/operator-overloading/bres (mut i32) (i32.const 0)) + (global $std/operator-overloading/incdec (mut i32) (i32.const 0)) + (global $std/operator-overloading/tmp (mut i32) (i32.const 0)) + (global $std/operator-overloading/ais1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/ais2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/ais (mut i32) (i32.const 0)) + (global $std/operator-overloading/aii1 (mut i32) (i32.const 0)) + (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) + (global $std/operator-overloading/aii (mut i32) (i32.const 0)) + (global $std/operator-overloading/tea (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 560)) + (global $~lib/memory/__data_end i32 (i32.const 620)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17004)) + (global $~lib/memory/__heap_base i32 (i32.const 17004)) + (memory $0 1) + (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 144) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 176) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 204) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") + (data (i32.const 268) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") + (data (i32.const 320) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 348) "<\00\00\00\00\00\00\00\00\00\00\00\01\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 412) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00\00\00\00\00\00\00") + (data (i32.const 492) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00x\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 524) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00y\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 560) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") + (table $0 1 1 funcref) + (elem $0 (i32.const 1)) + (export "memory" (memory $0)) + (start $~start) + (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/rt/itcms/Object#set:prev (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=8 + ) + (func $~lib/rt/itcms/initLazy (param $space i32) (result i32) + local.get $space + local.get $space + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $space + local.get $space + call $~lib/rt/itcms/Object#set:prev + local.get $space + ) + (func $~lib/rt/itcms/Object#get:next (param $this i32) (result i32) + local.get $this + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + ) + (func $~lib/rt/itcms/Object#get:color (param $this i32) (result i32) + local.get $this + i32.load offset=4 + i32.const 3 + i32.and + ) + (func $~lib/rt/itcms/visitRoots (param $cookie i32) + (local $pn i32) + (local $iter i32) + (local $var$3 i32) + local.get $cookie + call $~lib/rt/__visit_globals + global.get $~lib/rt/itcms/pinSpace + local.set $pn + local.get $pn + call $~lib/rt/itcms/Object#get:next + local.set $iter + loop $while-continue|0 + local.get $iter + local.get $pn + i32.ne + local.set $var$3 + local.get $var$3 + if + i32.const 1 + drop + local.get $iter + call $~lib/rt/itcms/Object#get:color + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 159 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $iter + i32.const 20 + i32.add + local.get $cookie + call $~lib/rt/__visit_members + local.get $iter + call $~lib/rt/itcms/Object#get:next + local.set $iter + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#set:color (param $this i32) (param $color i32) + local.get $this + local.get $this + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $color + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#set:next (param $this i32) (param $obj i32) + local.get $this + local.get $obj + local.get $this + i32.load offset=4 + i32.const 3 + i32.and + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#unlink (param $this i32) + (local $next i32) + (local $prev i32) + local.get $this + call $~lib/rt/itcms/Object#get:next + local.set $next + local.get $next + i32.const 0 + i32.eq + if + i32.const 1 + drop + local.get $this + i32.load offset=8 + i32.const 0 + i32.eq + if (result i32) + local.get $this + global.get $~lib/memory/__heap_base + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 127 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + return + end + local.get $this + i32.load offset=8 + local.set $prev + i32.const 1 + drop + local.get $prev + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 131 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $next + local.get $prev + call $~lib/rt/itcms/Object#set:prev + local.get $prev + local.get $next + call $~lib/rt/itcms/Object#set:next + ) + (func $~lib/rt/__typeinfo (param $id i32) (result i32) + (local $ptr i32) + global.get $~lib/rt/__rtti_base + local.set $ptr + local.get $id + local.get $ptr + i32.load + i32.gt_u + if + i32.const 224 + i32.const 288 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $ptr + i32.const 4 + i32.add + local.get $id + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/itcms/Object#get:isPointerfree (param $this i32) (result i32) + (local $rtId i32) + local.get $this + i32.load offset=12 + local.set $rtId + local.get $rtId + i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $rtId + call $~lib/rt/__typeinfo + i32.const 32 + i32.and + i32.const 0 + i32.ne + end + ) + (func $~lib/rt/itcms/Object#linkTo (param $this i32) (param $list i32) (param $withColor i32) + (local $prev i32) + local.get $list + i32.load offset=8 + local.set $prev + local.get $this + local.get $list + local.get $withColor + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $this + local.get $prev + call $~lib/rt/itcms/Object#set:prev + local.get $prev + local.get $this + call $~lib/rt/itcms/Object#set:next + local.get $list + local.get $this + call $~lib/rt/itcms/Object#set:prev + ) + (func $~lib/rt/itcms/Object#makeGray (param $this i32) + (local $var$1 i32) + local.get $this + global.get $~lib/rt/itcms/iter + i32.eq + if + local.get $this + i32.load offset=8 + local.tee $var$1 + i32.eqz + if (result i32) + i32.const 0 + i32.const 96 + i32.const 147 + i32.const 30 + call $~lib/builtins/abort + unreachable + else + local.get $var$1 + end + global.set $~lib/rt/itcms/iter + end + local.get $this + call $~lib/rt/itcms/Object#unlink + local.get $this + global.get $~lib/rt/itcms/toSpace + local.get $this + call $~lib/rt/itcms/Object#get:isPointerfree + if (result i32) + global.get $~lib/rt/itcms/white + i32.eqz + else + i32.const 2 + end + call $~lib/rt/itcms/Object#linkTo + ) + (func $~lib/rt/itcms/__visit (param $ptr i32) (param $cookie i32) + (local $obj i32) + local.get $ptr + i32.eqz + if + return + end + local.get $ptr + i32.const 20 + i32.sub + local.set $obj + i32.const 0 + drop + local.get $obj + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eq + if + local.get $obj + call $~lib/rt/itcms/Object#makeGray + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.add + global.set $~lib/rt/itcms/visitCount + end + ) + (func $~lib/rt/itcms/visitStack (param $cookie i32) + (local $ptr i32) + (local $var$2 i32) + global.get $~lib/memory/__stack_pointer + local.set $ptr + loop $while-continue|0 + local.get $ptr + global.get $~lib/memory/__heap_base + i32.lt_u + local.set $var$2 + local.get $var$2 + if + local.get $ptr + i32.load + local.get $cookie + call $~lib/rt/itcms/__visit + local.get $ptr + i32.const 4 + i32.add + local.set $ptr + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#get:size (param $this i32) (result i32) + i32.const 4 + local.get $this + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + ) + (func $~lib/rt/tlsf/Root#set:flMap (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $~lib/rt/common/BLOCK#set:mmInfo (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $~lib/rt/tlsf/Block#set:prev (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/rt/tlsf/Block#set:next (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=8 + ) + (func $~lib/rt/tlsf/removeBlock (param $root i32) (param $block i32) + (local $blockInfo i32) + (local $size i32) + (local $fl i32) + (local $sl i32) + (local $var$6 i32) + (local $var$7 i32) + (local $prev i32) + (local $next i32) + (local $var$10 i32) + (local $var$11 i32) + local.get $block + i32.load + local.set $blockInfo + i32.const 1 + drop + local.get $blockInfo + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 368 + 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 368 + 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 $var$6 + i32.const 1073741820 + local.tee $var$7 + local.get $var$6 + local.get $var$7 + i32.lt_u + select + local.set $var$6 + i32.const 31 + local.get $var$6 + i32.clz + i32.sub + local.set $fl + local.get $var$6 + 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 368 + i32.const 284 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $block + i32.load offset=4 + local.set $prev + local.get $block + i32.load offset=8 + 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 + local.get $root + local.set $var$10 + local.get $fl + local.set $var$6 + local.get $sl + local.set $var$7 + local.get $var$10 + local.get $var$6 + i32.const 4 + i32.shl + local.get $var$7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + i32.eq + if + local.get $root + local.set $var$11 + local.get $fl + local.set $var$10 + local.get $sl + local.set $var$6 + local.get $next + local.set $var$7 + local.get $var$11 + local.get $var$10 + i32.const 4 + i32.shl + local.get $var$6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $var$7 + i32.store offset=96 + local.get $next + i32.eqz + if + local.get $root + local.set $var$6 + local.get $fl + local.set $var$7 + local.get $var$6 + local.get $var$7 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $var$6 + local.get $root + local.set $var$7 + local.get $fl + local.set $var$11 + local.get $var$6 + i32.const 1 + local.get $sl + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $var$6 + local.set $var$10 + local.get $var$7 + local.get $var$11 + i32.const 2 + i32.shl + i32.add + local.get $var$10 + i32.store offset=4 + local.get $var$6 + i32.eqz + if + local.get $root + local.get $root + i32.load + 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 $var$3 i32) + (local $right i32) + (local $rightInfo i32) + (local $var$6 i32) + (local $size i32) + (local $fl i32) + (local $sl i32) + (local $var$10 i32) + (local $head i32) + (local $var$12 i32) + (local $var$13 i32) + i32.const 1 + drop + local.get $block + i32.eqz + if + i32.const 0 + i32.const 368 + i32.const 201 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $block + i32.load + local.set $blockInfo + i32.const 1 + drop + local.get $blockInfo + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 368 + i32.const 203 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $block + local.set $var$3 + local.get $var$3 + i32.const 4 + i32.add + local.get $var$3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $right + local.get $right + i32.load + 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 + local.get $block + local.set $var$3 + local.get $var$3 + i32.const 4 + i32.add + local.get $var$3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $right + local.get $right + i32.load + local.set $rightInfo + end + local.get $blockInfo + i32.const 2 + i32.and + if + local.get $block + local.set $var$3 + local.get $var$3 + i32.const 4 + i32.sub + i32.load + local.set $var$3 + local.get $var$3 + i32.load + local.set $var$6 + i32.const 1 + drop + local.get $var$6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 368 + i32.const 221 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.get $var$3 + call $~lib/rt/tlsf/removeBlock + local.get $var$3 + local.set $block + local.get $block + local.get $var$6 + 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 368 + 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 368 + 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 + 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 $var$3 + i32.const 1073741820 + local.tee $var$6 + local.get $var$3 + local.get $var$6 + i32.lt_u + select + local.set $var$3 + i32.const 31 + local.get $var$3 + i32.clz + i32.sub + local.set $fl + local.get $var$3 + 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 368 + i32.const 251 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.set $var$10 + local.get $fl + local.set $var$3 + local.get $sl + local.set $var$6 + local.get $var$10 + local.get $var$3 + i32.const 4 + i32.shl + local.get $var$6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + 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 $var$12 + local.get $fl + local.set $var$10 + local.get $sl + local.set $var$3 + local.get $block + local.set $var$6 + local.get $var$12 + local.get $var$10 + i32.const 4 + i32.shl + local.get $var$3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $var$6 + i32.store offset=96 + local.get $root + local.get $root + i32.load + i32.const 1 + local.get $fl + i32.shl + i32.or + call $~lib/rt/tlsf/Root#set:flMap + local.get $root + local.set $var$13 + local.get $fl + local.set $var$12 + local.get $root + local.set $var$3 + local.get $fl + local.set $var$6 + local.get $var$3 + local.get $var$6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const 1 + local.get $sl + i32.shl + i32.or + local.set $var$10 + local.get $var$13 + local.get $var$12 + i32.const 2 + i32.shl + i32.add + local.get $var$10 + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $root i32) (param $start i32) (param $end i32) (result i32) + (local $var$3 i32) + (local $tail i32) + (local $tailInfo i32) + (local $size i32) + (local $leftSize i32) + (local $left i32) + (local $var$9 i32) + i32.const 1 + drop + local.get $start + local.get $end + i32.le_u + i32.eqz + if + i32.const 0 + i32.const 368 + 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 + local.get $root + local.set $var$3 + local.get $var$3 + i32.load offset=1568 + 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 368 + 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 + i32.load + 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 368 + 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 $var$9 + local.get $tail + local.set $var$3 + local.get $var$9 + local.get $var$3 + i32.store offset=1568 + local.get $root + local.get $left + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initialize + (local $rootOffset i32) + (local $pagesBefore i32) + (local $pagesNeeded i32) + (local $root i32) + (local $var$4 i32) + (local $var$5 i32) + (local $var$6 i32) + (local $var$7 i32) + (local $var$8 i32) + (local $var$9 i32) + (local $var$10 i32) + (local $var$11 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 + 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 + 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 $var$5 + i32.const 0 + local.set $var$4 + local.get $var$5 + local.get $var$4 + i32.store offset=1568 + i32.const 0 + local.set $var$5 + loop $for-loop|0 + local.get $var$5 + i32.const 23 + i32.lt_u + local.set $var$4 + local.get $var$4 + if + local.get $root + local.set $var$8 + local.get $var$5 + local.set $var$7 + i32.const 0 + local.set $var$6 + local.get $var$8 + local.get $var$7 + i32.const 2 + i32.shl + i32.add + local.get $var$6 + i32.store offset=4 + i32.const 0 + local.set $var$8 + loop $for-loop|1 + local.get $var$8 + i32.const 16 + i32.lt_u + local.set $var$7 + local.get $var$7 + if + local.get $root + local.set $var$11 + local.get $var$5 + local.set $var$10 + local.get $var$8 + local.set $var$9 + i32.const 0 + local.set $var$6 + local.get $var$11 + local.get $var$10 + i32.const 4 + i32.shl + local.get $var$9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $var$6 + i32.store offset=96 + local.get $var$8 + i32.const 1 + i32.add + local.set $var$8 + br $for-loop|1 + end + end + local.get $var$5 + i32.const 1 + i32.add + local.set $var$5 + 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 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $root + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/checkUsedBlock (param $ptr i32) (result i32) + (local $block i32) + local.get $ptr + i32.const 4 + i32.sub + local.set $block + local.get $ptr + i32.const 0 + i32.ne + if (result i32) + local.get $ptr + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $block + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 368 + i32.const 559 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $block + ) + (func $~lib/rt/tlsf/freeBlock (param $root i32) (param $block i32) + i32.const 0 + drop + local.get $block + local.get $block + i32.load + i32.const 1 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $root + local.get $block + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/__free (param $ptr i32) + local.get $ptr + global.get $~lib/memory/__heap_base + i32.lt_u + if + return + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $ptr + call $~lib/rt/tlsf/checkUsedBlock + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/itcms/free (param $obj i32) + local.get $obj + global.get $~lib/memory/__heap_base + i32.lt_u + if + local.get $obj + i32.const 0 + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $obj + i32.const 0 + call $~lib/rt/itcms/Object#set:prev + else + global.get $~lib/rt/itcms/total + local.get $obj + call $~lib/rt/itcms/Object#get:size + i32.sub + global.set $~lib/rt/itcms/total + i32.const 0 + drop + local.get $obj + i32.const 4 + i32.add + call $~lib/rt/tlsf/__free + end + ) + (func $~lib/rt/itcms/step (result i32) + (local $obj i32) + (local $var$1 i32) + (local $var$2 i32) + block $break|0 + block $case2|0 + block $case1|0 + block $case0|0 + global.get $~lib/rt/itcms/state + local.set $var$1 + local.get $var$1 + i32.const 0 + i32.eq + br_if $case0|0 + local.get $var$1 + i32.const 1 + i32.eq + br_if $case1|0 + local.get $var$1 + i32.const 2 + i32.eq + br_if $case2|0 + br $break|0 + end + i32.const 1 + global.set $~lib/rt/itcms/state + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/white + i32.eqz + local.set $var$1 + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $obj + loop $while-continue|1 + local.get $obj + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $var$2 + local.get $var$2 + if + local.get $obj + global.set $~lib/rt/itcms/iter + local.get $obj + call $~lib/rt/itcms/Object#get:color + local.get $var$1 + i32.ne + if + local.get $obj + local.get $var$1 + call $~lib/rt/itcms/Object#set:color + i32.const 0 + global.set $~lib/rt/itcms/visitCount + local.get $obj + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + local.get $obj + call $~lib/rt/itcms/Object#get:next + local.set $obj + br $while-continue|1 + end + end + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $obj + local.get $obj + global.get $~lib/rt/itcms/toSpace + i32.eq + if + i32.const 0 + call $~lib/rt/itcms/visitStack + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $obj + loop $while-continue|2 + local.get $obj + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $var$2 + local.get $var$2 + if + local.get $obj + call $~lib/rt/itcms/Object#get:color + local.get $var$1 + i32.ne + if + local.get $obj + local.get $var$1 + call $~lib/rt/itcms/Object#set:color + local.get $obj + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + end + local.get $obj + call $~lib/rt/itcms/Object#get:next + local.set $obj + br $while-continue|2 + end + end + global.get $~lib/rt/itcms/fromSpace + local.set $var$2 + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/fromSpace + local.get $var$2 + global.set $~lib/rt/itcms/toSpace + local.get $var$1 + global.set $~lib/rt/itcms/white + local.get $var$2 + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 2 + global.set $~lib/rt/itcms/state + end + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/iter + local.set $obj + local.get $obj + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $obj + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 1 + drop + local.get $obj + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eqz + i32.eq + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 228 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $obj + call $~lib/rt/itcms/free + i32.const 10 + return + end + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:nextWithColor + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:prev + i32.const 0 + global.set $~lib/rt/itcms/state + br $break|0 + end + i32.const 0 + ) + (func $~lib/rt/itcms/interrupt + (local $budget i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1024 + i32.const 200 + i32.mul + i32.const 100 + i32.div_u + local.set $budget + loop $do-loop|0 + local.get $budget + call $~lib/rt/itcms/step + i32.sub + local.set $budget + global.get $~lib/rt/itcms/state + i32.const 0 + i32.eq + if + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i32.const 200 + i64.extend_i32_u + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + return + end + local.get $budget + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i32.const 1024 + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.mul + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + ) + (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 + ) + (func $~lib/rt/tlsf/prepareSize (param $size i32) (result i32) + local.get $size + i32.const 1073741820 + i32.gt_u + if + i32.const 32 + i32.const 368 + i32.const 458 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $size + call $~lib/rt/tlsf/computeSize + ) + (func $~lib/rt/tlsf/searchBlock (param $root i32) (param $size i32) (result i32) + (local $fl i32) + (local $sl i32) + (local $var$4 i32) + (local $var$5 i32) + (local $slMap i32) + (local $head i32) + (local $var$8 i32) + (local $var$9 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 $var$4 + i32.const 31 + local.get $var$4 + i32.clz + i32.sub + local.set $fl + local.get $var$4 + 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 368 + i32.const 330 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.set $var$5 + local.get $fl + local.set $var$4 + local.get $var$5 + local.get $var$4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + 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 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $fl + i32.const 1 + i32.add + i32.shl + i32.and + local.set $var$5 + local.get $var$5 + i32.eqz + if + i32.const 0 + local.set $head + else + local.get $var$5 + i32.ctz + local.set $fl + local.get $root + local.set $var$8 + local.get $fl + local.set $var$4 + local.get $var$8 + local.get $var$4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $slMap + i32.const 1 + drop + local.get $slMap + i32.eqz + if + i32.const 0 + i32.const 368 + i32.const 343 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $root + local.set $var$9 + local.get $fl + local.set $var$8 + local.get $slMap + i32.ctz + local.set $var$4 + local.get $var$9 + local.get $var$8 + i32.const 4 + i32.shl + local.get $var$4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $head + end + else + local.get $root + local.set $var$9 + local.get $fl + local.set $var$8 + local.get $slMap + i32.ctz + local.set $var$4 + local.get $var$9 + local.get $var$8 + i32.const 4 + i32.shl + local.get $var$4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $head + end + local.get $head + ) + (func $~lib/rt/tlsf/growMemory (param $root i32) (param $size i32) + (local $pagesBefore i32) + (local $var$3 i32) + (local $pagesNeeded i32) + (local $var$5 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 + local.set $pagesBefore + local.get $size + i32.const 4 + local.get $pagesBefore + i32.const 16 + i32.shl + i32.const 4 + i32.sub + local.get $root + local.set $var$3 + local.get $var$3 + i32.load offset=1568 + 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 $var$3 + local.get $pagesNeeded + local.tee $var$5 + local.get $var$3 + local.get $var$5 + i32.gt_s + select + local.set $pagesWanted + local.get $pagesWanted + memory.grow + i32.const 0 + i32.lt_s + if + local.get $pagesNeeded + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + 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 $var$5 i32) + local.get $block + i32.load + 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 368 + 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 $var$5 + local.get $var$5 + 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 $var$5 + 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 + local.get $block + local.set $var$5 + local.get $var$5 + i32.const 4 + i32.add + local.get $var$5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.get $block + local.set $var$5 + local.get $var$5 + i32.const 4 + i32.add + local.get $var$5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + i32.load + 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 368 + i32.const 496 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + end + i32.const 1 + drop + local.get $block + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $payloadSize + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 368 + 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 + ) + (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 + ) + (func $~lib/rt/itcms/Object#set:rtId (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=12 + ) + (func $~lib/rt/itcms/Object#set:rtSize (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=16 + ) + (func $~lib/rt/itcms/__new (param $size i32) (param $id i32) (result i32) + (local $obj i32) + (local $ptr i32) + local.get $size + i32.const 1073741804 + i32.ge_u + if + i32.const 32 + i32.const 96 + i32.const 260 + i32.const 31 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + call $~lib/rt/itcms/interrupt + end + i32.const 16 + local.get $size + i32.add + call $~lib/rt/tlsf/__alloc + i32.const 4 + i32.sub + local.set $obj + local.get $obj + local.get $id + call $~lib/rt/itcms/Object#set:rtId + local.get $obj + local.get $size + call $~lib/rt/itcms/Object#set:rtSize + local.get $obj + global.get $~lib/rt/itcms/fromSpace + global.get $~lib/rt/itcms/white + call $~lib/rt/itcms/Object#linkTo + global.get $~lib/rt/itcms/total + local.get $obj + call $~lib/rt/itcms/Object#get:size + i32.add + global.set $~lib/rt/itcms/total + local.get $obj + i32.const 20 + i32.add + local.set $ptr + local.get $ptr + i32.const 0 + local.get $size + memory.fill + local.get $ptr + ) + (func $std/operator-overloading/Tester#set:x (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $std/operator-overloading/Tester#set:y (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $std/operator-overloading/Tester.add (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.add + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.add + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.sub (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.sub + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.sub + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.mul (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.mul + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.mul + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.div (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.div_s + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.div_s + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.mod (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.rem_s + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.rem_s + call $std/operator-overloading/Tester#constructor + ) + (func $~lib/math/ipow32 (param $x i32) (param $e i32) (result i32) + (local $out i32) + (local $var$3 i32) + (local $var$4 i32) + i32.const 1 + local.set $out + i32.const 0 + i32.const 1 + i32.lt_s + drop + local.get $x + i32.const 2 + i32.eq + if + i32.const 1 + local.get $e + i32.shl + i32.const 0 + local.get $e + i32.const 32 + i32.lt_u + select + return + end + local.get $e + i32.const 0 + i32.le_s + if + local.get $x + i32.const -1 + i32.eq + if + i32.const -1 + i32.const 1 + local.get $e + i32.const 1 + i32.and + select + return + end + local.get $e + i32.const 0 + i32.eq + local.get $x + i32.const 1 + i32.eq + i32.or + return + else + local.get $e + i32.const 1 + i32.eq + if + local.get $x + return + else + local.get $e + i32.const 2 + i32.eq + if + local.get $x + local.get $x + i32.mul + return + else + local.get $e + i32.const 32 + i32.lt_s + if + i32.const 32 + local.get $e + i32.clz + i32.sub + local.set $var$3 + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $var$3 + local.set $var$4 + local.get $var$4 + i32.const 5 + i32.eq + br_if $case0|0 + local.get $var$4 + i32.const 4 + i32.eq + br_if $case1|0 + local.get $var$4 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $var$4 + i32.const 2 + i32.eq + br_if $case3|0 + local.get $var$4 + i32.const 1 + i32.eq + br_if $case4|0 + br $break|0 + end + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + local.get $e + i32.const 1 + i32.shr_u + local.set $e + local.get $x + local.get $x + i32.mul + local.set $x + end + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + local.get $e + i32.const 1 + i32.shr_u + local.set $e + local.get $x + local.get $x + i32.mul + local.set $x + end + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + local.get $e + i32.const 1 + i32.shr_u + local.set $e + local.get $x + local.get $x + i32.mul + local.set $x + end + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + local.get $e + i32.const 1 + i32.shr_u + local.set $e + local.get $x + local.get $x + i32.mul + local.set $x + end + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + end + local.get $out + return + end + end + end + end + loop $while-continue|1 + local.get $e + local.set $var$3 + local.get $var$3 + if + local.get $e + i32.const 1 + i32.and + if + local.get $out + local.get $x + i32.mul + local.set $out + end + local.get $e + i32.const 1 + i32.shr_u + local.set $e + local.get $x + local.get $x + i32.mul + local.set $x + br $while-continue|1 + end + end + local.get $out + ) + (func $std/operator-overloading/Tester.pow (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + call $~lib/math/ipow32 + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + call $~lib/math/ipow32 + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.and (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.and + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.and + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.or (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.or + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.or + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.xor (param $a i32) (param $b i32) (result i32) + i32.const 0 + local.get $a + i32.load + local.get $b + i32.load + i32.xor + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.xor + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.equals (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.eq + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.eq + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.notEquals (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.ne + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.ne + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.greater (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.gt_s + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.gt_s + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.greaterEquals (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.ge_s + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.ge_s + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.less (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.lt_s + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.lt_s + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.lessEquals (param $a i32) (param $b i32) (result i32) + local.get $a + i32.load + local.get $b + i32.load + i32.le_s + if (result i32) + local.get $a + i32.load offset=4 + local.get $b + i32.load offset=4 + i32.le_s + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.shr (param $value i32) (param $shift i32) (result i32) + i32.const 0 + local.get $value + i32.load + local.get $shift + i32.shr_s + local.get $value + i32.load offset=4 + local.get $shift + i32.shr_s + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.shu (param $value i32) (param $shift i32) (result i32) + i32.const 0 + local.get $value + i32.load + local.get $shift + i32.shr_u + local.get $value + i32.load offset=4 + local.get $shift + i32.shr_u + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.shl (param $value i32) (param $shift i32) (result i32) + i32.const 0 + local.get $value + i32.load + local.get $shift + i32.shl + local.get $value + i32.load offset=4 + local.get $shift + i32.shl + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.pos (param $value i32) (result i32) + i32.const 0 + local.get $value + i32.load + local.get $value + i32.load offset=4 + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.neg (param $value i32) (result i32) + i32.const 0 + i32.const 0 + local.get $value + i32.load + i32.sub + i32.const 0 + local.get $value + i32.load offset=4 + i32.sub + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.not (param $value i32) (result i32) + i32.const 0 + local.get $value + i32.load + i32.const -1 + i32.xor + local.get $value + i32.load offset=4 + i32.const -1 + i32.xor + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.excl (param $value i32) (result i32) + local.get $value + i32.load + i32.eqz + if (result i32) + local.get $value + i32.load offset=4 + i32.eqz + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester#inc (param $this i32) (result i32) + local.get $this + local.get $this + i32.load + i32.const 1 + i32.add + call $std/operator-overloading/Tester#set:x + local.get $this + local.get $this + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/Tester#set:y + local.get $this + ) + (func $std/operator-overloading/Tester#dec (param $this i32) (result i32) + local.get $this + local.get $this + i32.load + i32.const 1 + i32.sub + call $std/operator-overloading/Tester#set:x + local.get $this + local.get $this + i32.load offset=4 + i32.const 1 + i32.sub + call $std/operator-overloading/Tester#set:y + local.get $this + ) + (func $std/operator-overloading/Tester#postInc (param $this i32) (result i32) + i32.const 0 + local.get $this + i32.load + i32.const 1 + i32.add + local.get $this + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester#postDec (param $this i32) (result i32) + i32.const 0 + local.get $this + i32.load + i32.const 1 + i32.sub + local.get $this + i32.load offset=4 + i32.const 1 + i32.sub + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/TesterInlineStatic#set:x (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $std/operator-overloading/TesterInlineStatic#set:y (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $std/operator-overloading/TesterInlineInstance#set:x (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $std/operator-overloading/TesterInlineInstance#set:y (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $std/operator-overloading/TesterElementAccess#set:x (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $std/operator-overloading/TesterElementAccess#set:y (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/string/String#get:length (param $this i32) (result i32) + local.get $this + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (param $str1 i32) (param $index1 i32) (param $str2 i32) (param $index2 i32) (param $len i32) (result i32) + (local $ptr1 i32) + (local $ptr2 i32) + (local $var$7 i32) + (local $a i32) + (local $b i32) + local.get $str1 + local.get $index1 + i32.const 1 + i32.shl + i32.add + local.set $ptr1 + local.get $str2 + local.get $index2 + i32.const 1 + i32.shl + i32.add + local.set $ptr2 + i32.const 0 + i32.const 2 + i32.lt_s + drop + local.get $len + i32.const 4 + i32.ge_u + if (result i32) + local.get $ptr1 + i32.const 7 + i32.and + local.get $ptr2 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end + if + block $do-break|0 + loop $do-loop|0 + local.get $ptr1 + i64.load + local.get $ptr2 + i64.load + i64.ne + if + br $do-break|0 + end + local.get $ptr1 + i32.const 8 + i32.add + local.set $ptr1 + local.get $ptr2 + i32.const 8 + i32.add + local.set $ptr2 + local.get $len + i32.const 4 + i32.sub + local.set $len + local.get $len + i32.const 4 + i32.ge_u + br_if $do-loop|0 + end + end + end + loop $while-continue|1 + local.get $len + local.tee $var$7 + i32.const 1 + i32.sub + local.set $len + local.get $var$7 + local.set $var$7 + local.get $var$7 + if + local.get $ptr1 + i32.load16_u + local.set $a + local.get $ptr2 + i32.load16_u + local.set $b + local.get $a + local.get $b + i32.ne + if + local.get $a + local.get $b + i32.sub + return + end + local.get $ptr1 + i32.const 2 + i32.add + local.set $ptr1 + local.get $ptr2 + i32.const 2 + i32.add + local.set $ptr2 + br $while-continue|1 + end + end + i32.const 0 + ) + (func $~lib/string/String.__eq (param $left i32) (param $right i32) (result i32) + (local $leftLength i32) + local.get $left + local.get $right + i32.eq + if + i32.const 1 + return + end + local.get $left + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $right + i32.const 0 + i32.eq + end + if + i32.const 0 + return + end + local.get $left + call $~lib/string/String#get:length + local.set $leftLength + local.get $leftLength + local.get $right + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + return + end + local.get $left + i32.const 0 + local.get $right + i32.const 0 + local.get $leftLength + call $~lib/util/string/compareImpl + i32.eqz + ) + (func $~lib/rt/__visit_globals (param $0 i32) + (local $1 i32) + global.get $std/operator-overloading/a1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/a2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/a + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/s1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/s2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/s + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/m1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/m2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/m + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/d1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/d2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/d + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/f1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/f2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/f + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/p1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/p2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/p + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/n1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/n2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/n + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/o1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/o2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/o + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/x1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/x2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/x + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/eq1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/eq2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/eq3 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/eq4 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/gt1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/gt2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/gte1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/gte2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/le1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/le2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/leq1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/leq2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/shr + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/sres + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/shu + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/ures + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/shl + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/pos + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/pres + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/neg + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/nres + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/not + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/res + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/excl + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/incdec + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/tmp + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/ais1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/ais2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/ais + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/aii1 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/aii2 + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/aii + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + global.get $std/operator-overloading/tea + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + i32.const 224 + local.get $0 + call $~lib/rt/itcms/__visit + i32.const 32 + local.get $0 + call $~lib/rt/itcms/__visit + ) + (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/itcms/__visit + end + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + block $invalid + block $std/operator-overloading/TesterElementAccess + block $std/operator-overloading/TesterInlineInstance + block $std/operator-overloading/TesterInlineStatic + block $std/operator-overloading/Tester + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $std/operator-overloading/Tester $std/operator-overloading/TesterInlineStatic $std/operator-overloading/TesterInlineInstance $std/operator-overloading/TesterElementAccess $invalid + end + return + end + return + end + local.get $0 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView~visit + return + end + return + end + return + end + return + end + return + end + unreachable + ) + (func $~start + call $start:std/operator-overloading + ) + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s + if + i32.const 17024 + i32.const 17072 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + i32.const 512 + local.set $3 + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + call $~lib/string/String.__eq + if + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:x + else + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:y + end + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $~lib/string/String.__eq + if (result i32) + local.get $0 + i32.load + else + local.get $0 + i32.load offset=4 + end + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $2 + ) + (func $start:std/operator-overloading + (local $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.const 24 + memory.fill + memory.size + i32.const 16 + i32.shl + global.get $~lib/memory/__heap_base + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 144 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/pinSpace + i32.const 176 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/toSpace + i32.const 320 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/fromSpace + i32.const 0 + i32.const 1 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/a1 + i32.const 0 + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/a2 + global.get $std/operator-overloading/a1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/a2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.add + global.set $std/operator-overloading/a + global.get $std/operator-overloading/a + i32.load + i32.const 3 + i32.eq + if (result i32) + global.get $std/operator-overloading/a + i32.load offset=4 + i32.const 5 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 145 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/s1 + i32.const 0 + i32.const 2 + i32.const -3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/s2 + global.get $std/operator-overloading/s1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/s2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.sub + global.set $std/operator-overloading/s + global.get $std/operator-overloading/s + i32.load + i32.const 0 + i32.eq + if (result i32) + global.get $std/operator-overloading/s + i32.load offset=4 + i32.const 6 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 151 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 5 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/m1 + i32.const 0 + i32.const 3 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/m2 + global.get $std/operator-overloading/m1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/m2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.mul + global.set $std/operator-overloading/m + global.get $std/operator-overloading/m + i32.load + i32.const 6 + i32.eq + if (result i32) + global.get $std/operator-overloading/m + i32.load offset=4 + i32.const 10 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 157 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 6 + i32.const 50 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/d1 + i32.const 0 + i32.const 3 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/d2 + global.get $std/operator-overloading/d1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/d2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.div + global.set $std/operator-overloading/d + global.get $std/operator-overloading/d + i32.load + i32.const 2 + i32.eq + if (result i32) + global.get $std/operator-overloading/d + i32.load offset=4 + i32.const 5 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 163 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 10 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/f1 + i32.const 0 + i32.const 6 + i32.const 10 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/f2 + global.get $std/operator-overloading/f1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/f2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.mod + global.set $std/operator-overloading/f + global.get $std/operator-overloading/f + i32.load + i32.const 4 + i32.eq + if (result i32) + global.get $std/operator-overloading/f + i32.load offset=4 + i32.const 0 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 169 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/p1 + i32.const 0 + i32.const 4 + i32.const 5 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/p2 + global.get $std/operator-overloading/p1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/p2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.pow + global.set $std/operator-overloading/p + global.get $std/operator-overloading/p + i32.load + i32.const 16 + i32.eq + if (result i32) + global.get $std/operator-overloading/p + i32.load offset=4 + i32.const 243 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 175 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 255 + i32.const 15 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/n1 + i32.const 0 + i32.const 15 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/n2 + global.get $std/operator-overloading/n1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/n2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.and + global.set $std/operator-overloading/n + global.get $std/operator-overloading/n + i32.load + i32.const 15 + i32.eq + if (result i32) + global.get $std/operator-overloading/n + i32.load offset=4 + i32.const 15 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 181 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 3855 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/o1 + i32.const 0 + i32.const 61680 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/o2 + global.get $std/operator-overloading/o1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/o2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.or + global.set $std/operator-overloading/o + global.get $std/operator-overloading/o + i32.load + i32.const 65535 + i32.eq + if (result i32) + global.get $std/operator-overloading/o + i32.load offset=4 + i32.const 255 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 187 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 255 + i32.const 255 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/x1 + i32.const 0 + i32.const 65280 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/x2 + global.get $std/operator-overloading/x1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/x2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.xor + global.set $std/operator-overloading/x + global.get $std/operator-overloading/x + i32.load + i32.const 65535 + i32.eq + if (result i32) + global.get $std/operator-overloading/x + i32.load offset=4 + i32.const 255 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 193 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq1 + i32.const 0 + i32.const 1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq2 + global.get $std/operator-overloading/eq1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/eq2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.equals + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 199 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq3 + i32.const 0 + i32.const 0 + i32.const 1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/eq4 + global.get $std/operator-overloading/eq3 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/eq4 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.equals + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 205 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/eq1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/eq2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.notEquals + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 209 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/eq3 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/eq4 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.notEquals + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 213 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gt1 + i32.const 0 + i32.const 1 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gt2 + global.get $std/operator-overloading/gt1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/gt2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.greater + global.set $std/operator-overloading/gt + global.get $std/operator-overloading/gt + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 219 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gte1 + i32.const 0 + i32.const 2 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/gte2 + global.get $std/operator-overloading/gte1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/gte2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.greaterEquals + global.set $std/operator-overloading/gte + global.get $std/operator-overloading/gte + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 225 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 5 + i32.const -1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/le1 + i32.const 0 + i32.const 6 + i32.const 6 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/le2 + global.get $std/operator-overloading/le1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/le2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.less + global.set $std/operator-overloading/le + global.get $std/operator-overloading/le + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 231 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 4 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/leq1 + i32.const 0 + i32.const 4 + i32.const 3 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/leq2 + global.get $std/operator-overloading/leq1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + global.get $std/operator-overloading/leq2 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/Tester.lessEquals + global.set $std/operator-overloading/leq + global.get $std/operator-overloading/leq + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 237 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 8 + i32.const 16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shr + global.get $std/operator-overloading/shr + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 3 + call $std/operator-overloading/Tester.shr + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres + i32.load + i32.const 1 + i32.eq + if (result i32) + global.get $std/operator-overloading/sres + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 242 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const -8 + i32.const -16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shu + global.get $std/operator-overloading/shu + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 3 + call $std/operator-overloading/Tester.shu + global.set $std/operator-overloading/ures + global.get $std/operator-overloading/ures + i32.load + i32.const 536870911 + i32.eq + if (result i32) + global.get $std/operator-overloading/ures + i32.load offset=4 + i32.const 536870910 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 247 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const 2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/shl + global.get $std/operator-overloading/shl + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 3 + call $std/operator-overloading/Tester.shl + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres + i32.load + i32.const 8 + i32.eq + if (result i32) + global.get $std/operator-overloading/sres + i32.load offset=4 + i32.const 16 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 252 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/pos + global.get $std/operator-overloading/pos + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester.pos + global.set $std/operator-overloading/pres + global.get $std/operator-overloading/pres + i32.load + global.get $std/operator-overloading/pos + i32.load + i32.eq + if (result i32) + global.get $std/operator-overloading/pres + i32.load offset=4 + global.get $std/operator-overloading/pos + i32.load offset=4 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 257 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const -1 + i32.const -2 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/neg + global.get $std/operator-overloading/neg + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester.neg + global.set $std/operator-overloading/nres + global.get $std/operator-overloading/nres + i32.load + i32.const 0 + global.get $std/operator-overloading/neg + i32.load + i32.sub + i32.eq + if (result i32) + global.get $std/operator-overloading/nres + i32.load offset=4 + i32.const 0 + global.get $std/operator-overloading/neg + i32.load offset=4 + i32.sub + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 262 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 255 + i32.const 16 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/not + global.get $std/operator-overloading/not + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester.not + global.set $std/operator-overloading/res + global.get $std/operator-overloading/res + i32.load + global.get $std/operator-overloading/not + i32.load + i32.const -1 + i32.xor + i32.eq + if (result i32) + global.get $std/operator-overloading/res + i32.load offset=4 + global.get $std/operator-overloading/not + i32.load offset=4 + i32.const -1 + i32.xor + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 267 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.const 0 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/excl + global.get $std/operator-overloading/excl + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester.excl + global.set $std/operator-overloading/bres + global.get $std/operator-overloading/bres + global.get $std/operator-overloading/excl + i32.load + i32.eqz + if (result i32) + global.get $std/operator-overloading/excl + i32.load offset=4 + i32.eqz + else + i32.const 0 + end + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 272 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/bres + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 273 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.const 1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester#inc + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + i32.load + i32.const 1 + i32.eq + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 279 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/incdec + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $std/operator-overloading/Tester#dec + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + i32.load + i32.const 0 + i32.eq + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 1 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 282 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.const 1 + call $std/operator-overloading/Tester#constructor + global.set $std/operator-overloading/incdec + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/incdec + local.tee $0 + i32.store offset=8 + local.get $0 + call $std/operator-overloading/Tester#postInc + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp + i32.load + i32.const 0 + i32.eq + if (result i32) + global.get $std/operator-overloading/tmp + i32.load offset=4 + i32.const 1 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 287 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/incdec + i32.load + i32.const 1 + i32.eq + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 288 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/incdec + local.tee $0 + i32.store offset=8 + local.get $0 + call $std/operator-overloading/Tester#postDec + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp + i32.load + i32.const 1 + i32.eq + if (result i32) + global.get $std/operator-overloading/tmp + i32.load offset=4 + i32.const 2 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 291 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/incdec + i32.load + i32.const 0 + i32.eq + if (result i32) + global.get $std/operator-overloading/incdec + i32.load offset=4 + i32.const 1 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 292 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const 2 + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais1 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/ais1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.tee $0 + i32.store offset=8 + i32.const 0 + local.get $0 + i32.load + i32.const 1 + i32.add + local.get $0 + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais1 + i32.const 0 + i32.const 2 + i32.const 3 + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais2 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/ais1 + local.tee $1 + i32.store offset=12 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/ais2 + local.tee $0 + i32.store offset=8 + i32.const 0 + local.get $1 + i32.load + local.get $0 + i32.load + i32.add + local.get $1 + i32.load offset=4 + local.get $0 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + global.set $std/operator-overloading/ais + global.get $std/operator-overloading/ais + i32.load + i32.const 4 + i32.eq + if (result i32) + global.get $std/operator-overloading/ais + i32.load offset=4 + i32.const 6 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 312 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const 2 + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii1 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii1 + local.tee $0 + i32.store offset=8 + i32.const 0 + local.get $0 + i32.load + i32.const 1 + i32.add + local.get $0 + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii1 + i32.const 0 + i32.const 2 + i32.const 3 + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii2 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii1 + local.tee $0 + i32.store offset=8 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/aii2 + local.tee $1 + i32.store offset=12 + i32.const 0 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + global.set $std/operator-overloading/aii + global.get $std/operator-overloading/aii + i32.load + i32.const 4 + i32.eq + if (result i32) + global.get $std/operator-overloading/aii + i32.load offset=4 + i32.const 6 + i32.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 332 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + i32.const 2 + call $std/operator-overloading/TesterElementAccess#constructor + global.set $std/operator-overloading/tea + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + i32.const -1 + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + i32.const -2 + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + i32.load + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 360 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 361 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + i32.load offset=4 + i32.const -2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 363 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const -2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 364 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=16 + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=20 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const 1 + i32.add + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=16 + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=20 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const 1 + i32.sub + call $std/operator-overloading/TesterElementAccess#__set + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 512 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 369 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $std/operator-overloading/tea + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + i32.const 544 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + call $std/operator-overloading/TesterElementAccess#__get + i32.const -3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 432 + i32.const 370 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $std/operator-overloading/Tester#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.const 3 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.get $1 + call $std/operator-overloading/Tester#set:x + local.get $0 + local.get $2 + call $std/operator-overloading/Tester#set:y + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) + (func $std/operator-overloading/TesterInlineStatic#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.const 4 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.get $1 + call $std/operator-overloading/TesterInlineStatic#set:x + local.get $0 + local.get $2 + call $std/operator-overloading/TesterInlineStatic#set:y + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) + (func $std/operator-overloading/TesterInlineInstance#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.const 5 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.get $1 + call $std/operator-overloading/TesterInlineInstance#set:x + local.get $0 + local.get $2 + call $std/operator-overloading/TesterInlineInstance#set:y + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) + (func $std/operator-overloading/TesterElementAccess#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.const 6 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.get $1 + call $std/operator-overloading/TesterElementAccess#set:x + local.get $0 + local.get $2 + call $std/operator-overloading/TesterElementAccess#set:y + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $3 + ) +) diff --git a/tests/compiler/std/operator-overloading.release.wat b/tests/compiler/std/operator-overloading.release.wat index 055cab5f8a..4b98fd3339 100644 --- a/tests/compiler/std/operator-overloading.release.wat +++ b/tests/compiler/std/operator-overloading.release.wat @@ -3,12 +3,10 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result 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_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (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)) @@ -2001,7 +1999,7 @@ (func $~start call $start:std/operator-overloading ) - (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 f32) + (func $std/operator-overloading/TesterElementAccess#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 @@ -2030,20 +2028,19 @@ if local.get $0 local.get $2 - f32.store + i32.store else local.get $0 local.get $2 - f32.store offset=4 + i32.store offset=4 end global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer ) - (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result f32) + (func $std/operator-overloading/TesterElementAccess#__get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -2068,25 +2065,25 @@ i32.store local.get $1 call $~lib/string/String.__eq - if (result f32) + if (result i32) local.get $0 - f32.load + i32.load else local.get $0 - f32.load offset=4 + i32.load offset=4 end - local.set $3 + local.set $0 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $0 ) (func $start:std/operator-overloading (local $0 i32) (local $1 i32) global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 24 i32.sub global.set $~lib/memory/__stack_pointer block $folding-inner0 @@ -2095,12 +2092,9 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i64.const 0 - i64.store offset=8 + i32.const 0 + i32.const 24 + memory.fill memory.size i32.const 16 i32.shl @@ -3537,11 +3531,11 @@ local.tee $0 i32.store local.get $0 - f32.const 1 - f32.store + i32.const 1 + i32.store local.get $0 - f32.const 2 - f32.store offset=4 + i32.const 2 + i32.store offset=4 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add @@ -3557,7 +3551,7 @@ i32.store offset=4 local.get $0 i32.const 1536 - f32.const -1 + i32.const -1 call $std/operator-overloading/TesterElementAccess#__set global.get $~lib/memory/__stack_pointer global.get $std/operator-overloading/tea @@ -3568,12 +3562,12 @@ i32.store offset=4 local.get $0 i32.const 1568 - f32.const -2 + i32.const -2 call $std/operator-overloading/TesterElementAccess#__set global.get $std/operator-overloading/tea - f32.load - f32.const -1 - f32.ne + i32.load + i32.const -1 + i32.ne if i32.const 0 i32.const 1456 @@ -3593,8 +3587,8 @@ local.get $1 i32.const 1536 call $std/operator-overloading/TesterElementAccess#__get - f32.const -1 - f32.ne + i32.const -1 + i32.ne if i32.const 0 i32.const 1456 @@ -3604,9 +3598,9 @@ unreachable end global.get $std/operator-overloading/tea - f32.load offset=4 - f32.const -2 - f32.ne + i32.load offset=4 + i32.const -2 + i32.ne if i32.const 0 i32.const 1456 @@ -3626,8 +3620,8 @@ local.get $1 i32.const 1568 call $std/operator-overloading/TesterElementAccess#__get - f32.const -2 - f32.ne + i32.const -2 + i32.ne if i32.const 0 i32.const 1456 @@ -3637,7 +3631,90 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 16 + local.tee $0 + global.get $std/operator-overloading/tea + local.tee $1 + i32.store + local.get $0 + i32.const 1536 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=16 + local.get $0 + i32.const 1536 + i32.store offset=20 + local.get $1 + i32.const 1536 + local.get $1 + i32.const 1536 + call $std/operator-overloading/TesterElementAccess#__get + i32.const 1 + i32.add + call $std/operator-overloading/TesterElementAccess#__set + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/tea + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 1568 + i32.store offset=4 + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/tea + local.tee $1 + i32.store offset=16 + global.get $~lib/memory/__stack_pointer + i32.const 1568 + i32.store offset=20 + local.get $0 + i32.const 1568 + local.get $1 + i32.const 1568 + call $std/operator-overloading/TesterElementAccess#__get + i32.const 1 + i32.sub + call $std/operator-overloading/TesterElementAccess#__set + global.get $~lib/memory/__stack_pointer + global.get $std/operator-overloading/tea + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 1536 + i32.store offset=4 + local.get $0 + i32.const 1536 + call $std/operator-overloading/TesterElementAccess#__get + if + i32.const 0 + i32.const 1456 + i32.const 369 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $std/operator-overloading/tea + local.tee $1 + i32.store + local.get $0 + i32.const 1568 + i32.store offset=4 + local.get $1 + i32.const 1568 + call $std/operator-overloading/TesterElementAccess#__get + i32.const -3 + i32.ne + if + i32.const 0 + i32.const 1456 + i32.const 370 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 24 i32.add global.set $~lib/memory/__stack_pointer return diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index 6e65f03e65..8dbb881d52 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -335,17 +335,17 @@ assert(aii.x == 4 && aii.y == 6); class TesterElementAccess { [key: string]: number; constructor( - public x: f32, - public y: f32 + public x: i32, + public y: i32 ) {} @operator("[]") - __get(key: string): f32 { + __get(key: string): i32 { return key == "x" ? this.x : this.y; } @operator("[]=") - __set(key: string, value: f32): void { + __set(key: string, value: i32): void { key == "x" ? this.x = value : this.y = value; @@ -354,17 +354,17 @@ class TesterElementAccess { var tea = new TesterElementAccess(1, 2); -tea["x"] = -1.0; -tea["y"] = -2.0; +tea["x"] = -1; +tea["y"] = -2; -assert(tea.x == f32(-1.0)); -assert(tea["x"] == f32(-1.0)); +assert(tea.x == -1); +assert(tea["x"] == -1); -assert(tea.y == f32(-2.0)); -assert(tea["y"] == f32(-2.0)); +assert(tea.y == -2); +assert(tea["y"] == -2); tea["x"]++; --tea["y"]; -assert(tea["x"] == f32(-1.0)); -assert(tea["y"] == f32(-3.0)); +assert(tea["x"] == 0); +assert(tea["y"] == -3); From c62a284cf644ca2408febee01f380b17a30bfea2 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 13:10:37 +0300 Subject: [PATCH 07/13] refactor error message --- src/compiler.ts | 2 +- src/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index d68504ce34..695fe6b0d6 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5742,7 +5742,7 @@ export class Compiler extends DiagnosticEmitter { let getterIndexType = getterInstance.signature.parameterTypes[0]; if (!setterIndexType.equals(getterIndexType)) { this.error( - DiagnosticCode.Index_signature_type_should_be_the_same_for_getter_and_setter_in_0_class, + DiagnosticCode.Index_signature_type_should_be_the_same_for_element_accessors_in_0_class, valueExpression.range, classInstance.internalName ); this.currentType = tee ? getterInstance.signature.returnType : Type.void; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 07fb14c68d..9c083106da 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -12,7 +12,7 @@ "Start function name '{0}' is invalid or conflicts with another export.": 110, "Element '{0}' not found.": 111, "Exchange of '{0}' values is not supported by all embeddings": 112, - "Index signature type should be the same for getter and setter in '{0}' class.": 113, + "Index signature type should be the same for element accessors in '{0}' class.": 113, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, From 6433fe0ecdac80aa577edd8e7dca91bb0d2dd9b5 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 13:25:55 +0300 Subject: [PATCH 08/13] again --- src/compiler.ts | 2 +- src/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index 695fe6b0d6..cba970922e 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5742,7 +5742,7 @@ export class Compiler extends DiagnosticEmitter { let getterIndexType = getterInstance.signature.parameterTypes[0]; if (!setterIndexType.equals(getterIndexType)) { this.error( - DiagnosticCode.Index_signature_type_should_be_the_same_for_element_accessors_in_0_class, + DiagnosticCode.Index_signature_type_should_be_the_same_for_element_accessors_in_type_0, valueExpression.range, classInstance.internalName ); this.currentType = tee ? getterInstance.signature.returnType : Type.void; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 9c083106da..bad1497a27 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -12,7 +12,7 @@ "Start function name '{0}' is invalid or conflicts with another export.": 110, "Element '{0}' not found.": 111, "Exchange of '{0}' values is not supported by all embeddings": 112, - "Index signature type should be the same for element accessors in '{0}' class.": 113, + "Index signature type should be the same for element accessors in type '{0}'.": 113, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, From 4a3cb3d4df17f00da7913f14e219c40c1e0530c0 Mon Sep 17 00:00:00 2001 From: Max Graey Date: Fri, 26 Aug 2022 22:26:27 +0300 Subject: [PATCH 09/13] Update src/diagnosticMessages.json Co-authored-by: dcode --- src/diagnosticMessages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index bad1497a27..22c65edafe 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -12,7 +12,7 @@ "Start function name '{0}' is invalid or conflicts with another export.": 110, "Element '{0}' not found.": 111, "Exchange of '{0}' values is not supported by all embeddings": 112, - "Index signature type should be the same for element accessors in type '{0}'.": 113, + "Index signature accessors in type '{0}' differ in types.": 113, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, From 10c0a587fa43b6b4d3338f000fbe62188e2ec0ab Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 22:33:12 +0300 Subject: [PATCH 10/13] use errorRelated --- src/compiler.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index cba970922e..23632b7c62 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5741,9 +5741,11 @@ export class Compiler extends DiagnosticEmitter { let setterIndexType = setterInstance.signature.parameterTypes[0]; let getterIndexType = getterInstance.signature.parameterTypes[0]; if (!setterIndexType.equals(getterIndexType)) { - this.error( - DiagnosticCode.Index_signature_type_should_be_the_same_for_element_accessors_in_type_0, - valueExpression.range, classInstance.internalName + this.errorRelated( + DiagnosticCode.Index_signature_accessors_in_type_0_differ_in_types, + valueExpression.range, + assert(indexExpression).range, + classInstance.internalName, ); this.currentType = tee ? getterInstance.signature.returnType : Type.void; return module.unreachable(); From 4e45d449761f31de4778314013f06fa3808976c7 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 22:35:22 +0300 Subject: [PATCH 11/13] better --- src/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 23632b7c62..6a8de6db9c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5744,7 +5744,7 @@ export class Compiler extends DiagnosticEmitter { this.errorRelated( DiagnosticCode.Index_signature_accessors_in_type_0_differ_in_types, valueExpression.range, - assert(indexExpression).range, + setterInstance.identifierAndSignatureRange, classInstance.internalName, ); this.currentType = tee ? getterInstance.signature.returnType : Type.void; From 5cde16b578731dcb4dd5bd1de3f5f6201ebf15fa Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 22:36:16 +0300 Subject: [PATCH 12/13] more --- src/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 6a8de6db9c..061612702d 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5743,7 +5743,7 @@ export class Compiler extends DiagnosticEmitter { if (!setterIndexType.equals(getterIndexType)) { this.errorRelated( DiagnosticCode.Index_signature_accessors_in_type_0_differ_in_types, - valueExpression.range, + getterInstance.identifierAndSignatureRange, setterInstance.identifierAndSignatureRange, classInstance.internalName, ); From 4141d8710fe82f4382aad95577a7932b4841c921 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 26 Aug 2022 23:01:50 +0300 Subject: [PATCH 13/13] use different error code --- src/diagnosticMessages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 22c65edafe..99486b1396 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -12,7 +12,6 @@ "Start function name '{0}' is invalid or conflicts with another export.": 110, "Element '{0}' not found.": 111, "Exchange of '{0}' values is not supported by all embeddings": 112, - "Index signature accessors in type '{0}' differ in types.": 113, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, @@ -49,6 +48,7 @@ "Expression does not compile to a value at runtime.": 234, "Only variables, functions and enums become WebAssembly module exports.": 235, "Literal '{0}' does not fit into 'i64' or 'u64' types.": 236, + "Index signature accessors in type '{0}' differ in types.": 237, "Importing the table disables some indirect call optimizations.": 901, "Exporting the table disables some indirect call optimizations.": 902,