Skip to content

Commit 418855e

Browse files
committed
update fixtures
1 parent 0dedb22 commit 418855e

File tree

6 files changed

+503
-458
lines changed

6 files changed

+503
-458
lines changed

tests/compiler/number.optimized.wat

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
(type $i32_=>_i32 (func (param i32) (result i32)))
33
(type $none_=>_none (func))
44
(type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
5+
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
56
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
67
(type $f32_=>_i32 (func (param f32) (result i32)))
78
(type $f64_=>_i32 (func (param f64) (result i32)))
89
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
9-
(type $none_=>_i32 (func (result i32)))
10-
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
1110
(type $i32_i64_i32_i64_i32_i64_=>_i32 (func (param i32 i64 i32 i64 i32 i64) (result i32)))
1211
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
1312
(memory $0 1)
@@ -1270,9 +1269,7 @@
12701269
global.get $~lib/util/number/_K
12711270
call $~lib/util/number/prettify
12721271
)
1273-
(func $~lib/util/number/dtoa (result i32)
1274-
(local $0 i32)
1275-
(local $1 i32)
1272+
(func $~lib/string/String#substring (param $0 i32) (param $1 i32) (result i32)
12761273
(local $2 i32)
12771274
(local $3 i32)
12781275
(local $4 i32)
@@ -1322,12 +1319,8 @@
13221319
local.tee $3
13231320
i32.eqz
13241321
if
1325-
i32.const 0
1326-
i32.const 2512
1327-
i32.const 68
1328-
i32.const 3
1329-
call $~lib/builtins/abort
1330-
unreachable
1322+
i32.const 2496
1323+
return
13311324
end
13321325
i32.const 0
13331326
local.get $4
@@ -1338,12 +1331,8 @@
13381331
local.get $1
13391332
select
13401333
if
1341-
i32.const 0
1342-
i32.const 2512
1343-
i32.const 70
1344-
i32.const 14
1345-
call $~lib/builtins/abort
1346-
unreachable
1334+
local.get $0
1335+
return
13471336
end
13481337
local.get $3
13491338
call $~lib/rt/stub/__alloc
@@ -1407,6 +1396,8 @@
14071396
)
14081397
(func $start:number
14091398
(local $0 i32)
1399+
(local $1 i32)
1400+
(local $2 i32)
14101401
i32.const 2768
14111402
global.set $~lib/rt/stub/offset
14121403
global.get $number/a
@@ -1422,7 +1413,61 @@
14221413
call $~lib/builtins/abort
14231414
unreachable
14241415
end
1425-
call $~lib/util/number/dtoa
1416+
i32.const 56
1417+
call $~lib/rt/stub/__alloc
1418+
local.tee $0
1419+
call $~lib/util/number/dtoa_core
1420+
local.tee $1
1421+
i32.const 28
1422+
i32.ne
1423+
if (result i32)
1424+
local.get $0
1425+
local.get $1
1426+
call $~lib/string/String#substring
1427+
local.get $0
1428+
i32.const 15
1429+
i32.and
1430+
i32.eqz
1431+
i32.const 0
1432+
local.get $0
1433+
select
1434+
i32.eqz
1435+
if
1436+
i32.const 0
1437+
i32.const 2512
1438+
i32.const 68
1439+
i32.const 3
1440+
call $~lib/builtins/abort
1441+
unreachable
1442+
end
1443+
local.get $0
1444+
i32.const 16
1445+
i32.sub
1446+
local.tee $2
1447+
i32.load offset=4
1448+
i32.const 1
1449+
i32.ne
1450+
if
1451+
i32.const 0
1452+
i32.const 2512
1453+
i32.const 70
1454+
i32.const 14
1455+
call $~lib/builtins/abort
1456+
unreachable
1457+
end
1458+
global.get $~lib/rt/stub/offset
1459+
local.get $0
1460+
local.get $2
1461+
i32.load
1462+
i32.add
1463+
i32.eq
1464+
if
1465+
local.get $2
1466+
global.set $~lib/rt/stub/offset
1467+
end
1468+
else
1469+
local.get $0
1470+
end
14261471
i32.const 2560
14271472
call $~lib/string/String.__eq
14281473
i32.eqz

tests/compiler/retain-release-sanity.optimized.wat

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,29 +1670,31 @@
16701670
block $__inlined_func$~lib/string/String#concat (result i32)
16711671
local.get $0
16721672
call $~lib/rt/pure/__retain
1673-
local.tee $2
1673+
local.tee $0
16741674
i32.const 1424
1675-
local.get $2
1675+
local.get $0
16761676
select
16771677
local.set $3
16781678
local.get $1
16791679
call $~lib/rt/pure/__retain
1680-
local.tee $5
1680+
local.tee $1
1681+
local.set $2
1682+
local.get $2
16811683
call $~lib/rt/pure/__retain
1682-
local.tee $0
1684+
local.tee $2
16831685
i32.eqz
16841686
if
1685-
local.get $0
1687+
local.get $2
16861688
i32.const 1424
16871689
i32.ne
16881690
if
1689-
local.get $0
1691+
local.get $2
16901692
call $~lib/rt/pure/__release
16911693
end
16921694
i32.const 1424
1693-
local.set $0
1695+
local.set $2
16941696
end
1695-
local.get $0
1697+
local.get $2
16961698
i32.const 16
16971699
i32.sub
16981700
i32.load offset=12
@@ -1711,38 +1713,38 @@
17111713
i32.shl
17121714
local.tee $4
17131715
i32.add
1714-
local.tee $1
1716+
local.tee $5
17151717
i32.eqz
17161718
if
1717-
local.get $0
1719+
local.get $2
17181720
call $~lib/rt/pure/__release
17191721
i32.const 1344
17201722
br $__inlined_func$~lib/string/String#concat
17211723
end
17221724
call $~lib/rt/tlsf/maybeInitialize
1723-
local.get $1
1725+
local.get $5
17241726
i32.const 1
17251727
call $~lib/rt/tlsf/allocateBlock
17261728
i32.const 16
17271729
i32.add
17281730
call $~lib/rt/pure/__retain
1729-
local.tee $1
1731+
local.tee $5
17301732
local.get $3
17311733
local.get $4
17321734
call $~lib/memory/memory.copy
1733-
local.get $1
17341735
local.get $4
1736+
local.get $5
17351737
i32.add
1736-
local.get $0
1738+
local.get $2
17371739
local.get $6
17381740
call $~lib/memory/memory.copy
1739-
local.get $0
1741+
local.get $2
17401742
call $~lib/rt/pure/__release
1741-
local.get $1
1743+
local.get $5
17421744
end
1743-
local.get $2
1745+
local.get $0
17441746
call $~lib/rt/pure/__release
1745-
local.get $5
1747+
local.get $1
17461748
call $~lib/rt/pure/__release
17471749
)
17481750
(func $start:retain-release-sanity

tests/compiler/std/array.optimized.wat

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4570,10 +4570,10 @@
45704570
(local $4 i32)
45714571
(local $5 f32)
45724572
(local $6 f32)
4573-
local.get $1
4574-
call $~lib/rt/pure/__retain
4575-
local.set $3
45764573
block $folding-inner0
4574+
local.get $1
4575+
call $~lib/rt/pure/__retain
4576+
local.set $3
45774577
local.get $0
45784578
i32.load offset=12
45794579
local.tee $2
@@ -5102,10 +5102,10 @@
51025102
(local $4 i32)
51035103
(local $5 f64)
51045104
(local $6 f64)
5105-
local.get $1
5106-
call $~lib/rt/pure/__retain
5107-
local.set $3
51085105
block $folding-inner0
5106+
local.get $1
5107+
call $~lib/rt/pure/__retain
5108+
local.set $3
51095109
local.get $0
51105110
i32.load offset=12
51115111
local.tee $2
@@ -6822,29 +6822,31 @@
68226822
block $__inlined_func$~lib/string/String#concat (result i32)
68236823
local.get $0
68246824
call $~lib/rt/pure/__retain
6825-
local.tee $2
6825+
local.tee $0
68266826
i32.const 7984
6827-
local.get $2
6827+
local.get $0
68286828
select
68296829
local.set $3
68306830
local.get $1
68316831
call $~lib/rt/pure/__retain
6832-
local.tee $5
6832+
local.tee $1
6833+
local.set $2
6834+
local.get $2
68336835
call $~lib/rt/pure/__retain
6834-
local.tee $0
6836+
local.tee $2
68356837
i32.eqz
68366838
if
6837-
local.get $0
6839+
local.get $2
68386840
i32.const 7984
68396841
i32.ne
68406842
if
6841-
local.get $0
6843+
local.get $2
68426844
call $~lib/rt/pure/__release
68436845
end
68446846
i32.const 7984
6845-
local.set $0
6847+
local.set $2
68466848
end
6847-
local.get $0
6849+
local.get $2
68486850
i32.const 16
68496851
i32.sub
68506852
i32.load offset=12
@@ -6863,38 +6865,38 @@
68636865
i32.shl
68646866
local.tee $4
68656867
i32.add
6866-
local.tee $1
6868+
local.tee $5
68676869
i32.eqz
68686870
if
6869-
local.get $0
6871+
local.get $2
68706872
call $~lib/rt/pure/__release
68716873
i32.const 7840
68726874
br $__inlined_func$~lib/string/String#concat
68736875
end
68746876
call $~lib/rt/tlsf/maybeInitialize
6875-
local.get $1
6877+
local.get $5
68766878
i32.const 1
68776879
call $~lib/rt/tlsf/allocateBlock
68786880
i32.const 16
68796881
i32.add
68806882
call $~lib/rt/pure/__retain
6881-
local.tee $1
6883+
local.tee $5
68826884
local.get $3
68836885
local.get $4
68846886
call $~lib/memory/memory.copy
6885-
local.get $1
68866887
local.get $4
6888+
local.get $5
68876889
i32.add
6888-
local.get $0
6890+
local.get $2
68896891
local.get $6
68906892
call $~lib/memory/memory.copy
6891-
local.get $0
6893+
local.get $2
68926894
call $~lib/rt/pure/__release
6893-
local.get $1
6895+
local.get $5
68946896
end
6895-
local.get $2
6897+
local.get $0
68966898
call $~lib/rt/pure/__release
6897-
local.get $5
6899+
local.get $1
68986900
call $~lib/rt/pure/__release
68996901
)
69006902
(func $std/array/createRandomString (param $0 i32) (result i32)

0 commit comments

Comments
 (0)