Closed Bug 1507492 Opened 6 years ago Closed 6 years ago

Implement table.fill instruction and Table.fill JS API

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: lth, Assigned: jseward)

References

Details

Attachments

(1 file)

In the same way we have memory.fill, we will have table.fill, both as a wasm instruction and as a JS API. There's no spec for this yet, but it should be considered a sequence of set() calls, from lower to higher indices. There's going to be some bikeshedding about whether to check the bounds before the first assignment or as we perform each set. At the moment tables are not shared and the former makes more sense. If/when tables become shared then the latter will make more sense.
Blocks: 1488199
No longer blocks: 1488199

Note, both Ion and Baseline.

Assignee: nobody → lhansen
Status: NEW → ASSIGNED
Assignee: lhansen → jseward

This patch implements the (currently non-standard) table.fill instruction.

The implementation is very similar to the existing implementation for
memory.fill. I looked into commoning up the two implementations, but decided
that would be more trouble that it's worth, because:

  • for all associated artefacts, table.fill has a fourth arg (really, an
    immediate associated with the opcode) that denotes the table, whereas
    memory.fill only has three args

  • two of the front end artefacts, Parse{Table,Mem}Fill and Ast{Table,Mem}Fill,
    have different ifdef guards, ENABLE_WASM_BULKMEM_OPS and
    ENABLE_WASM_REFTYPES respectively.

The bounds-check logic in Instance::tableFill is a clone of that in ::memFill.

Attachment #9060632 - Attachment is obsolete: true
Attachment #9060632 - Attachment is obsolete: false
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/bb90214b7f33 Implement the Wasm table.fill instruction. r=lhansen.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: