mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 06:51:34 +00:00
Implement unary operator overloads (#124)
This commit is contained in:
@ -54,6 +54,20 @@
|
||||
(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/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))
|
||||
@ -2016,7 +2030,152 @@
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func $start (; 20 ;) (type $v)
|
||||
(func $std/operator-overloading/Tester.shr (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shr_s
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shr_s
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.shu (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shr_u
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shr_u
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.shl (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shl
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shl
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.neg (; 23 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.not (; 24 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.xor
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.excl (; 25 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.eqz
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eqz
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester#inc (; 26 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.store offset=4
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(func $std/operator-overloading/Tester#dec (; 27 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.store offset=4
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(func $start (; 28 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(set_global $~lib/allocator/arena/startOffset
|
||||
@ -2075,7 +2234,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 87)
|
||||
(i32.const 137)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2124,7 +2283,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 93)
|
||||
(i32.const 143)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2174,7 +2333,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 99)
|
||||
(i32.const 149)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2224,7 +2383,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 105)
|
||||
(i32.const 155)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2273,7 +2432,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 111)
|
||||
(i32.const 161)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2323,7 +2482,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 117)
|
||||
(i32.const 167)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2373,7 +2532,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 123)
|
||||
(i32.const 173)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2423,7 +2582,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 129)
|
||||
(i32.const 179)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2473,7 +2632,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 135)
|
||||
(i32.const 185)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2508,7 +2667,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 141)
|
||||
(i32.const 191)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2540,7 +2699,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 147)
|
||||
(i32.const 197)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2558,7 +2717,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 151)
|
||||
(i32.const 201)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2579,7 +2738,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 155)
|
||||
(i32.const 205)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2614,7 +2773,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 161)
|
||||
(i32.const 211)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2649,7 +2808,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 167)
|
||||
(i32.const 217)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2684,7 +2843,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 173)
|
||||
(i32.const 223)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2719,7 +2878,416 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 179)
|
||||
(i32.const 229)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shr
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/sres
|
||||
(call $std/operator-overloading/Tester.shr
|
||||
(get_global $std/operator-overloading/shr)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 2)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 234)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shu
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const -8)
|
||||
(i32.const -16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/ures
|
||||
(call $std/operator-overloading/Tester.shu
|
||||
(get_global $std/operator-overloading/shu)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/ures)
|
||||
)
|
||||
(i32.const 536870911)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/ures)
|
||||
)
|
||||
(i32.const 536870910)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 239)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shl
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/sres
|
||||
(call $std/operator-overloading/Tester.shl
|
||||
(get_global $std/operator-overloading/shl)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 244)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/pos
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
(i32.const -2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/pres
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/pres)
|
||||
)
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/pres)
|
||||
)
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 249)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/neg
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const -1)
|
||||
(i32.const -2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/nres
|
||||
(call $std/operator-overloading/Tester.neg
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/nres)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/nres)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 254)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/not
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 255)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/res
|
||||
(call $std/operator-overloading/Tester.not
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/res)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/res)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 259)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/excl
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/bres
|
||||
(call $std/operator-overloading/Tester.excl
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(get_global $std/operator-overloading/bres)
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eqz
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eqz
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 264)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(get_global $std/operator-overloading/bres)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 265)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#inc
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 2)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 271)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#dec
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eqz
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 274)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2788,7 +3356,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 193)
|
||||
(i32.const 288)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2857,7 +3425,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 207)
|
||||
(i32.const 302)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
|
@ -78,6 +78,56 @@ class Tester {
|
||||
static lessEquals(a: Tester, b: Tester): bool {
|
||||
return a.x <= b.x && a.y <= b.y;
|
||||
}
|
||||
|
||||
@operator('>>')
|
||||
static shr(value: Tester, shift: i32): Tester {
|
||||
return new Tester(value.x >> shift, value.y >> shift);
|
||||
}
|
||||
|
||||
@operator('>>>')
|
||||
static shu(value: Tester, shift: i32): Tester {
|
||||
return new Tester(value.x >>> shift, value.y >>> shift);
|
||||
}
|
||||
|
||||
@operator('<<')
|
||||
static shl(value: Tester, shift: i32): Tester {
|
||||
return new Tester(value.x << shift, value.y << shift);
|
||||
}
|
||||
|
||||
// unary opterators
|
||||
@operator.prefix('~')
|
||||
static not(value: Tester): Tester {
|
||||
return new Tester(~value.x, ~value.y);
|
||||
}
|
||||
|
||||
@operator.prefix('!')
|
||||
static excl(value: Tester): bool {
|
||||
return !value.x && !value.y;
|
||||
}
|
||||
|
||||
@operator.prefix('+')
|
||||
static pos(value: Tester): Tester {
|
||||
return new Tester(+value.x, +value.y);
|
||||
}
|
||||
|
||||
@operator.prefix('-')
|
||||
static neg(value: Tester): Tester {
|
||||
return new Tester(-value.x, -value.y);
|
||||
}
|
||||
|
||||
@operator.prefix('++')
|
||||
inc(): this {
|
||||
++this.x;
|
||||
++this.y;
|
||||
return this;
|
||||
}
|
||||
|
||||
@operator.prefix('--')
|
||||
dec(): this {
|
||||
--this.x;
|
||||
--this.y;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// check additional
|
||||
@ -178,6 +228,51 @@ var leq2 = new Tester(4, 3);
|
||||
var leq = leq1 <= leq2;
|
||||
assert(leq == true);
|
||||
|
||||
// check right shift
|
||||
var shr = new Tester(8, 16);
|
||||
var sres = shr >> 3;
|
||||
assert(sres.x == 1 && sres.y == 2);
|
||||
|
||||
// check right shift
|
||||
var shu = new Tester(-8, -16);
|
||||
var ures = shu >>> 3;
|
||||
assert(ures.x == 536870911 && ures.y == 536870910);
|
||||
|
||||
// check left shift
|
||||
var shl = new Tester(1, 2);
|
||||
sres = shl << 3;
|
||||
assert(sres.x == 8 && sres.y == 16);
|
||||
|
||||
// check unary positive
|
||||
var pos = new Tester(1, -2);
|
||||
var pres = +pos;
|
||||
assert(pres.x == pos.x && pres.y == pos.y);
|
||||
|
||||
// check unary negative
|
||||
var neg = new Tester(-1, -2);
|
||||
var nres = -neg;
|
||||
assert(nres.x == -neg.x && nres.y == -neg.y);
|
||||
|
||||
// check unary not "~"
|
||||
var not = new Tester(0xFF, 0x10);
|
||||
var res = ~not;
|
||||
assert(res.x == ~not.x && res.y == ~not.y);
|
||||
|
||||
// check unary exclamation "!"
|
||||
var excl = new Tester(0, 0);
|
||||
var bres = !excl;
|
||||
assert(bres == (!excl.x && !excl.y));
|
||||
assert(bres == true);
|
||||
|
||||
//
|
||||
var incdec = new Tester(0, 1);
|
||||
|
||||
++incdec;
|
||||
assert(incdec.x == 1 && incdec.y == 2);
|
||||
|
||||
--incdec;
|
||||
assert(incdec.x == 0 && incdec.y == 1);
|
||||
|
||||
// check inlined static
|
||||
class TesterInlineStatic {
|
||||
constructor(public x: i32, public y: i32) {
|
||||
|
@ -59,6 +59,20 @@
|
||||
(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/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))
|
||||
@ -2263,7 +2277,168 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/TesterInlineStatic#constructor (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $std/operator-overloading/Tester.shr (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(return
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shr_s
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shr_s
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.shu (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(return
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shr_u
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shr_u
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.shl (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(return
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.shl
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.shl
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.neg (; 23 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.not (; 24 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.xor
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester.excl (; 25 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(return
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.eqz
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eqz
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester#inc (; 26 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.store offset=4
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(return
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/Tester#dec (; 27 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.store offset=4
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(return
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/TesterInlineStatic#constructor (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
(nop)
|
||||
(tee_local $0
|
||||
@ -2291,7 +2466,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/operator-overloading/TesterInlineInstance#constructor (; 21 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $std/operator-overloading/TesterInlineInstance#constructor (; 29 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
(nop)
|
||||
(tee_local $0
|
||||
@ -2319,7 +2494,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $start (; 22 ;) (type $v)
|
||||
(func $start (; 30 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(set_global $~lib/allocator/arena/startOffset
|
||||
@ -2381,7 +2556,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 87)
|
||||
(i32.const 137)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2431,7 +2606,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 93)
|
||||
(i32.const 143)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2481,7 +2656,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 99)
|
||||
(i32.const 149)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2531,7 +2706,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 105)
|
||||
(i32.const 155)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2581,7 +2756,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 111)
|
||||
(i32.const 161)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2631,7 +2806,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 117)
|
||||
(i32.const 167)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2681,7 +2856,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 123)
|
||||
(i32.const 173)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2731,7 +2906,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 129)
|
||||
(i32.const 179)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2781,7 +2956,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 135)
|
||||
(i32.const 185)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2818,7 +2993,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 141)
|
||||
(i32.const 191)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2855,7 +3030,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 147)
|
||||
(i32.const 197)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2878,7 +3053,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 151)
|
||||
(i32.const 201)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2901,7 +3076,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 155)
|
||||
(i32.const 205)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2938,7 +3113,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 161)
|
||||
(i32.const 211)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -2975,7 +3150,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 167)
|
||||
(i32.const 217)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -3012,7 +3187,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 173)
|
||||
(i32.const 223)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -3049,7 +3224,421 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 179)
|
||||
(i32.const 229)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shr
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/sres
|
||||
(call $std/operator-overloading/Tester.shr
|
||||
(get_global $std/operator-overloading/shr)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 2)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 234)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shu
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const -8)
|
||||
(i32.const -16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/ures
|
||||
(call $std/operator-overloading/Tester.shu
|
||||
(get_global $std/operator-overloading/shu)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/ures)
|
||||
)
|
||||
(i32.const 536870911)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/ures)
|
||||
)
|
||||
(i32.const 536870910)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 239)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/shl
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/sres
|
||||
(call $std/operator-overloading/Tester.shl
|
||||
(get_global $std/operator-overloading/shl)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/sres)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 244)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/pos
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
(i32.const -2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/pres
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/pres)
|
||||
)
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/pres)
|
||||
)
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/pos)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 249)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/neg
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const -1)
|
||||
(i32.const -2)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/nres
|
||||
(call $std/operator-overloading/Tester.neg
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/nres)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/nres)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/neg)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 254)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/not
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 255)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/res
|
||||
(call $std/operator-overloading/Tester.not
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/res)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/res)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/not)
|
||||
)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 259)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/excl
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/bres
|
||||
(call $std/operator-overloading/Tester.excl
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.eq
|
||||
(get_global $std/operator-overloading/bres)
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eqz
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.eqz
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/excl)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 264)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.eq
|
||||
(get_global $std/operator-overloading/bres)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 265)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#inc
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 2)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 271)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/operator-overloading/incdec
|
||||
(call $std/operator-overloading/Tester#dec
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $0
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(i32.eq
|
||||
(i32.load offset=4
|
||||
(get_global $std/operator-overloading/incdec)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 274)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -3124,7 +3713,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 193)
|
||||
(i32.const 288)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -3199,7 +3788,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 207)
|
||||
(i32.const 302)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
|
Reference in New Issue
Block a user