Closed Bug 1860806 Opened 2 years ago Closed 7 months ago

Skip table bounds check if index is constant and below minimum size of table type

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1914005

People

(Reporter: rhunt, Unassigned)

References

Details

We could optimize a sequence of:

  (table anyref 1)
  (table.get (i32.const 0))

So that the table.get skips the bounds check because the index is constant and below the minimum size of the table of 1. Some code in Ion for this [1]. This could be useful if programs are using tables sort of like globals, which I've heard some rumblings of from some wasm-gc users.

[1] https://searchfox.org/mozilla-central/rev/10d0e01455559a433670bd718a3ecc0ece5d2cb9/js/src/wasm/WasmIonCompile.cpp#1791-1797

This was fixed by bug 1914005.

Status: NEW → RESOLVED
Closed: 7 months ago
Duplicate of bug: 1914005
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.