Implement the IsInTailPosition static property (https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isintailposition) to recognize calls in tail position.
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 ***
Created attachment 260380 [details] Patch
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).