Skip to content

Commit

Permalink
[compiler] Consistently use Ignition+TurboFan for lexical variables.
Browse files Browse the repository at this point in the history
Crankshaft has this highly unpredictable performance cliff around the
"Unsupported phi use of const or let variable", which is due to the
fact that Crankshaft refuses to do hole checks (for a couple of
reasons). So ideally we should not even try to send any lexically bound
variables to fullcodegen+Crankshaft, but instead give them to Ignition
and TurboFan.

This CL only adds the appropriate check to the AstNumbering, but doesn't
remove the functionality from fullcodegen/Crankshaft yet. This would be
step two in case this CL sticks. If you see any major performance
regressions with this CL in the range, just revert it and ping me.

See Node.js issue nodejs/node#9729 for
additional information.

BUG=v8:5666
R=hablich@chromium.org, mstarzinger@chromium.org, rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2525243002
Cr-Commit-Position: refs/heads/master@{#41445}
  • Loading branch information
bmeurer authored and Commit bot committed Dec 2, 2016
1 parent 45e45e0 commit 5529430
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ast/ast-numbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) {
default:
break;
}
if (IsLexicalVariableMode(node->var()->mode())) {
DisableFullCodegenAndCrankshaft(kReferenceToLetOrConstVariable);
}
node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
}

Expand Down
1 change: 1 addition & 0 deletions src/bailout-reason.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ namespace internal {
V(kReceivedInvalidReturnAddress, "Received invalid return address") \
V(kReferenceToAVariableWhichRequiresDynamicLookup, \
"Reference to a variable which requires dynamic lookup") \
V(kReferenceToLetOrConstVariable, "Reference to let or const variable") \
V(kReferenceToGlobalLexicalVariable, "Reference to global lexical variable") \
V(kReferenceToModuleVariable, "Reference to module-allocated variable") \
V(kReferenceToUninitializedVariable, "Reference to uninitialized variable") \
Expand Down

0 comments on commit 5529430

Please sign in to comment.