Summary: | jsc-tailcall: Recognize calls in tail position | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Basile Clement <basile_clement> | ||||||||||
Component: | JavaScriptCore | Assignee: | Basile Clement <basile_clement> | ||||||||||
Status: | RESOLVED DUPLICATE | ||||||||||||
Severity: | Enhancement | CC: | fpizlo, ggaren, mark.lam, msaboff | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 146477, 146484 | ||||||||||||
Attachments: |
|
Description
Basile Clement
2015-06-30 17:19:36 PDT
Created attachment 256632 [details]
Patch
Comment on attachment 256632 [details]
Patch
Looks good to me. Here are a few missing cases:
LogicalANDExpression : LogicalANDExpression && BitwiseORExpression
Return HasProductionInTailPosition of BitwiseORExpression with argument nonterminal.
LogicalORExpression : LogicalORExpression || LogicalANDExpression
Return HasProductionInTailPosition of LogicalANDExpression with argument nonterminal.
Comment on attachment 256632 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256632&action=review > Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:2949 > + generator.emitNode(dst, m_catchBlock, tailCallMode); This can also be written to be more explicitly not relying on default parameter: generator.emitNode(dot, m_catchBlock, m_finallyBlock ? NoTailCalls : tailCallMode). (In reply to comment #2) > Comment on attachment 256632 [details] > Patch > > Looks good to me. Here are a few missing cases: > > LogicalANDExpression : LogicalANDExpression && BitwiseORExpression > Return HasProductionInTailPosition of BitwiseORExpression with argument > nonterminal. > LogicalORExpression : LogicalORExpression || LogicalANDExpression > Return HasProductionInTailPosition of LogicalANDExpression with argument > nonterminal. Good catch, adding those. (In reply to comment #3) > Comment on attachment 256632 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=256632&action=review > > > Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:2949 > > + generator.emitNode(dst, m_catchBlock, tailCallMode); > > This can also be written to be more explicitly not relying on default > parameter: > generator.emitNode(dot, m_catchBlock, m_finallyBlock ? NoTailCalls : > tailCallMode). That is indeed better, changing this. Created attachment 256800 [details]
Patch
Add LogicalOpNode as a possible tail call, simplifies TryNode and ScopeNode.
Committed r186822 <http://trac.webkit.org/changeset/186822>. Reopening to attach new patch. Created attachment 260344 [details]
Patch
*** This bug has been marked as a duplicate of bug 148665 *** Reopening to attach new patch. Created attachment 260380 [details]
Patch
*** This bug has been marked as a duplicate of bug 148665 *** Comment on attachment 260380 [details] Patch Cleared review? from attachment 260380 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again). |