Commit 2cdd38e5 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][test] Remove redundant function

The {setTableLength} method is redundant and has a single user. Remove
it, use {setTableBounds} instead.

Drive-by: Add default to the table max, to document that this can
actually be {undefined}, in which case the table has no maximum.

R=binji@chromium.org

Bug: v8:8238
Change-Id: I0d7a2f4d49d083f7adadbb4b6cd4933bcb1dc174
Reviewed-on: https://chromium-review.googlesource.com/c/1350126Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57860}
parent a1355034
...@@ -20,7 +20,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); ...@@ -20,7 +20,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
(function TestPassiveElementSegment() { (function TestPassiveElementSegment() {
const builder = new WasmModuleBuilder(); const builder = new WasmModuleBuilder();
builder.addFunction('f', kSig_v_v).addBody([]); builder.addFunction('f', kSig_v_v).addBody([]);
builder.setTableLength(1); builder.setTableBounds(1, 1);
builder.addPassiveElementSegment([0, 0, 0]); builder.addPassiveElementSegment([0, 0, 0]);
builder.addPassiveElementSegment([0, 0]); builder.addPassiveElementSegment([0, 0]);
......
...@@ -341,18 +341,12 @@ class WasmModuleBuilder { ...@@ -341,18 +341,12 @@ class WasmModuleBuilder {
return this.addElementSegment(this.table_length_min, false, array); return this.addElementSegment(this.table_length_min, false, array);
} }
setTableBounds(min, max) { setTableBounds(min, max = undefined) {
this.table_length_min = min; this.table_length_min = min;
this.table_length_max = max; this.table_length_max = max;
return this; return this;
} }
setTableLength(length) {
this.table_length_min = length;
this.table_length_max = length;
return this;
}
setName(name) { setName(name) {
this.name = name; this.name = name;
return this; return this;
......
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