Closed
Bug 1249531
Opened 8 years ago
Closed 8 years ago
Baldr: add text format and encoding support for control operators
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: luke, Assigned: luke)
References
Details
Attachments
(2 files, 1 obsolete file)
40.84 KB,
patch
|
mbx
:
review+
|
Details | Diff | Splinter Review |
32.34 KB,
patch
|
Details | Diff | Splinter Review |
Bug 1246116 will make the actual encoding/semantic changes for Br/BrIf/Loop/Tableswitch; this bug just adds br/br_if/loop/tableswitch to the s-expr text language. With this patch, we can parse full Binaryen output (at least bananabread).
Attachment #8721157 -
Flags: review?(mbebenita)
Comment 1•8 years ago
|
||
Comment on attachment 8721157 [details] [diff] [review] other-control-flow Review of attachment 8721157 [details] [diff] [review]: ----------------------------------------------------------------- Looks great! Minor nits and table switch bug need to be addressed. Excited to see that we can parse large Binaryen files now. ::: js/src/asmjs/WasmText.cpp @@ +2602,5 @@ > > +static WasmAstTableSwitch* > +ParseTableSwitch(WasmParseContext& c) > +{ > + WasmAstExpr* index = ParseExpr(c); TableSwitches also have breakNames. @@ +2614,5 @@ > + > + WasmRefVector table(c.lifo); > + > + while (c.ts.getIf(WasmToken::OpenParen)) { > + if (!c.ts.match(WasmToken::Br, c.error)) What about WasmToken::Case, follow-up bug? @@ +3184,5 @@ > + > +static bool > +ResolveBranch(Resolver& r, WasmAstBranch& br) > +{ > + if (!br.target().name().empty() && !r.resolveTarget(br.target())) Since the |if(!x.name().empty() && !r.resolveXXXX()) pattern is so common, it would be nice to move the name().empty() check into the resolveXXX() function. Here, and everywhere else. @@ +3321,5 @@ > } > > static bool > +ResolveTableSwitch(Resolver& r, WasmAstTableSwitch& ts) > +{ Need to push the TableSwitch breakName here.
Attachment #8721157 -
Flags: review?(mbebenita) → review+
Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Michael Bebenita [:mbx] from comment #1) > TableSwitches also have breakNames. Those are only really useful when you have cases; along with the proposal to remove cases we're proposing to remove the break label too. > What about WasmToken::Case, follow-up bug? We'll be proposing to remove them next week :)
Assignee | ||
Comment 4•8 years ago
|
||
Not for landing, but here's a patch I wrote that adds some basic instrumentation to WasmText.cpp to print AST node percentage as well as the number of bytes spent on various nodes' immediates.
Comment 5•8 years ago
|
||
Neat. Also take a look at: https://github.com/WebAssembly/binaryen/pull/204 You can do something like |./binaryen-shell/ x.wast --metrics| to dump stats, for example: https://pastebin.mozilla.org/8860409
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0e20bdd12dd1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Assignee | ||
Comment 7•8 years ago
|
||
Attachment #8721580 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•