Skip to content

Update Binaryen #2531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "110.0.0-nightly.20221006",
"binaryen": "110.0.0-nightly.20221018",
"long": "^5.2.0"
},
"devDependencies": {
Expand Down
8 changes: 6 additions & 2 deletions src/glue/binaryen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export declare function _BinaryenTypeStringviewWTF8(): TypeRef;
export declare function _BinaryenTypeStringviewWTF16(): TypeRef;
export declare function _BinaryenTypeStringviewIter(): TypeRef;

export declare function _BinaryenTypeNullref(): TypeRef;
export declare function _BinaryenTypeNullExternref(): TypeRef;
export declare function _BinaryenTypeNullFuncref(): TypeRef;

export declare function _BinaryenHeapTypeFunc(): HeapTypeRef;
export declare function _BinaryenHeapTypeExt(): HeapTypeRef;
export declare function _BinaryenHeapTypeAny(): HeapTypeRef;
Expand Down Expand Up @@ -594,7 +598,7 @@ export declare function _BinaryenStructSetSetValue(expr: ExpressionRef, valueExp
export declare function _BinaryenArrayNew(module: ModuleRef, type: HeapTypeRef, size: ExpressionRef, init: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayNewGetInit(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayNewSetInit(expr: ExpressionRef, initExpr: ExpressionRef): void;
export declare function _BinaryenArrayNewGetSize(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayNewGetSize(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayNewSetSize(expr: ExpressionRef, sizeExpr: ExpressionRef): void;

export declare function _BinaryenArrayInit(module: ModuleRef, type: HeapTypeRef, values: ArrayRef<ExpressionRef>, numValues: Index): ExpressionRef;
Expand All @@ -605,7 +609,7 @@ export declare function _BinaryenArrayInitAppendValue(expr: ExpressionRef, value
export declare function _BinaryenArrayInitInsertValueAt(expr: ExpressionRef, index: Index, valueExpr: ExpressionRef): void;
export declare function _BinaryenArrayInitRemoveValueAt(expr: ExpressionRef, index: Index): ExpressionRef;

export declare function _BinaryenArrayGet(module: ModuleRef, ref: ExpressionRef, index: ExpressionRef, signed: bool): ExpressionRef;
export declare function _BinaryenArrayGet(module: ModuleRef, ref: ExpressionRef, index: ExpressionRef, type: TypeRef, signed: bool): ExpressionRef;
export declare function _BinaryenArrayGetGetRef(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayGetSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
export declare function _BinaryenArrayGetGetIndex(expr: ExpressionRef): ExpressionRef;
Expand Down
4 changes: 4 additions & 0 deletions src/glue/binaryen.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const {
_BinaryenHeapTypeStringviewWTF16,
_BinaryenHeapTypeStringviewIter,

_BinaryenTypeNullref,
_BinaryenTypeNullExternref,
_BinaryenTypeNullFuncref,

_BinaryenModuleCreate,
_BinaryenModuleDispose,

Expand Down
13 changes: 1 addition & 12 deletions tests/compiler/class-overloading.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@
global.get $class-overloading/b2
local.tee $0
i32.store $0
block $__inlined_func$class-overloading/A2#foo@virtual (result i32)
block $__inlined_func$class-overloading/A2#foo@virtual
local.get $0
i32.const 8
i32.sub
Expand Down Expand Up @@ -2816,7 +2816,6 @@
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
i32.const 3
br $__inlined_func$class-overloading/A2#foo@virtual
end
i32.const 1744
Expand All @@ -2826,16 +2825,6 @@
call $~lib/builtins/abort
unreachable
end
i32.const 3
i32.ne
if
i32.const 0
i32.const 1552
i32.const 209
i32.const 1
call $~lib/builtins/abort
unreachable
end
global.get $~lib/memory/__stack_pointer
i32.const 8
i32.add
Expand Down
2 changes: 0 additions & 2 deletions tests/compiler/features/gc.debug.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(type $none_=>_none (func))
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(global $features/gc/a anyref (ref.null any))
(global $~lib/memory/__data_end i32 (i32.const 60))
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 16444))
(global $~lib/memory/__heap_base i32 (i32.const 16444))
Expand All @@ -11,7 +10,6 @@
(data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00g\00c\00.\00t\00s\00")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "a" (global $features/gc/a))
(export "memory" (memory $0))
(export "_start" (func $~start))
(func $features/gc/test_i31
Expand Down
2 changes: 0 additions & 2 deletions tests/compiler/features/gc.release.wat
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
(module
(type $none_=>_none (func))
(global $features/gc/a anyref (ref.null any))
(memory $0 1)
(data (i32.const 1036) ",")
(data (i32.const 1048) "\01\00\00\00\1c\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00g\00c\00.\00t\00s")
(export "a" (global $features/gc/a))
(export "memory" (memory $0))
(export "_start" (func $~start))
(func $~start
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/features/gc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ test_i31();

// constant globals

export const a: anyref = null;
// export const a: anyref = null;
// export const b: i31ref = null; // TODO: not yet nullable in Binaryen
// export const c: dataref = null; // TODO: not yet nullable in Binaryen
Loading