Skip to content

Commit dc547a8

Browse files
authored
Update Binaryen (#2811)
This version of binaryen.js has the requisite 4 GiB max memory change. Fixes #2810.
1 parent 1e0466e commit dc547a8

File tree

115 files changed

+25257
-29204
lines changed

Some content is hidden

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

115 files changed

+25257
-29204
lines changed

Diff for: package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"engineStrict": true,
2727
"dependencies": {
28-
"binaryen": "116.0.0-nightly.20231102",
28+
"binaryen": "116.0.0-nightly.20240114",
2929
"long": "^5.2.1"
3030
},
3131
"devDependencies": {

Diff for: src/glue/binaryen.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const {
3535
_BinaryenHeapTypeI31,
3636
_BinaryenHeapTypeStruct,
3737
_BinaryenHeapTypeArray,
38+
// _BinaryenHeapTypeExn,
3839
_BinaryenHeapTypeString,
3940
_BinaryenHeapTypeStringviewWTF8,
4041
_BinaryenHeapTypeStringviewWTF16,

Diff for: src/module.ts

+52-45
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ export namespace HeapTypeRef {
109109
export const I31: HeapTypeRef = 4 /* _BinaryenHeapTypeI31 */;
110110
export const Struct: HeapTypeRef = 5 /* _BinaryenHeapTypeStruct */;
111111
export const Array: HeapTypeRef = 6 /* _BinaryenHeapTypeArray */;
112-
export const String: HeapTypeRef = 7 /* _BinaryenHeapTypeString */;
113-
export const StringviewWTF8: HeapTypeRef = 8 /* _BinaryenHeapTypeStringviewWTF8 */;
114-
export const StringviewWTF16: HeapTypeRef = 9 /* _BinaryenHeapTypeStringviewWTF16 */;
115-
export const StringviewIter: HeapTypeRef = 10 /* _BinaryenHeapTypeStringviewIter */;
116-
export const None: HeapTypeRef = 11 /* _BinaryenHeapTypeNone */;
117-
export const Noextern: HeapTypeRef = 12 /* _BinaryenHeapTypeNoext */;
118-
export const Nofunc: HeapTypeRef = 13 /* _BinaryenHeapTypeNofunc */;
112+
export const Exn: HeapTypeRef = 7 /* TODO: BinaryenHeapTypeExn */;
113+
export const String: HeapTypeRef = 8 /* _BinaryenHeapTypeString */;
114+
export const StringviewWTF8: HeapTypeRef = 9 /* _BinaryenHeapTypeStringviewWTF8 */;
115+
export const StringviewWTF16: HeapTypeRef = 10 /* _BinaryenHeapTypeStringviewWTF16 */;
116+
export const StringviewIter: HeapTypeRef = 11 /* _BinaryenHeapTypeStringviewIter */;
117+
export const None: HeapTypeRef = 12 /* _BinaryenHeapTypeNone */;
118+
export const Noextern: HeapTypeRef = 13 /* _BinaryenHeapTypeNoext */;
119+
export const Nofunc: HeapTypeRef = 14 /* _BinaryenHeapTypeNofunc */;
119120

120121
export function isBottom(ht: HeapTypeRef): bool {
121122
return binaryen._BinaryenHeapTypeIsBottom(ht);
@@ -275,44 +276,50 @@ export const enum ExpressionId {
275276
TableSet = 46 /* _BinaryenTableSetId */,
276277
TableSize = 47 /* _BinaryenTableSizeId */,
277278
TableGrow = 48 /* _BinaryenTableGrowId */,
278-
Try = 50 /* _BinaryenTryId */,
279-
Throw = 51 /* _BinaryenThrowId */,
280-
Rethrow = 52 /* _BinaryenRethrowId */,
281-
TupleMake = 53 /* _BinaryenTupleMakeId */,
282-
TupleExtract = 54 /* _BinaryenTupleExtractId */,
283-
RefI31 = 55 /* _BinaryenRefI31Id */,
284-
I31Get = 56 /* _BinaryenI31GetId */,
285-
CallRef = 57 /* _BinaryenCallRefId */,
286-
RefTest = 58 /* _BinaryenRefTestId */,
287-
RefCast = 59 /* _BinaryenRefCastId */,
288-
BrOn = 60 /* _BinaryenBrOnId */,
289-
StructNew = 61 /* _BinaryenStructNewId */,
290-
StructGet = 62 /* _BinaryenStructGetId */,
291-
StructSet = 63 /* _BinaryenStructSetId */,
292-
ArrayNew = 64 /* _BinaryenArrayNewId */,
293-
ArrayNewSeg = 64 /* TODO_BinaryenArraySegId */,
294-
ArrayNewFixed = 67 /* _BinaryenArrayNewFixedId */,
295-
ArrayGet = 68 /* _BinaryenArrayGetId */,
296-
ArraySet = 69 /* _BinaryenArraySetId */,
297-
ArrayLen = 70 /* _BinaryenArrayLenId */,
298-
ArrayCopy = 71 /* _BinaryenArrayCopyId */,
299-
ArrayFill = 72 /* _BinaryenArrayFillId */,
300-
ArrayInitData = 73 /* _BinaryenArrayInitDataId */,
301-
ArrayInitElem = 74 /* _BinaryenArrayInitElemId */,
302-
RefAs = 75 /* _BinaryenRefAsId */,
303-
StringNew = 76 /* _BinaryenStringNewId */,
304-
StringConst = 77 /* _BinaryenStringConstId */,
305-
StringMeasure = 78 /* _BinaryenStringMeasureId */,
306-
StringEncode = 79 /* _BinaryenStringEncodeId */,
307-
StringConcat = 80 /* _BinaryenStringConcatId */,
308-
StringEq = 81 /* _BinaryenStringEqId */,
309-
StringAs = 82 /* _BinaryenStringAsId */,
310-
StringWTF8Advance = 83 /* _BinaryenStringWTF8AdvanceId */,
311-
StringWTF16Get = 84 /* _BinaryenStringWTF16GetId */,
312-
StringIterNext = 85 /* _BinaryenStringIterNextId */,
313-
StringIterMove = 86 /* _BinaryenStringIterMoveId */,
314-
StringSliceWTF = 87 /* _BinaryenStringSliceWTFId */,
315-
StringSliceIter = 88 /* _BinaryenStringSliceIterId */
279+
TableFill = 49 /* _BinaryenTableFillId */,
280+
TableCopy = 50 /* _BinaryenTableCopyId */,
281+
Try = 51 /* _BinaryenTryId */,
282+
TryTable = 52 /* _BinaryenTryTableId */,
283+
Throw = 53 /* _BinaryenThrowId */,
284+
Rethrow = 54 /* _BinaryenRethrowId */,
285+
ThrowRef = 55 /* _BinaryenThrowRefId */,
286+
TupleMake = 56 /* _BinaryenTupleMakeId */,
287+
TupleExtract = 57 /* _BinaryenTupleExtractId */,
288+
RefI31 = 58 /* _BinaryenRefI31Id */,
289+
I31Get = 59 /* _BinaryenI31GetId */,
290+
CallRef = 60 /* _BinaryenCallRefId */,
291+
RefTest = 61 /* _BinaryenRefTestId */,
292+
RefCast = 62 /* _BinaryenRefCastId */,
293+
BrOn = 63 /* _BinaryenBrOnId */,
294+
StructNew = 64 /* _BinaryenStructNewId */,
295+
StructGet = 65 /* _BinaryenStructGetId */,
296+
StructSet = 66 /* _BinaryenStructSetId */,
297+
ArrayNew = 67 /* _BinaryenArrayNewId */,
298+
ArrayNewData = 68 /* _BinaryenArrayNewDataId */,
299+
ArrayNewElem = 69 /* _BinaryenArrayNewElemId */,
300+
ArrayNewFixed = 70 /* _BinaryenArrayNewFixedId */,
301+
ArrayGet = 71 /* _BinaryenArrayGetId */,
302+
ArraySet = 72 /* _BinaryenArraySetId */,
303+
ArrayLen = 73 /* _BinaryenArrayLenId */,
304+
ArrayCopy = 74 /* _BinaryenArrayCopyId */,
305+
ArrayFill = 75 /* _BinaryenArrayFillId */,
306+
ArrayInitData = 76 /* _BinaryenArrayInitDataId */,
307+
ArrayInitElem = 77 /* _BinaryenArrayInitElemId */,
308+
RefAs = 78 /* _BinaryenRefAsId */,
309+
StringNew = 79 /* _BinaryenStringNewId */,
310+
StringConst = 80 /* _BinaryenStringConstId */,
311+
StringMeasure = 81 /* _BinaryenStringMeasureId */,
312+
StringEncode = 82 /* _BinaryenStringEncodeId */,
313+
StringConcat = 83 /* _BinaryenStringConcatId */,
314+
StringEq = 84 /* _BinaryenStringEqId */,
315+
StringAs = 85 /* _BinaryenStringAsId */,
316+
StringWTF8Advance = 86 /* _BinaryenStringWTF8AdvanceId */,
317+
StringWTF16Get = 87 /* _BinaryenStringWTF16GetId */,
318+
StringIterNext = 88 /* _BinaryenStringIterNextId */,
319+
StringIterMove = 89 /* _BinaryenStringIterMoveId */,
320+
StringSliceWTF = 90 /* _BinaryenStringSliceWTFId */,
321+
StringSliceIter = 91 /* _BinaryenStringSliceIterId */,
322+
ResumeId = 92 /* _BinaryenResumeId */
316323
}
317324

318325
/** Binaryen external kind constants. */

Diff for: tests/compiler/NonNullable.release.wat

+14-26
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
(export "memory" (memory $0))
2222
(start $~start)
2323
(func $~start
24-
(local $0 i32)
2524
global.get $~lib/memory/__stack_pointer
2625
i32.const 12
2726
i32.sub
@@ -32,16 +31,15 @@
3231
i32.lt_s
3332
br_if $folding-inner0
3433
global.get $~lib/memory/__stack_pointer
35-
local.tee $0
3634
i64.const 0
3735
i64.store
38-
local.get $0
36+
global.get $~lib/memory/__stack_pointer
3937
i32.const 0
4038
i32.store offset=8
41-
local.get $0
39+
global.get $~lib/memory/__stack_pointer
4240
i32.const 1056
4341
i32.store
44-
local.get $0
42+
global.get $~lib/memory/__stack_pointer
4543
i32.const 1056
4644
i32.store offset=4
4745
i32.const 1056
@@ -57,10 +55,9 @@
5755
unreachable
5856
end
5957
global.get $~lib/memory/__stack_pointer
60-
local.tee $0
6158
i32.const 1136
6259
i32.store
63-
local.get $0
60+
global.get $~lib/memory/__stack_pointer
6461
i32.const 1136
6562
i32.store offset=4
6663
i32.const 1136
@@ -76,10 +73,9 @@
7673
unreachable
7774
end
7875
global.get $~lib/memory/__stack_pointer
79-
local.tee $0
8076
i32.const 1168
8177
i32.store
82-
local.get $0
78+
global.get $~lib/memory/__stack_pointer
8379
i32.const 1168
8480
i32.store offset=4
8581
i32.const 1168
@@ -95,10 +91,9 @@
9591
unreachable
9692
end
9793
global.get $~lib/memory/__stack_pointer
98-
local.tee $0
9994
i32.const 1248
10095
i32.store offset=8
101-
local.get $0
96+
global.get $~lib/memory/__stack_pointer
10297
i32.const 1248
10398
i32.store
10499
call $NonNullable/assertNonNull<~lib/string/String>
@@ -114,10 +109,9 @@
114109
i32.lt_s
115110
br_if $folding-inner0
116111
global.get $~lib/memory/__stack_pointer
117-
local.tee $0
118112
i32.const 0
119113
i32.store
120-
local.get $0
114+
global.get $~lib/memory/__stack_pointer
121115
i32.const 1248
122116
i32.store
123117
call $~lib/string/String.__ne
@@ -165,14 +159,13 @@
165159
unreachable
166160
end
167161
global.get $~lib/memory/__stack_pointer
168-
local.tee $2
169162
i64.const 0
170163
i64.store
171164
local.get $0
172165
local.get $1
173166
i32.eq
174167
if
175-
local.get $2
168+
global.get $~lib/memory/__stack_pointer
176169
i32.const 8
177170
i32.add
178171
global.set $~lib/memory/__stack_pointer
@@ -187,8 +180,6 @@
187180
i32.or
188181
br_if $folding-inner0
189182
global.get $~lib/memory/__stack_pointer
190-
local.tee $4
191-
local.tee $2
192183
local.get $0
193184
i32.store
194185
local.get $0
@@ -198,7 +189,7 @@
198189
i32.const 1
199190
i32.shr_u
200191
local.set $3
201-
local.get $2
192+
global.get $~lib/memory/__stack_pointer
202193
local.get $1
203194
i32.store
204195
local.get $3
@@ -210,12 +201,12 @@
210201
i32.shr_u
211202
i32.ne
212203
br_if $folding-inner0
213-
local.get $4
204+
global.get $~lib/memory/__stack_pointer
214205
local.get $0
215206
i32.store
216207
local.get $0
217208
local.set $2
218-
local.get $4
209+
global.get $~lib/memory/__stack_pointer
219210
local.get $1
220211
i32.store offset=4
221212
local.get $3
@@ -327,13 +318,12 @@
327318
unreachable
328319
end
329320
global.get $~lib/memory/__stack_pointer
330-
local.tee $0
331321
i64.const 0
332322
i64.store
333-
local.get $0
323+
global.get $~lib/memory/__stack_pointer
334324
i32.const 1248
335325
i32.store
336-
local.get $0
326+
global.get $~lib/memory/__stack_pointer
337327
i32.const 0
338328
i32.store offset=4
339329
i32.const 1248
@@ -348,7 +338,6 @@
348338
local.get $0
349339
)
350340
(func $NonNullable/assertNonNull<~lib/string/String>
351-
(local $0 i32)
352341
global.get $~lib/memory/__stack_pointer
353342
i32.const 4
354343
i32.sub
@@ -365,10 +354,9 @@
365354
unreachable
366355
end
367356
global.get $~lib/memory/__stack_pointer
368-
local.tee $0
369357
i32.const 0
370358
i32.store
371-
local.get $0
359+
global.get $~lib/memory/__stack_pointer
372360
i32.const 1248
373361
i32.store
374362
call $~lib/string/String.__ne

0 commit comments

Comments
 (0)