Commit 9a858df6 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm][test] Do not add table in addElementSegment

This is just for convenience, and actually surprising behavior.

R=clemensh@chromium.org

Bug: v8:9183
Change-Id: I3316856e63b97bfb06da897c6f8b716bc988aa36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621932
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61684}
parent 193a2617
......@@ -26,6 +26,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
let builder = new WasmModuleBuilder();
builder.addImport("q", "f2", kSig_i_v);
builder.addImport("q", "f1", kSig_i_v);
builder.addTable(kWasmAnyFunc, 4);
builder.addFunction("main", kSig_i_i)
.addBody([
kExprGetLocal, 0,
......
......@@ -812,6 +812,7 @@ function js_div(a, b) { return (a / b) | 0; }
let i2 = (() => {
let builder = new WasmModuleBuilder();
builder.addTable(kWasmAnyFunc, 4);
builder.addImport("q", "f2", kSig_i_v);
builder.addImport("q", "f1", kSig_i_v);
builder.addFunction("main", kSig_i_i)
......@@ -867,6 +868,7 @@ function js_div(a, b) { return (a / b) | 0; }
let main = (() => {
let builder = new WasmModuleBuilder();
builder.addMemory(1, 1, false);
builder.addTable(kWasmAnyFunc, 4);
builder.addImport("q", "f1", kSig_i_v);
builder.addImport("q", "f2", kSig_i_v);
builder.addImport("q", "f3", kSig_i_v);
......
......@@ -133,7 +133,9 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
const sig_i_iii = builder.addType(kSig_i_iii);
let pick = builder.addImport("q", "pick", sig_i_iii);
const tableIndex = 3; // Arbitrary location of import
builder.addTable(kWasmAnyFunc, 4);
// Arbitrary location in the table.
const tableIndex = 3;
builder.addElementSegment(0, tableIndex,false,[pick]);
......
......@@ -898,9 +898,6 @@ class WasmModuleBuilder {
}
addElementSegment(table, base, is_global, array) {
if (this.tables.length + this.num_imported_tables == 0) {
this.addTable(kWasmAnyFunc, 0);
}
this.element_segments.push({table: table, base: base, is_global: is_global,
array: array, is_active: true});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment