Skip to content

Commit

Permalink
Update Binaryen (AssemblyScript#2811)
Browse files Browse the repository at this point in the history
This version of binaryen.js has the requisite 4 GiB max memory change.
Fixes AssemblyScript#2810.
  • Loading branch information
CountBleck authored Jan 14, 2024
1 parent 1e0466e commit dc547a8
Show file tree
Hide file tree
Showing 115 changed files with 25,257 additions and 29,204 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"engineStrict": true,
"dependencies": {
"binaryen": "116.0.0-nightly.20231102",
"binaryen": "116.0.0-nightly.20240114",
"long": "^5.2.1"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/glue/binaryen.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const {
_BinaryenHeapTypeI31,
_BinaryenHeapTypeStruct,
_BinaryenHeapTypeArray,
// _BinaryenHeapTypeExn,
_BinaryenHeapTypeString,
_BinaryenHeapTypeStringviewWTF8,
_BinaryenHeapTypeStringviewWTF16,
Expand Down
97 changes: 52 additions & 45 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ export namespace HeapTypeRef {
export const I31: HeapTypeRef = 4 /* _BinaryenHeapTypeI31 */;
export const Struct: HeapTypeRef = 5 /* _BinaryenHeapTypeStruct */;
export const Array: HeapTypeRef = 6 /* _BinaryenHeapTypeArray */;
export const String: HeapTypeRef = 7 /* _BinaryenHeapTypeString */;
export const StringviewWTF8: HeapTypeRef = 8 /* _BinaryenHeapTypeStringviewWTF8 */;
export const StringviewWTF16: HeapTypeRef = 9 /* _BinaryenHeapTypeStringviewWTF16 */;
export const StringviewIter: HeapTypeRef = 10 /* _BinaryenHeapTypeStringviewIter */;
export const None: HeapTypeRef = 11 /* _BinaryenHeapTypeNone */;
export const Noextern: HeapTypeRef = 12 /* _BinaryenHeapTypeNoext */;
export const Nofunc: HeapTypeRef = 13 /* _BinaryenHeapTypeNofunc */;
export const Exn: HeapTypeRef = 7 /* TODO: BinaryenHeapTypeExn */;
export const String: HeapTypeRef = 8 /* _BinaryenHeapTypeString */;
export const StringviewWTF8: HeapTypeRef = 9 /* _BinaryenHeapTypeStringviewWTF8 */;
export const StringviewWTF16: HeapTypeRef = 10 /* _BinaryenHeapTypeStringviewWTF16 */;
export const StringviewIter: HeapTypeRef = 11 /* _BinaryenHeapTypeStringviewIter */;
export const None: HeapTypeRef = 12 /* _BinaryenHeapTypeNone */;
export const Noextern: HeapTypeRef = 13 /* _BinaryenHeapTypeNoext */;
export const Nofunc: HeapTypeRef = 14 /* _BinaryenHeapTypeNofunc */;

export function isBottom(ht: HeapTypeRef): bool {
return binaryen._BinaryenHeapTypeIsBottom(ht);
Expand Down Expand Up @@ -275,44 +276,50 @@ export const enum ExpressionId {
TableSet = 46 /* _BinaryenTableSetId */,
TableSize = 47 /* _BinaryenTableSizeId */,
TableGrow = 48 /* _BinaryenTableGrowId */,
Try = 50 /* _BinaryenTryId */,
Throw = 51 /* _BinaryenThrowId */,
Rethrow = 52 /* _BinaryenRethrowId */,
TupleMake = 53 /* _BinaryenTupleMakeId */,
TupleExtract = 54 /* _BinaryenTupleExtractId */,
RefI31 = 55 /* _BinaryenRefI31Id */,
I31Get = 56 /* _BinaryenI31GetId */,
CallRef = 57 /* _BinaryenCallRefId */,
RefTest = 58 /* _BinaryenRefTestId */,
RefCast = 59 /* _BinaryenRefCastId */,
BrOn = 60 /* _BinaryenBrOnId */,
StructNew = 61 /* _BinaryenStructNewId */,
StructGet = 62 /* _BinaryenStructGetId */,
StructSet = 63 /* _BinaryenStructSetId */,
ArrayNew = 64 /* _BinaryenArrayNewId */,
ArrayNewSeg = 64 /* TODO_BinaryenArraySegId */,
ArrayNewFixed = 67 /* _BinaryenArrayNewFixedId */,
ArrayGet = 68 /* _BinaryenArrayGetId */,
ArraySet = 69 /* _BinaryenArraySetId */,
ArrayLen = 70 /* _BinaryenArrayLenId */,
ArrayCopy = 71 /* _BinaryenArrayCopyId */,
ArrayFill = 72 /* _BinaryenArrayFillId */,
ArrayInitData = 73 /* _BinaryenArrayInitDataId */,
ArrayInitElem = 74 /* _BinaryenArrayInitElemId */,
RefAs = 75 /* _BinaryenRefAsId */,
StringNew = 76 /* _BinaryenStringNewId */,
StringConst = 77 /* _BinaryenStringConstId */,
StringMeasure = 78 /* _BinaryenStringMeasureId */,
StringEncode = 79 /* _BinaryenStringEncodeId */,
StringConcat = 80 /* _BinaryenStringConcatId */,
StringEq = 81 /* _BinaryenStringEqId */,
StringAs = 82 /* _BinaryenStringAsId */,
StringWTF8Advance = 83 /* _BinaryenStringWTF8AdvanceId */,
StringWTF16Get = 84 /* _BinaryenStringWTF16GetId */,
StringIterNext = 85 /* _BinaryenStringIterNextId */,
StringIterMove = 86 /* _BinaryenStringIterMoveId */,
StringSliceWTF = 87 /* _BinaryenStringSliceWTFId */,
StringSliceIter = 88 /* _BinaryenStringSliceIterId */
TableFill = 49 /* _BinaryenTableFillId */,
TableCopy = 50 /* _BinaryenTableCopyId */,
Try = 51 /* _BinaryenTryId */,
TryTable = 52 /* _BinaryenTryTableId */,
Throw = 53 /* _BinaryenThrowId */,
Rethrow = 54 /* _BinaryenRethrowId */,
ThrowRef = 55 /* _BinaryenThrowRefId */,
TupleMake = 56 /* _BinaryenTupleMakeId */,
TupleExtract = 57 /* _BinaryenTupleExtractId */,
RefI31 = 58 /* _BinaryenRefI31Id */,
I31Get = 59 /* _BinaryenI31GetId */,
CallRef = 60 /* _BinaryenCallRefId */,
RefTest = 61 /* _BinaryenRefTestId */,
RefCast = 62 /* _BinaryenRefCastId */,
BrOn = 63 /* _BinaryenBrOnId */,
StructNew = 64 /* _BinaryenStructNewId */,
StructGet = 65 /* _BinaryenStructGetId */,
StructSet = 66 /* _BinaryenStructSetId */,
ArrayNew = 67 /* _BinaryenArrayNewId */,
ArrayNewData = 68 /* _BinaryenArrayNewDataId */,
ArrayNewElem = 69 /* _BinaryenArrayNewElemId */,
ArrayNewFixed = 70 /* _BinaryenArrayNewFixedId */,
ArrayGet = 71 /* _BinaryenArrayGetId */,
ArraySet = 72 /* _BinaryenArraySetId */,
ArrayLen = 73 /* _BinaryenArrayLenId */,
ArrayCopy = 74 /* _BinaryenArrayCopyId */,
ArrayFill = 75 /* _BinaryenArrayFillId */,
ArrayInitData = 76 /* _BinaryenArrayInitDataId */,
ArrayInitElem = 77 /* _BinaryenArrayInitElemId */,
RefAs = 78 /* _BinaryenRefAsId */,
StringNew = 79 /* _BinaryenStringNewId */,
StringConst = 80 /* _BinaryenStringConstId */,
StringMeasure = 81 /* _BinaryenStringMeasureId */,
StringEncode = 82 /* _BinaryenStringEncodeId */,
StringConcat = 83 /* _BinaryenStringConcatId */,
StringEq = 84 /* _BinaryenStringEqId */,
StringAs = 85 /* _BinaryenStringAsId */,
StringWTF8Advance = 86 /* _BinaryenStringWTF8AdvanceId */,
StringWTF16Get = 87 /* _BinaryenStringWTF16GetId */,
StringIterNext = 88 /* _BinaryenStringIterNextId */,
StringIterMove = 89 /* _BinaryenStringIterMoveId */,
StringSliceWTF = 90 /* _BinaryenStringSliceWTFId */,
StringSliceIter = 91 /* _BinaryenStringSliceIterId */,
ResumeId = 92 /* _BinaryenResumeId */
}

/** Binaryen external kind constants. */
Expand Down
40 changes: 14 additions & 26 deletions tests/compiler/NonNullable.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
(export "memory" (memory $0))
(start $~start)
(func $~start
(local $0 i32)
global.get $~lib/memory/__stack_pointer
i32.const 12
i32.sub
Expand All @@ -32,16 +31,15 @@
i32.lt_s
br_if $folding-inner0
global.get $~lib/memory/__stack_pointer
local.tee $0
i64.const 0
i64.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 0
i32.store offset=8
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1056
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1056
i32.store offset=4
i32.const 1056
Expand All @@ -57,10 +55,9 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $0
i32.const 1136
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1136
i32.store offset=4
i32.const 1136
Expand All @@ -76,10 +73,9 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $0
i32.const 1168
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1168
i32.store offset=4
i32.const 1168
Expand All @@ -95,10 +91,9 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $0
i32.const 1248
i32.store offset=8
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1248
i32.store
call $NonNullable/assertNonNull<~lib/string/String>
Expand All @@ -114,10 +109,9 @@
i32.lt_s
br_if $folding-inner0
global.get $~lib/memory/__stack_pointer
local.tee $0
i32.const 0
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1248
i32.store
call $~lib/string/String.__ne
Expand Down Expand Up @@ -165,14 +159,13 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $2
i64.const 0
i64.store
local.get $0
local.get $1
i32.eq
if
local.get $2
global.get $~lib/memory/__stack_pointer
i32.const 8
i32.add
global.set $~lib/memory/__stack_pointer
Expand All @@ -187,8 +180,6 @@
i32.or
br_if $folding-inner0
global.get $~lib/memory/__stack_pointer
local.tee $4
local.tee $2
local.get $0
i32.store
local.get $0
Expand All @@ -198,7 +189,7 @@
i32.const 1
i32.shr_u
local.set $3
local.get $2
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $3
Expand All @@ -210,12 +201,12 @@
i32.shr_u
i32.ne
br_if $folding-inner0
local.get $4
global.get $~lib/memory/__stack_pointer
local.get $0
i32.store
local.get $0
local.set $2
local.get $4
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store offset=4
local.get $3
Expand Down Expand Up @@ -327,13 +318,12 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $0
i64.const 0
i64.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1248
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 0
i32.store offset=4
i32.const 1248
Expand All @@ -348,7 +338,6 @@
local.get $0
)
(func $NonNullable/assertNonNull<~lib/string/String>
(local $0 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
Expand All @@ -365,10 +354,9 @@
unreachable
end
global.get $~lib/memory/__stack_pointer
local.tee $0
i32.const 0
i32.store
local.get $0
global.get $~lib/memory/__stack_pointer
i32.const 1248
i32.store
call $~lib/string/String.__ne
Expand Down
Loading

0 comments on commit dc547a8

Please sign in to comment.