Skip to content

Update binaryen #2385

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

Merged
merged 45 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4979a91
wip
MaxGraey Jul 26, 2022
4212bcd
fix
MaxGraey Jul 26, 2022
90d2d8f
refactor update-constants
MaxGraey Jul 26, 2022
d8a55bf
add gufa pass
MaxGraey Jul 26, 2022
66d8b65
better
MaxGraey Jul 26, 2022
318de98
simplify update-constants
MaxGraey Jul 26, 2022
cba4ddc
refactor TypeRef
MaxGraey Jul 26, 2022
3681c5c
better
MaxGraey Jul 26, 2022
9f76a5a
better comment
MaxGraey Jul 26, 2022
6203797
typo
MaxGraey Jul 26, 2022
4c736c5
run stack-ir passes for watFormat
MaxGraey Jul 26, 2022
232a197
update
MaxGraey Jul 27, 2022
ad0ef3e
simplify toText back
MaxGraey Jul 27, 2022
f15af25
add uncheckeds for glue helpers in module
MaxGraey Jul 27, 2022
62bf533
add Strings to FeatureFlags. More uncheckeds
MaxGraey Jul 27, 2022
32bef8f
update binaryen. Add stringref types
MaxGraey Jul 28, 2022
74e9bad
Merge branch 'main' into update-binaryen
MaxGraey Jul 28, 2022
34702fa
upd
MaxGraey Jul 28, 2022
577ed11
update binaryen
MaxGraey Jul 30, 2022
0fa96c8
better
MaxGraey Jul 30, 2022
5ea7fb9
less work
MaxGraey Jul 30, 2022
17499ac
refactor toBinary
MaxGraey Jul 30, 2022
47449d1
fix
MaxGraey Jul 30, 2022
66b745a
better names
MaxGraey Jul 30, 2022
ffe50ac
add merge-similar-functions pass for shrinkLevel >= 2
MaxGraey Jul 31, 2022
6ddc7b6
clean unused arg in isConstExpression
MaxGraey Jul 31, 2022
6480d04
update binaryen again
MaxGraey Aug 2, 2022
9f96f79
update
MaxGraey Aug 3, 2022
e06f862
update binaryen
MaxGraey Aug 4, 2022
e089ccc
update binaryen
MaxGraey Aug 5, 2022
8acb282
add heap types for binaryen's glue
MaxGraey Aug 5, 2022
c6993cf
add HeapTypeRef to module. Remove Rtt
MaxGraey Aug 5, 2022
4987a48
add isNullableType and utilise it for ref_is_null and ref_as_nonnull
MaxGraey Aug 5, 2022
5aae96d
Merge branch 'main' into update-binaryen
MaxGraey Aug 6, 2022
8571600
upd date fixture after conflicts
MaxGraey Aug 6, 2022
b5f3fcd
Merge branch 'main' into update-binaryen
MaxGraey Aug 6, 2022
18c834e
Merge branch 'main' into update-binaryen
MaxGraey Aug 7, 2022
9f4da51
Merge branch 'main' into update-binaryen
MaxGraey Aug 7, 2022
0a8fb00
update fixtures
MaxGraey Aug 7, 2022
d9ddc56
update
MaxGraey Aug 8, 2022
7c6cb94
update binaryen
MaxGraey Aug 9, 2022
0d98517
update
MaxGraey Aug 10, 2022
886a567
Merge branch 'main' into update-binaryen
MaxGraey Aug 13, 2022
1d21f30
update
MaxGraey Aug 13, 2022
640f0a8
Merge branch 'main' into update-binaryen
MaxGraey Aug 15, 2022
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": "108.0.0-nightly.20220528",
"binaryen": "109.0.0-nightly.20220813",
"long": "^5.2.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions scripts/update-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const srcfile = path.join(__dirname, "..", "src", "module.ts");
var src = fs.readFileSync(srcfile, "utf8")
.replace(/(?:enum|namespace) (\w+) \{([^}]*)\}/g, function($0) {
return $0.replace(/(\w+)[ ]+=[ ]+([^,;\n]+)/g, function($0, key, val) {
// ignore values which have runtime assignments
if (val.startsWith("binaryen.")) {
return $0;
}
var match = val.match(/\b(_(?:Binaryen|Relooper|ExpressionRunner)\w+)\b/);
if (match) {
let fn = match[1];
Expand Down
35 changes: 33 additions & 2 deletions src/glue/binaryen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@
*/
module "binaryen";

type Ref = usize;

export type Index = u32;
export type ExpressionId = i32;
export type FeatureFlags = u32;
export type Op = i32;
export type ExternalKind = u32;
export type SideEffects = u32;
export type ExpressionRunnerFlags = u32;
type Ref = usize;

export type StringRef = Ref;
export type ArrayRef<T> = Ref;
export type TypeRef = Ref;
export type HeapTypeRef = Ref;
export type ModuleRef = Ref;
export type LiteralRef = Ref;
export type ExpressionRef = Ref;
Expand All @@ -33,10 +36,35 @@ export type ElementSegmentRef = Ref;
export type RelooperRef = Ref;
export type RelooperBlockRef = Ref;
export type ExpressionRunnerRef = Ref;
export type BinaryenModuleAllocateAndWriteResultRef = Ref;

export declare function _BinaryenTypeCreate(types: ArrayRef<TypeRef>, numTypes: u32): TypeRef;
export declare function _BinaryenTypeArity(type: TypeRef): u32;
export declare function _BinaryenTypeExpand(type: TypeRef, typesOut: ArrayRef<TypeRef>): void;
export declare function _BinaryenTypeGetHeapType(type: TypeRef): HeapTypeRef;
export declare function _BinaryenTypeFromHeapType(heapType: HeapTypeRef, nullable: bool): TypeRef;
export declare function _BinaryenTypeIsNullable(type: TypeRef): bool;

export declare function _BinaryenTypeFuncref(): TypeRef;
export declare function _BinaryenTypeExternref(): TypeRef;
export declare function _BinaryenTypeAnyref(): TypeRef;
export declare function _BinaryenTypeEqref(): TypeRef;
export declare function _BinaryenTypeI31ref(): TypeRef;
export declare function _BinaryenTypeDataref(): TypeRef;
export declare function _BinaryenTypeStringref(): TypeRef;
export declare function _BinaryenTypeStringviewWTF8(): TypeRef;
export declare function _BinaryenTypeStringviewWTF16(): TypeRef;
export declare function _BinaryenTypeStringviewIter(): TypeRef;

export declare function _BinaryenHeapTypeFunc(): HeapTypeRef;
export declare function _BinaryenHeapTypeAny(): HeapTypeRef;
export declare function _BinaryenHeapTypeEq(): HeapTypeRef;
export declare function _BinaryenHeapTypeI31(): HeapTypeRef;
export declare function _BinaryenHeapTypeData(): HeapTypeRef;
export declare function _BinaryenHeapTypeString(): HeapTypeRef;
export declare function _BinaryenHeapTypeStringviewWTF8(): HeapTypeRef;
export declare function _BinaryenHeapTypeStringviewWTF16(): HeapTypeRef;
export declare function _BinaryenHeapTypeStringviewIter(): HeapTypeRef;

export declare function _BinaryenModuleCreate(): ModuleRef;
export declare function _BinaryenModuleDispose(module: ModuleRef): void;
Expand Down Expand Up @@ -594,7 +622,10 @@ export declare function _BinaryenModuleValidate(module: ModuleRef): i32;
export declare function _BinaryenModuleOptimize(module: ModuleRef): void;
export declare function _BinaryenModuleRunPasses(module: ModuleRef, passes: ArrayRef<StringRef>, numPasses: Index): void;
export declare function _BinaryenModuleAutoDrop(module: ModuleRef): void;
export declare function _BinaryenModuleAllocateAndWrite(out: ArrayRef<u8>, module: ModuleRef, sourceMapUrl: StringRef): void;
export declare function _BinaryenSizeofAllocateAndWriteResult(): i32;
export declare function _BinaryenModuleAllocateAndWrite(resultOut: BinaryenModuleAllocateAndWriteResultRef, module: ModuleRef, sourceMapUrl: StringRef): void;
export declare function _BinaryenModuleAllocateAndWriteText(module: ModuleRef): StringRef;
export declare function _BinaryenModuleAllocateAndWriteStackIR(module: ModuleRef, optimize: bool): StringRef;
export declare function _BinaryenModuleRead(input: ArrayRef<u8>, inputSize: usize): ModuleRef;
export declare function _BinaryenModuleInterpret(module: ModuleRef): void;
export declare function _BinaryenModuleAddDebugInfoFileName(module: ModuleRef, filename: StringRef): Index;
Expand Down
Loading