Create an `Opcode` abstraction and use it for text->binary translation
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
Details
Attachments
(2 files)
The text->binary translator has acquired some hacks to deal with the multiple opcode spaces, notably there is now both ConversionOperator (which takes an Op opcode) and an ExtraConversionOperator (which takes a MiscOp opcode). This situation gets much worse with SIMD, which will want to reuse BinaryOperator, UnaryOperator, Load, Store, and others, and it's just generally annoying. In addition it is vaguely untype-safe because the Token stores the opcodes in an undiscriminated union; it is true that we check the token kind when we extract the opcode, but this is unsatisfying and will again get worse with SIMD.
Instead, introduce a new abstraction Opcode
which can compactly represent all opcodes of all kinds as a single datum, and switch text->binary to use this everywhere. As a result, we can remove the ExtraConversionOperator and some of the writeOp() primitives.
Assignee | ||
Comment 1•4 years ago
|
||
The Opcode
wraps an Op
, and if the Op
is a prefix it also
carries the secondary opcode bits. Implicit constructors from Op
,
MiscOp
, etc to Opcode
, ensures that this will be pretty painless
to use.
Assignee | ||
Comment 2•4 years ago
|
||
Switch from Op
/MiscOp
/ThreadOp
to just Opcode
everywhere, and
get rid of methods that are no longer needed.
Remove the now-unnecessary ExtraConversionOperator node.
Depends on D58940
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab08fd062f82 Introduce the Opcode abstraction. r=bbouvier https://hg.mozilla.org/integration/autoland/rev/1895e3498222 Simplify text->binary conversion with Opcode. r=bbouvier
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ab08fd062f82
https://hg.mozilla.org/mozilla-central/rev/1895e3498222
Description
•