Skip to content

Commit bdfe551

Browse files
authored
Update binaryen (#2385)
1 parent c6b4e84 commit bdfe551

File tree

97 files changed

+8842
-8177
lines changed

Some content is hidden

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

97 files changed

+8842
-8177
lines changed

package-lock.json

Lines changed: 7 additions & 7 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
@@ -25,7 +25,7 @@
2525
},
2626
"engineStrict": true,
2727
"dependencies": {
28-
"binaryen": "108.0.0-nightly.20220528",
28+
"binaryen": "109.0.0-nightly.20220813",
2929
"long": "^5.2.0"
3030
},
3131
"devDependencies": {

scripts/update-constants.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const srcfile = path.join(__dirname, "..", "src", "module.ts");
1111
var src = fs.readFileSync(srcfile, "utf8")
1212
.replace(/(?:enum|namespace) (\w+) \{([^}]*)\}/g, function($0) {
1313
return $0.replace(/(\w+)[ ]+=[ ]+([^,;\n]+)/g, function($0, key, val) {
14+
// ignore values which have runtime assignments
15+
if (val.startsWith("binaryen.")) {
16+
return $0;
17+
}
1418
var match = val.match(/\b(_(?:Binaryen|Relooper|ExpressionRunner)\w+)\b/);
1519
if (match) {
1620
let fn = match[1];

src/glue/binaryen.d.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99
*/
1010
module "binaryen";
1111

12+
type Ref = usize;
13+
1214
export type Index = u32;
1315
export type ExpressionId = i32;
1416
export type FeatureFlags = u32;
1517
export type Op = i32;
1618
export type ExternalKind = u32;
1719
export type SideEffects = u32;
1820
export type ExpressionRunnerFlags = u32;
19-
type Ref = usize;
21+
2022
export type StringRef = Ref;
2123
export type ArrayRef<T> = Ref;
2224
export type TypeRef = Ref;
25+
export type HeapTypeRef = Ref;
2326
export type ModuleRef = Ref;
2427
export type LiteralRef = Ref;
2528
export type ExpressionRef = Ref;
@@ -33,10 +36,35 @@ export type ElementSegmentRef = Ref;
3336
export type RelooperRef = Ref;
3437
export type RelooperBlockRef = Ref;
3538
export type ExpressionRunnerRef = Ref;
39+
export type BinaryenModuleAllocateAndWriteResultRef = Ref;
3640

3741
export declare function _BinaryenTypeCreate(types: ArrayRef<TypeRef>, numTypes: u32): TypeRef;
3842
export declare function _BinaryenTypeArity(type: TypeRef): u32;
3943
export declare function _BinaryenTypeExpand(type: TypeRef, typesOut: ArrayRef<TypeRef>): void;
44+
export declare function _BinaryenTypeGetHeapType(type: TypeRef): HeapTypeRef;
45+
export declare function _BinaryenTypeFromHeapType(heapType: HeapTypeRef, nullable: bool): TypeRef;
46+
export declare function _BinaryenTypeIsNullable(type: TypeRef): bool;
47+
48+
export declare function _BinaryenTypeFuncref(): TypeRef;
49+
export declare function _BinaryenTypeExternref(): TypeRef;
50+
export declare function _BinaryenTypeAnyref(): TypeRef;
51+
export declare function _BinaryenTypeEqref(): TypeRef;
52+
export declare function _BinaryenTypeI31ref(): TypeRef;
53+
export declare function _BinaryenTypeDataref(): TypeRef;
54+
export declare function _BinaryenTypeStringref(): TypeRef;
55+
export declare function _BinaryenTypeStringviewWTF8(): TypeRef;
56+
export declare function _BinaryenTypeStringviewWTF16(): TypeRef;
57+
export declare function _BinaryenTypeStringviewIter(): TypeRef;
58+
59+
export declare function _BinaryenHeapTypeFunc(): HeapTypeRef;
60+
export declare function _BinaryenHeapTypeAny(): HeapTypeRef;
61+
export declare function _BinaryenHeapTypeEq(): HeapTypeRef;
62+
export declare function _BinaryenHeapTypeI31(): HeapTypeRef;
63+
export declare function _BinaryenHeapTypeData(): HeapTypeRef;
64+
export declare function _BinaryenHeapTypeString(): HeapTypeRef;
65+
export declare function _BinaryenHeapTypeStringviewWTF8(): HeapTypeRef;
66+
export declare function _BinaryenHeapTypeStringviewWTF16(): HeapTypeRef;
67+
export declare function _BinaryenHeapTypeStringviewIter(): HeapTypeRef;
4068

4169
export declare function _BinaryenModuleCreate(): ModuleRef;
4270
export declare function _BinaryenModuleDispose(module: ModuleRef): void;
@@ -594,7 +622,10 @@ export declare function _BinaryenModuleValidate(module: ModuleRef): i32;
594622
export declare function _BinaryenModuleOptimize(module: ModuleRef): void;
595623
export declare function _BinaryenModuleRunPasses(module: ModuleRef, passes: ArrayRef<StringRef>, numPasses: Index): void;
596624
export declare function _BinaryenModuleAutoDrop(module: ModuleRef): void;
597-
export declare function _BinaryenModuleAllocateAndWrite(out: ArrayRef<u8>, module: ModuleRef, sourceMapUrl: StringRef): void;
625+
export declare function _BinaryenSizeofAllocateAndWriteResult(): i32;
626+
export declare function _BinaryenModuleAllocateAndWrite(resultOut: BinaryenModuleAllocateAndWriteResultRef, module: ModuleRef, sourceMapUrl: StringRef): void;
627+
export declare function _BinaryenModuleAllocateAndWriteText(module: ModuleRef): StringRef;
628+
export declare function _BinaryenModuleAllocateAndWriteStackIR(module: ModuleRef, optimize: bool): StringRef;
598629
export declare function _BinaryenModuleRead(input: ArrayRef<u8>, inputSize: usize): ModuleRef;
599630
export declare function _BinaryenModuleInterpret(module: ModuleRef): void;
600631
export declare function _BinaryenModuleAddDebugInfoFileName(module: ModuleRef, filename: StringRef): Index;

0 commit comments

Comments
 (0)