Closed Bug 1546074 Opened 5 years ago Closed 5 years ago

WasmTextToBinary: Do not require 'passive'; do require a type for passive element segments

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: lth, Assigned: lth, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file)

In https://github.com/WebAssembly/bulk-memory-operations/pull/84 there's a change to the official syntax to drop the use of the "passive" keyword for passive element segments and data segments, because it does not disambiguate anything.

This is not quite true in SpiderMonkey since we allow the element segment type to be omitted, since we only allow it to be funcref. But if we require the type (which will then be restricted to funcref for now, and anyref a little later perhaps) then it will be true.

As for data segments, data segments either start with an init expression (active) or with a string (passive), so clearly the keyword is not required there. What we require is some lookahead.

Once type expressions are more complicated the lookahead may well become complicated, but it'll be bounded: (ref T) only requires the two tokens.

Type: defect → enhancement
See Also: → 1549926
Assignee: nobody → lhansen
Blocks: 1546592

This removes support for 'passive' and makes our element and data segment
syntax follow standard syntax much more closely.

Element segments now require either 'func' or 'funcref' in the right
position, and require a table index for active segments that don't use
the designated MVP shorthand.

Data segments require an offset when there's a memory index present.

Also add support for the noise syntax (offset x) for the
initialization offset in active segments.

I did not add support for the variant of in-line elements in the table
definition that allows the starting offset to be specified; this is
followup work.

Attachment #9098455 - Attachment description: Bug 1546074 - Remove support for 'passive' syntax for segments. r?rhunt → Bug 1546074 - Remove support for 'passive' syntax for segments. r=rhunt
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/341a1c31fb15
Remove support for 'passive' syntax for segments.  r=rhunt
Backout by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/940cc46b1ff6
Backed out changeset 341a1c31fb15 for causing spidermonkey bustages CLOSED TREE

My bad, I changed the case of the initial letter in a couple of error message and forgot to rerun the tests.

Flags: needinfo?(lhansen)
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e6a7b2f9fc6
Remove support for 'passive' syntax for segments.  r=rhunt
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: