mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-30 21:52:18 +00:00
optimize logical and/or, initial null checking in flows
This commit is contained in:
@@ -230,7 +230,7 @@
|
||||
local.tee $5
|
||||
i32.eqz
|
||||
else
|
||||
local.get $4
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
block
|
||||
@@ -255,7 +255,6 @@
|
||||
)
|
||||
(func $~lib/string/String.__eq (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.eq
|
||||
@@ -266,9 +265,8 @@
|
||||
local.get $0
|
||||
i32.const 0
|
||||
i32.eq
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $2
|
||||
i32.const 1
|
||||
else
|
||||
local.get $1
|
||||
i32.const 0
|
||||
@@ -280,8 +278,8 @@
|
||||
end
|
||||
local.get $0
|
||||
call $~lib/string/String#get:length
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $1
|
||||
call $~lib/string/String#get:length
|
||||
i32.ne
|
||||
@@ -293,7 +291,7 @@
|
||||
i32.const 0
|
||||
local.get $1
|
||||
i32.const 0
|
||||
local.get $3
|
||||
local.get $2
|
||||
call $~lib/util/string/compareImpl
|
||||
i32.eqz
|
||||
)
|
||||
@@ -426,7 +424,7 @@
|
||||
i32.load
|
||||
i32.le_u
|
||||
else
|
||||
local.get $2
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
loop $continue|0
|
||||
@@ -451,14 +449,12 @@
|
||||
)
|
||||
(func $~lib/runtime/runtime.flags (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
global.get $~lib/runtime/RTTI_BASE
|
||||
local.set $1
|
||||
local.get $0
|
||||
i32.eqz
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $2
|
||||
i32.const 1
|
||||
else
|
||||
local.get $0
|
||||
local.get $1
|
||||
|
Reference in New Issue
Block a user