mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 03:01:55 +00:00
optimize logical and/or, initial null checking in flows
This commit is contained in:
@ -469,35 +469,33 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
i32.load8_u
|
||||
local.get $1
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -764,8 +762,7 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $1
|
||||
if
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.get $0
|
||||
@ -775,9 +772,9 @@
|
||||
f64.mul
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
local.set $1
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
local.get $1
|
||||
if
|
||||
local.get $0
|
||||
local.get $2
|
||||
@ -1312,8 +1309,7 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $1
|
||||
if
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.get $0
|
||||
@ -1323,9 +1319,9 @@
|
||||
f64.mul
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
local.set $1
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
local.get $1
|
||||
if
|
||||
local.get $0
|
||||
local.get $2
|
||||
@ -1616,35 +1612,33 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
i32.load16_u
|
||||
local.get $1
|
||||
i32.const 65535
|
||||
i32.and
|
||||
i32.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -1947,8 +1941,7 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $1
|
||||
if
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.get $0
|
||||
@ -1958,9 +1951,9 @@
|
||||
f64.mul
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
local.set $1
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
local.get $1
|
||||
if
|
||||
local.get $0
|
||||
local.get $2
|
||||
@ -2531,8 +2524,7 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $1
|
||||
if
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.get $0
|
||||
@ -2542,9 +2534,9 @@
|
||||
f64.mul
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
local.set $1
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
local.get $1
|
||||
if
|
||||
local.get $0
|
||||
local.get $2
|
||||
@ -2866,33 +2858,31 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
i32.load
|
||||
local.get $1
|
||||
i32.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -3133,7 +3123,6 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -3145,7 +3134,7 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $1
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
@ -3811,33 +3800,31 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
i64.load
|
||||
local.get $1
|
||||
i64.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -4079,7 +4066,6 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -4091,7 +4077,7 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $2
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
@ -4656,33 +4642,31 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
f32.load
|
||||
local.get $1
|
||||
f32.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -4928,7 +4912,6 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -4940,7 +4923,7 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $2
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
@ -5232,33 +5215,31 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
local.set $2
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.const 1
|
||||
i32.and
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if
|
||||
local.get $2
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
else
|
||||
local.get $0
|
||||
f64.load
|
||||
local.get $1
|
||||
f64.eq
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $2
|
||||
local.get $0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.const -2
|
||||
i32.and
|
||||
local.set $2
|
||||
local.set $0
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -5504,7 +5485,6 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -5516,7 +5496,7 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $2
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
@ -5781,7 +5761,7 @@
|
||||
i32.load
|
||||
i32.le_u
|
||||
else
|
||||
local.get $0
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
loop $continue|0
|
||||
@ -5805,19 +5785,15 @@
|
||||
i32.const 0
|
||||
)
|
||||
(func $~lib/runtime/runtime.flags (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
local.tee $1
|
||||
i32.eqz
|
||||
if
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.const 160
|
||||
i32.load
|
||||
i32.gt_u
|
||||
local.set $1
|
||||
else
|
||||
i32.const 1
|
||||
end
|
||||
local.get $1
|
||||
if (result i32)
|
||||
unreachable
|
||||
else
|
||||
@ -5853,15 +5829,13 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
local.tee $2
|
||||
i32.eqz
|
||||
local.tee $0
|
||||
if (result i32)
|
||||
local.get $0
|
||||
else
|
||||
local.get $2
|
||||
i32.const 160
|
||||
i32.load
|
||||
i32.gt_u
|
||||
else
|
||||
i32.const 1
|
||||
end
|
||||
if (result i32)
|
||||
unreachable
|
||||
|
Reference in New Issue
Block a user