Fix functional Array & String methods and avoid buffer caching (#415)

This commit is contained in:
Max Graey
2019-01-17 02:34:09 +02:00
committed by Daniel Wirtz
parent df3b2befd7
commit 54b02c287c
11 changed files with 933 additions and 936 deletions

View File

@ -2315,7 +2315,7 @@
if
i32.const 0
i32.const 8
i32.const 184
i32.const 182
i32.const 42
call $~lib/env/abort
unreachable
@ -2352,7 +2352,7 @@
if
i32.const 0
i32.const 8
i32.const 246
i32.const 244
i32.const 20
call $~lib/env/abort
unreachable
@ -2381,12 +2381,10 @@
i32.load offset=4
tee_local $2
get_local $1
if (result i32)
get_local $1
i32.load offset=4
else
i32.const 0
end
i32.load offset=4
i32.const 0
get_local $1
select
tee_local $4
i32.add
call $~lib/array/Array<i32>#constructor
@ -2648,7 +2646,7 @@
if
i32.const 0
i32.const 8
i32.const 334
i32.const 327
i32.const 42
call $~lib/env/abort
unreachable
@ -2702,7 +2700,7 @@
if
i32.const 0
i32.const 8
i32.const 305
i32.const 299
i32.const 20
call $~lib/env/abort
unreachable
@ -2992,7 +2990,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -3028,10 +3026,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3041,16 +3035,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3111,10 +3106,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3124,16 +3115,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3194,10 +3186,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3207,16 +3195,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3281,21 +3270,18 @@
block $break|0
get_local $0
i32.load offset=4
set_local $4
set_local $3
loop $repeat|0
get_local $2
get_local $3
get_local $0
i32.load offset=4
tee_local $4
get_local $3
get_local $4
i32.lt_s
tee_local $3
if
get_local $2
get_local $0
i32.load offset=4
i32.lt_s
set_local $3
end
get_local $3
i32.eqz
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
@ -3448,17 +3434,13 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
tee_local $3
call $~lib/array/Array<i32>#constructor
tee_local $5
tee_local $4
i32.load
set_local $6
set_local $5
loop $repeat|0
get_local $1
get_local $3
@ -3477,10 +3459,11 @@
i32.const 2
i32.shl
tee_local $2
get_local $6
get_local $5
i32.add
get_local $0
i32.load
get_local $2
get_local $4
i32.add
i32.load offset=8
get_local $1
@ -3495,7 +3478,7 @@
br $repeat|0
end
end
get_local $5
get_local $4
)
(func $start~anonymous|23 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_local $2
@ -3514,38 +3497,35 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
tee_local $3
call $~lib/array/Array<i32>#constructor
tee_local $5
tee_local $4
i32.load
set_local $6
set_local $5
loop $repeat|0
block $break|0
get_local $2
get_local $3
get_local $0
i32.load offset=4
tee_local $7
tee_local $6
get_local $3
get_local $7
get_local $6
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $6
get_local $5
get_local $2
i32.const 2
i32.shl
i32.add
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3563,7 +3543,7 @@
br $repeat|0
end
end
get_local $5
get_local $4
)
(func $start~anonymous|24 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_global $std/array/i
@ -3592,10 +3572,6 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $6
i32.const 0
call $~lib/array/Array<i32>#constructor
set_local $4
@ -3615,7 +3591,8 @@
select
i32.ge_s
br_if $break|0
get_local $6
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3687,10 +3664,6 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $5
get_local $0
i32.load offset=4
set_local $4
@ -3700,9 +3673,9 @@
get_local $4
get_local $0
i32.load offset=4
tee_local $6
tee_local $5
get_local $4
get_local $6
get_local $5
i32.lt_s
select
i32.ge_s
@ -3710,7 +3683,8 @@
i32.const 4
set_global $~argc
get_local $2
get_local $5
get_local $0
i32.load
get_local $3
i32.const 2
i32.shl
@ -3765,10 +3739,6 @@
)
(func $~lib/array/Array<i32>#reduceRight<i32> (; 67 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
i32.const 1
@ -3783,7 +3753,8 @@
i32.const 4
set_global $~argc
get_local $2
get_local $4
get_local $0
i32.load
get_local $3
i32.const 2
i32.shl
@ -4249,7 +4220,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -4818,7 +4789,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -5388,7 +5359,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -5771,7 +5742,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable