optimize logical and/or, initial null checking in flows

This commit is contained in:
dcode
2019-04-09 03:04:45 +02:00
parent c16c19e18d
commit da4a7751fd
73 changed files with 5920 additions and 6866 deletions

View File

@ -56,10 +56,10 @@
i32.load offset=4
i32.const 1
i32.shr_u
local.set $4
local.set $3
loop $continue|0
local.get $2
local.get $4
local.get $3
i32.lt_u
if
local.get $2
@ -68,7 +68,7 @@
local.get $0
i32.add
i32.load16_u
local.tee $3
local.tee $4
i32.const 128
i32.lt_u
if (result i32)
@ -80,7 +80,7 @@
i32.const 1
i32.add
else
local.get $3
local.get $4
i32.const 2048
i32.lt_u
if (result i32)
@ -92,23 +92,18 @@
i32.const 1
i32.add
else
block (result i32)
local.get $3
i32.const 64512
i32.and
i32.const 55296
i32.eq
local.tee $3
if
local.get $2
i32.const 1
i32.add
local.get $4
i32.lt_u
local.set $3
end
local.get $3
end
local.get $2
i32.const 1
i32.add
local.get $3
i32.lt_u
i32.const 0
local.get $4
i32.const 64512
i32.and
i32.const 55296
i32.eq
select
if (result i32)
local.get $2
i32.const 1
@ -123,7 +118,7 @@
i32.const 56320
i32.eq
else
local.get $3
i32.const 0
end
if (result i32)
local.get $1
@ -230,10 +225,10 @@
i32.load offset=4
i32.const 1
i32.shr_u
local.set $7
local.set $6
loop $continue|0
local.get $4
local.get $7
local.get $6
i32.lt_u
if
local.get $4
@ -284,21 +279,18 @@
local.get $5
i32.add
local.set $3
local.get $4
i32.const 1
i32.add
local.get $6
i32.lt_u
i32.const 0
local.get $1
i32.const 64512
i32.and
i32.const 55296
i32.eq
local.tee $6
if (result i32)
local.get $4
i32.const 1
i32.add
local.get $7
i32.lt_u
else
local.get $6
end
select
if
local.get $4
i32.const 1
@ -308,7 +300,7 @@
local.get $0
i32.add
i32.load16_u
local.tee $6
local.tee $7
i32.const 64512
i32.and
i32.const 56320
@ -322,7 +314,7 @@
i32.shl
i32.const 65536
i32.add
local.get $6
local.get $7
i32.const 1023
i32.and
i32.add
@ -663,35 +655,32 @@
i32.lt_u
if
local.get $2
local.tee $3
local.tee $4
i32.const 1
i32.add
local.set $2
local.get $0
local.get $3
local.get $4
i32.add
i32.load8_u
local.tee $4
local.tee $3
i32.const 128
i32.lt_u
if
local.get $5
local.get $6
i32.add
local.get $4
local.get $3
i32.store16
else
local.get $4
local.get $3
i32.const 224
i32.lt_u
i32.const 0
local.get $3
i32.const 191
i32.gt_u
local.tee $3
if
local.get $4
i32.const 224
i32.lt_u
local.set $3
end
local.get $3
select
if
local.get $2
i32.const 1
@ -707,7 +696,7 @@
unreachable
end
local.get $2
local.tee $3
local.tee $4
i32.const 1
i32.add
local.set $2
@ -715,12 +704,12 @@
local.get $6
i32.add
local.get $0
local.get $3
local.get $4
i32.add
i32.load8_u
i32.const 63
i32.and
local.get $4
local.get $3
i32.const 31
i32.and
i32.const 6
@ -728,17 +717,14 @@
i32.or
i32.store16
else
local.get $4
local.get $3
i32.const 365
i32.lt_u
i32.const 0
local.get $3
i32.const 239
i32.gt_u
local.tee $3
if
local.get $4
i32.const 365
i32.lt_u
local.set $3
end
local.get $3
select
if
local.get $2
i32.const 3
@ -753,7 +739,7 @@
call $~lib/builtins/abort
unreachable
end
local.get $4
local.get $3
i32.const 7
i32.and
i32.const 18
@ -779,11 +765,11 @@
i32.const 6
i32.shl
i32.or
local.set $3
local.set $4
local.get $2
i32.const 1
i32.add
local.tee $4
local.tee $3
i32.const 1
i32.add
local.set $2
@ -791,16 +777,16 @@
local.get $6
i32.add
local.get $0
local.get $4
local.get $3
i32.add
i32.load8_u
i32.const 63
i32.and
local.get $3
local.get $4
i32.or
i32.const 65536
i32.sub
local.tee $3
local.tee $4
i32.const 10
i32.shr_u
i32.const 55296
@ -812,7 +798,7 @@
i32.add
local.tee $5
i32.add
local.get $3
local.get $4
i32.const 1023
i32.and
i32.const 56320
@ -832,7 +818,7 @@
call $~lib/builtins/abort
unreachable
end
local.get $4
local.get $3
i32.const 15
i32.and
i32.const 12
@ -846,11 +832,11 @@
i32.const 6
i32.shl
i32.or
local.set $3
local.set $4
local.get $2
i32.const 1
i32.add
local.tee $4
local.tee $3
i32.const 1
i32.add
local.set $2
@ -858,12 +844,12 @@
local.get $6
i32.add
local.get $0
local.get $4
local.get $3
i32.add
i32.load8_u
i32.const 63
i32.and
local.get $3
local.get $4
i32.or
i32.store16
end
@ -910,7 +896,7 @@
local.tee $3
i32.eqz
else
local.get $2
i32.const 0
end
if
local.get $2
@ -939,15 +925,11 @@
i32.const 1
return
end
local.get $0
local.get $1
i32.eqz
local.tee $2
if (result i32)
local.get $2
else
local.get $1
i32.eqz
end
i32.const 1
local.get $0
select
if
i32.const 0
return
@ -1233,7 +1215,7 @@
i32.load
i32.le_u
else
local.get $0
i32.const 0
end
if
loop $continue|0
@ -1257,19 +1239,15 @@
i32.const 0
)
(func $~lib/runtime/runtime.flags (; 13 ;) (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 360
i32.load
i32.gt_u
local.set $1
else
i32.const 1
end
local.get $1
if (result i32)
unreachable
else
@ -1304,15 +1282,13 @@
(local $3 i32)
(local $4 i32)
local.get $0
i32.eqz
local.tee $2
if (result i32)
local.get $2
else
local.get $0
i32.const 360
i32.load
i32.gt_u
else
i32.const 1
end
if (result i32)
unreachable