Skip to content

Commit d97ccac

Browse files
authored
1 parent 9af14b8 commit d97ccac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+440
-1895
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@protobufjs/utf8": "^1.1.0",
15-
"binaryen": "89.0.0-nightly.20190909",
15+
"binaryen": "89.0.0-nightly.20190914",
1616
"glob": "^7.1.4",
1717
"long": "^4.0.0",
1818
"opencollective-postinstall": "^2.0.0",

src/glue/binaryen.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ declare function _BinaryenNotVec128(): BinaryenSIMDOp;
322322
declare function _BinaryenAndVec128(): BinaryenSIMDOp;
323323
declare function _BinaryenOrVec128(): BinaryenSIMDOp;
324324
declare function _BinaryenXorVec128(): BinaryenSIMDOp;
325+
declare function _BinaryenBitselectVec128(): BinaryenSIMDOp;
325326
declare function _BinaryenNegVecI8x16(): BinaryenSIMDOp;
326327
declare function _BinaryenAnyTrueVecI8x16(): BinaryenSIMDOp;
327328
declare function _BinaryenAllTrueVecI8x16(): BinaryenSIMDOp;
@@ -395,7 +396,6 @@ declare function _BinaryenConvertSVecI32x4ToVecF32x4(): BinaryenSIMDOp;
395396
declare function _BinaryenConvertUVecI32x4ToVecF32x4(): BinaryenSIMDOp;
396397
declare function _BinaryenConvertSVecI64x2ToVecF64x2(): BinaryenSIMDOp;
397398
declare function _BinaryenConvertUVecI64x2ToVecF64x2(): BinaryenSIMDOp;
398-
declare function _BinaryenBitselect(): BinaryenSIMDOp;
399399

400400
declare type BinaryenExpressionRef = usize;
401401

src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export enum SIMDShiftOp {
400400
}
401401

402402
export enum SIMDTernaryOp {
403-
Bitselect = 0, // FIXME: _BinaryenBitselect(), requires https://github.com/WebAssembly/binaryen/pull/2336
403+
Bitselect = _BinaryenBitselectVec128(),
404404
QFMAF32x4 = _BinaryenQFMAVecF32x4(),
405405
QFMSF32x4 = _BinaryenQFMSVecF32x4(),
406406
QFMAF64x2 = _BinaryenQFMAVecF64x2(),

tests/compiler/abi.optimized.wat

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
(module
22
(type $FUNCSIG$i (func (result i32)))
3-
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
43
(type $FUNCSIG$v (func))
5-
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
64
(memory $0 1)
75
(data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
86
(global $abi/condition (mut i32) (i32.const 0))
@@ -12,25 +10,16 @@
1210
(export "exportedExported" (func $abi/exported))
1311
(export "exportedInternal" (func $abi/exported))
1412
(start $start)
15-
(func $abi/exported (; 1 ;) (type $FUNCSIG$i) (result i32)
13+
(func $abi/exported (; 0 ;) (type $FUNCSIG$i) (result i32)
1614
i32.const -128
1715
)
18-
(func $start (; 2 ;) (type $FUNCSIG$v)
16+
(func $start (; 1 ;) (type $FUNCSIG$v)
1917
i32.const 1
2018
global.set $abi/condition
2119
i32.const 0
2220
global.set $abi/y
23-
global.get $abi/y
24-
if
25-
i32.const 0
26-
i32.const 24
27-
i32.const 65
28-
i32.const 2
29-
call $~lib/builtins/abort
30-
unreachable
31-
end
3221
)
33-
(func $null (; 3 ;) (type $FUNCSIG$v)
22+
(func $null (; 2 ;) (type $FUNCSIG$v)
3423
nop
3524
)
3625
)

tests/compiler/bool.optimized.wat

Lines changed: 4 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,16 @@
11
(module
2-
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
32
(type $FUNCSIG$v (func))
4-
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
53
(memory $0 1)
64
(data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s")
75
(export "memory" (memory $0))
86
(start $start)
9-
(func $start:bool (; 1 ;) (type $FUNCSIG$v)
10-
i32.const 2
11-
i32.const 0
12-
i32.ne
13-
i32.const 1
14-
i32.ne
15-
if
16-
i32.const 0
17-
i32.const 24
18-
i32.const 2
19-
i32.const 0
20-
call $~lib/builtins/abort
21-
unreachable
22-
end
23-
i64.const 2
24-
i64.const 0
25-
i64.ne
26-
i32.const 1
27-
i32.ne
28-
if
29-
i32.const 0
30-
i32.const 24
31-
i32.const 4
32-
i32.const 0
33-
call $~lib/builtins/abort
34-
unreachable
35-
end
36-
i32.const 2
37-
i32.const 0
38-
i32.ne
39-
i32.const 1
40-
i32.ne
41-
if
42-
i32.const 0
43-
i32.const 24
44-
i32.const 6
45-
i32.const 0
46-
call $~lib/builtins/abort
47-
unreachable
48-
end
49-
i64.const 2
50-
i64.const 0
51-
i64.ne
52-
i32.const 1
53-
i32.ne
54-
if
55-
i32.const 0
56-
i32.const 24
57-
i32.const 8
58-
i32.const 0
59-
call $~lib/builtins/abort
60-
unreachable
61-
end
62-
f32.const 2
63-
f32.const 0
64-
f32.ne
65-
i32.const 1
66-
i32.ne
67-
if
68-
i32.const 0
69-
i32.const 24
70-
i32.const 10
71-
i32.const 0
72-
call $~lib/builtins/abort
73-
unreachable
74-
end
75-
f64.const 2
76-
f64.const 0
77-
f64.ne
78-
i32.const 1
79-
i32.ne
80-
if
81-
i32.const 0
82-
i32.const 24
83-
i32.const 12
84-
i32.const 0
85-
call $~lib/builtins/abort
86-
unreachable
87-
end
88-
i32.const 2
89-
i32.const 0
90-
i32.ne
91-
i32.const 1
92-
i32.ne
93-
if
94-
i32.const 0
95-
i32.const 24
96-
i32.const 14
97-
i32.const 0
98-
call $~lib/builtins/abort
99-
unreachable
100-
end
7+
(func $start:bool (; 0 ;) (type $FUNCSIG$v)
8+
nop
1019
)
102-
(func $start (; 2 ;) (type $FUNCSIG$v)
10+
(func $start (; 1 ;) (type $FUNCSIG$v)
10311
call $start:bool
10412
)
105-
(func $null (; 3 ;) (type $FUNCSIG$v)
13+
(func $null (; 2 ;) (type $FUNCSIG$v)
10614
nop
10715
)
10816
)

tests/compiler/builtins.optimized.wat

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -166,43 +166,10 @@
166166
global.set $builtins/i
167167
i32.const 42
168168
global.set $builtins/i
169-
global.get $builtins/i
170-
i32.const 42
171-
i32.ne
172-
if
173-
i32.const 0
174-
i32.const 64
175-
i32.const 67
176-
i32.const 19
177-
call $~lib/builtins/abort
178-
unreachable
179-
end
180169
i32.const 2
181170
global.set $builtins/i
182-
global.get $builtins/i
183-
i32.const 2
184-
i32.ne
185-
if
186-
i32.const 0
187-
i32.const 64
188-
i32.const 68
189-
i32.const 20
190-
call $~lib/builtins/abort
191-
unreachable
192-
end
193171
i32.const 1
194172
global.set $builtins/i
195-
global.get $builtins/i
196-
i32.const 1
197-
i32.ne
198-
if
199-
i32.const 0
200-
i32.const 64
201-
i32.const 69
202-
i32.const 20
203-
call $~lib/builtins/abort
204-
unreachable
205-
end
206173
i64.const 63
207174
global.set $builtins/I
208175
i64.const 0
@@ -215,30 +182,8 @@
215182
global.set $builtins/I
216183
i64.const 42
217184
global.set $builtins/I
218-
global.get $builtins/I
219-
i64.const 42
220-
i64.ne
221-
if
222-
i32.const 0
223-
i32.const 64
224-
i32.const 85
225-
i32.const 19
226-
call $~lib/builtins/abort
227-
unreachable
228-
end
229185
i64.const 2
230186
global.set $builtins/I
231-
global.get $builtins/I
232-
i64.const 2
233-
i64.ne
234-
if
235-
i32.const 0
236-
i32.const 64
237-
i32.const 86
238-
i32.const 20
239-
call $~lib/builtins/abort
240-
unreachable
241-
end
242187
i64.const 1
243188
global.set $builtins/I
244189
global.get $builtins/i
@@ -626,11 +571,6 @@
626571
global.set $builtins/f
627572
f64.const 25
628573
global.set $builtins/F
629-
global.get $builtins/i
630-
i32.eqz
631-
if
632-
unreachable
633-
end
634574
i32.const 1
635575
i32.const 2
636576
call $start:builtins~anonymous|0

tests/compiler/call-super.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
(func $start (; 14 ;) (type $FUNCSIG$v)
423423
i32.const 64
424424
global.set $~lib/rt/stub/startOffset
425-
global.get $~lib/rt/stub/startOffset
425+
i32.const 64
426426
global.set $~lib/rt/stub/offset
427427
call $call-super/test1
428428
call $call-super/test2

tests/compiler/comma.optimized.wat

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@
6767
end
6868
i32.const 0
6969
global.set $comma/b
70-
global.get $comma/b
70+
i32.const 0
7171
global.set $comma/a
72-
global.get $comma/a
7372
i32.const 1
74-
i32.add
7573
global.set $comma/a
7674
global.get $comma/a
7775
global.set $comma/b
@@ -130,11 +128,10 @@
130128
i32.const 0
131129
local.set $0
132130
loop $loop|0
133-
block $break|0
134-
local.get $0
135-
global.get $comma/a
136-
i32.ge_s
137-
br_if $break|0
131+
local.get $0
132+
global.get $comma/a
133+
i32.lt_s
134+
if
138135
global.get $comma/a
139136
i32.const 1
140137
i32.sub

tests/compiler/constructor.optimized.wat

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
(local $0 i32)
109109
i32.const 16
110110
global.set $~lib/rt/stub/startOffset
111-
global.get $~lib/rt/stub/startOffset
111+
i32.const 16
112112
global.set $~lib/rt/stub/offset
113113
i32.const 0
114114
i32.const 3
@@ -152,37 +152,23 @@
152152
global.set $constructor/justFieldNoInit
153153
i32.const 0
154154
global.set $constructor/ctorReturns
155-
i32.const 1
156-
if (result i32)
157-
i32.const 0
158-
else
159-
i32.const 0
160-
i32.const 10
161-
call $~lib/rt/stub/__alloc
162-
end
155+
i32.const 0
163156
global.set $constructor/ctorConditionallyReturns
164157
i32.const 0
165158
i32.const 11
166159
call $~lib/rt/stub/__alloc
167160
global.set $constructor/ctorAllocates
168161
i32.const 0
169-
local.set $0
170-
i32.const 1
171-
if
172-
i32.const 0
173-
i32.const 12
174-
call $~lib/rt/stub/__alloc
175-
local.set $0
176-
end
177-
local.get $0
178-
i32.eqz
179-
if
162+
i32.const 12
163+
call $~lib/rt/stub/__alloc
164+
local.tee $0
165+
if (result i32)
166+
local.get $0
167+
else
180168
i32.const 0
181169
i32.const 12
182170
call $~lib/rt/stub/__alloc
183-
local.set $0
184171
end
185-
local.get $0
186172
global.set $constructor/ctorConditionallyAllocates
187173
)
188174
(func $start (; 3 ;) (type $FUNCSIG$v)

tests/compiler/exports.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
(func $start (; 8 ;) (type $FUNCSIG$v)
145145
i32.const 16
146146
global.set $~lib/rt/stub/startOffset
147-
global.get $~lib/rt/stub/startOffset
147+
i32.const 16
148148
global.set $~lib/rt/stub/offset
149149
)
150150
(func $null (; 9 ;) (type $FUNCSIG$v)

0 commit comments

Comments
 (0)