Closed Bug 1546074 Opened 2 years ago Closed 1 year ago

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


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




Tracking Status
firefox71 --- fixed


(Reporter: lth, Assigned: lth, Mentored)



(Keywords: good-first-bug)


(1 file)

In 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
Remove support for 'passive' syntax for segments.  r=rhunt
Backout by
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
Remove support for 'passive' syntax for segments.  r=rhunt
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.