Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: test/mjsunit/wasm/wasm-module-builder.js

Issue 2443353002: [wasm] Add support for exporting WebAssembly.Table instances. (Closed)
Patch Set: Fix identity of exported JSFunctions Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/indirect-tables.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/wasm-module-builder.js
diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js
index e3311c1cb620f8d798b9a6a8120e0c189c295768..85b2638eb1224164e2b9785dd012931ecc5c05e0 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -120,7 +120,8 @@ class WasmGlobalBuilder {
}
exportAs(name) {
- this.module.exports.push({name: name, kind: kExternalGlobal, index: this.index});
+ this.module.exports.push({name: name, kind: kExternalGlobal,
+ index: this.index});
return this;
}
}
@@ -197,7 +198,8 @@ class WasmModuleBuilder {
}
addImportedMemory(module, name, initial = 0, maximum) {
- let o = {module: module, name: name, kind: kExternalMemory, initial: initial, maximum: maximum};
+ let o = {module: module, name: name, kind: kExternalMemory,
+ initial: initial, maximum: maximum};
this.imports.push(o);
return this;
}
@@ -207,6 +209,11 @@ class WasmModuleBuilder {
return this;
}
+ addExportOfKind(name, kind, index) {
+ this.exports.push({name: name, kind: kind, index: index});
+ return this;
+ }
+
addDataSegment(addr, data, is_global = false) {
this.segments.push({addr: addr, data: data, is_global: is_global});
return this.segments.length - 1;
@@ -217,10 +224,13 @@ class WasmModuleBuilder {
}
addFunctionTableInit(base, is_global, array) {
- this.function_table_inits.push({base: base, is_global: is_global, array: array});
+ this.function_table_inits.push({base: base, is_global: is_global,
+ array: array});
if (!is_global) {
var length = base + array.length;
- if (length > this.function_table_length) this.function_table_length = length;
+ if (length > this.function_table_length) {
+ this.function_table_length = length;
+ }
}
return this;
}
« no previous file with comments | « test/mjsunit/wasm/indirect-tables.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698