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

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: Fixed static casting and 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
« no previous file with comments | « 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 98a5026379fba4fac57edfc439121f6fbc8b0976..5c5df798fbc9126c780a50a2a26eb9f37a82f4f6 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -109,6 +109,8 @@ class WasmModuleBuilder {
this.table = [];
this.segments = [];
this.explicit = [];
+ this.pad = null;
+ return this;
}
addStart(start_index) {
@@ -120,6 +122,11 @@ class WasmModuleBuilder {
return this;
}
+ addPadFunctionTable(size) {
+ this.pad = size;
+ return this;
+ }
+
addExplicitSection(bytes) {
this.explicit.push(bytes);
return this;
@@ -331,6 +338,19 @@ class WasmModuleBuilder {
});
}
+ // Add an indirect function table pad section.
+ if (wasm.pad !== null) {
+ if (debug)
+ print("emitting indirect function table pad @ " + binary.length);
+ binary.emit_section(kDeclFunctionTablePad, section => {
+ section.emit_varint(wasm.pad);
+ });
+ }
+
+ // End the module.
+ if (debug) print("emitting end @ " + binary.length);
+ binary.emit_section(kDeclEnd, section => {});
+
return binary;
}
« no previous file with comments | « test/mjsunit/wasm/wasm-constants.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698