mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 17:31:29 +00:00
use more useful defaults for -O, fix an utoa issue
This commit is contained in:
@ -22,7 +22,15 @@
|
||||
(global $std/string-utf8/ptr (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $~lib/string/String#get:lengthUTF8 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/string/String#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 16
|
||||
i32.sub
|
||||
i32.load offset=12
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
)
|
||||
(func $~lib/string/String#get:lengthUTF8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -30,11 +38,7 @@
|
||||
i32.const 1
|
||||
local.set $1
|
||||
local.get $0
|
||||
i32.const 16
|
||||
i32.sub
|
||||
i32.load offset=12
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
call $~lib/string/String#get:length
|
||||
local.set $3
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
@ -124,7 +128,7 @@
|
||||
end
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
@ -198,7 +202,7 @@
|
||||
i32.store offset=12
|
||||
local.get $3
|
||||
)
|
||||
(func $~lib/string/String#toUTF8 (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/string/String#toUTF8 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -212,18 +216,14 @@
|
||||
call $~lib/rt/stub/__alloc
|
||||
local.set $5
|
||||
local.get $0
|
||||
i32.const 16
|
||||
i32.sub
|
||||
i32.load offset=12
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
call $~lib/string/String#get:length
|
||||
local.set $6
|
||||
loop $continue|0
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $6
|
||||
i32.lt_u
|
||||
if
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
@ -232,7 +232,7 @@
|
||||
local.tee $1
|
||||
i32.const 128
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
if
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.add
|
||||
@ -241,22 +241,23 @@
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $2
|
||||
else
|
||||
local.get $1
|
||||
i32.const 2048
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
if
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
local.get $1
|
||||
i32.const 6
|
||||
i32.shr_u
|
||||
i32.const 192
|
||||
i32.or
|
||||
i32.store8
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 63
|
||||
i32.and
|
||||
@ -266,12 +267,13 @@
|
||||
local.get $2
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.set $2
|
||||
else
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.add
|
||||
local.set $3
|
||||
local.get $4
|
||||
local.set $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.get $6
|
||||
@ -284,7 +286,7 @@
|
||||
i32.eq
|
||||
select
|
||||
if
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.add
|
||||
i32.const 1
|
||||
@ -298,7 +300,7 @@
|
||||
i32.const 56320
|
||||
i32.eq
|
||||
if
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 1023
|
||||
i32.and
|
||||
@ -316,7 +318,7 @@
|
||||
i32.const 240
|
||||
i32.or
|
||||
i32.store8
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 12
|
||||
i32.shr_u
|
||||
@ -325,7 +327,7 @@
|
||||
i32.const 128
|
||||
i32.or
|
||||
i32.store8 offset=1
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 6
|
||||
i32.shr_u
|
||||
@ -334,7 +336,7 @@
|
||||
i32.const 128
|
||||
i32.or
|
||||
i32.store8 offset=2
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 63
|
||||
i32.and
|
||||
@ -345,21 +347,21 @@
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $2
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.set $4
|
||||
local.set $3
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 12
|
||||
i32.shr_u
|
||||
i32.const 224
|
||||
i32.or
|
||||
i32.store8
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 6
|
||||
i32.shr_u
|
||||
@ -368,7 +370,7 @@
|
||||
i32.const 128
|
||||
i32.or
|
||||
i32.store8 offset=1
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.const 63
|
||||
i32.and
|
||||
@ -378,13 +380,13 @@
|
||||
local.get $2
|
||||
i32.const 3
|
||||
i32.add
|
||||
local.set $2
|
||||
end
|
||||
end
|
||||
local.set $2
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $4
|
||||
local.set $3
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
@ -395,7 +397,7 @@
|
||||
i32.store8
|
||||
local.get $5
|
||||
)
|
||||
(func $~lib/memory/memory.copy (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/memory/memory.copy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
block $~lib/util/memory/memmove|inlined.0
|
||||
@ -568,7 +570,7 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $~lib/string/String.fromUTF8 (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/string/String.fromUTF8 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
@ -820,7 +822,7 @@
|
||||
call $~lib/memory/memory.copy
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $~lib/util/string/compareImpl (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
loop $continue|0
|
||||
local.get $2
|
||||
@ -853,7 +855,7 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $~lib/string/String.__eq (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/string/String.__eq (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -870,18 +872,10 @@
|
||||
select
|
||||
br_if $folding-inner0
|
||||
local.get $0
|
||||
i32.const 16
|
||||
i32.sub
|
||||
i32.load offset=12
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
call $~lib/string/String#get:length
|
||||
local.tee $2
|
||||
local.get $1
|
||||
i32.const 16
|
||||
i32.sub
|
||||
i32.load offset=12
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
call $~lib/string/String#get:length
|
||||
i32.ne
|
||||
br_if $folding-inner0
|
||||
local.get $0
|
||||
@ -893,7 +887,7 @@
|
||||
end
|
||||
i32.const 0
|
||||
)
|
||||
(func $start:std/string-utf8 (; 8 ;) (type $FUNCSIG$v)
|
||||
(func $start:std/string-utf8 (; 9 ;) (type $FUNCSIG$v)
|
||||
global.get $std/string-utf8/str
|
||||
call $~lib/string/String#get:lengthUTF8
|
||||
global.set $std/string-utf8/len
|
||||
@ -1138,10 +1132,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 9 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 10 ;) (type $FUNCSIG$v)
|
||||
call $start:std/string-utf8
|
||||
)
|
||||
(func $null (; 10 ;) (type $FUNCSIG$v)
|
||||
(func $null (; 11 ;) (type $FUNCSIG$v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user