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

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

Issue 2049513003: [wasm] Support undefined indirect table entries, behind a flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix formatting Created 4 years, 6 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
« src/wasm/wasm-module.cc ('K') | « test/mjsunit/wasm/wasm-constants.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 bfc4460d91b899d4ca640502cbfd625ef35ea1b4..f52720dba2203e7d5a3d6456c3244d0ee8b7c145 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -36,6 +36,7 @@ function WasmModuleBuilder() {
this.function_table = [];
this.data_segments = [];
this.explicit = [];
+ this.pad = null;
return this;
}
@@ -48,6 +49,11 @@ WasmModuleBuilder.prototype.addMemory = function(min, max, exp) {
return this;
}
+WasmModuleBuilder.prototype.addPadFunctionTable = function(size) {
+ this.pad = size;
+ return this;
+}
+
WasmModuleBuilder.prototype.addExplicitSection = function(bytes) {
this.explicit.push(bytes);
return this;
@@ -323,6 +329,15 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
});
}
+ // Add an indirect function table pad section.
+ if (wasm.pad !== null) {
+ if (debug)
+ print("emitting indirect function table pad @ " + bytes.length);
+ emit_section(bytes, kDeclFunctionTablePad, function(bytes) {
+ emit_varint(bytes, wasm.pad);
+ });
+ }
+
// End the module.
if (debug) print("emitting end @ " + bytes.length);
emit_section(bytes, kDeclEnd, function(bytes) {});
« src/wasm/wasm-module.cc ('K') | « test/mjsunit/wasm/wasm-constants.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698