Commit 8ab50513 authored by verwaest's avatar verwaest Committed by Commit bot

Only guard the eager compile hint by whether the target literal was same-zone parsed

BUG=v8:5501,chromium:655122

Review-Url: https://codereview.chromium.org/2419663005
Cr-Commit-Position: refs/heads/master@{#40247}
parent 0e1f6d8b
...@@ -293,6 +293,7 @@ bool FunctionLiteral::ShouldEagerCompile() const { ...@@ -293,6 +293,7 @@ bool FunctionLiteral::ShouldEagerCompile() const {
} }
void FunctionLiteral::SetShouldEagerCompile() { void FunctionLiteral::SetShouldEagerCompile() {
if (body_ == nullptr) return;
scope()->SetShouldEagerCompile(); scope()->SetShouldEagerCompile();
} }
......
...@@ -3080,7 +3080,7 @@ ParserBase<Impl>::ParseLeftHandSideExpression(bool* ok) { ...@@ -3080,7 +3080,7 @@ ParserBase<Impl>::ParseLeftHandSideExpression(bool* ok) {
// Also the trailing parenthesis are a hint that the function will // Also the trailing parenthesis are a hint that the function will
// be called immediately. If we happen to have parsed a preceding // be called immediately. If we happen to have parsed a preceding
// function literal eagerly, we can also compile it eagerly. // function literal eagerly, we can also compile it eagerly.
if (result->IsFunctionLiteral() && mode() == PARSE_EAGERLY) { if (result->IsFunctionLiteral()) {
result->AsFunctionLiteral()->SetShouldEagerCompile(); result->AsFunctionLiteral()->SetShouldEagerCompile();
} }
} }
...@@ -3410,7 +3410,7 @@ ParserBase<Impl>::ParseMemberExpressionContinuation(ExpressionT expression, ...@@ -3410,7 +3410,7 @@ ParserBase<Impl>::ParseMemberExpressionContinuation(ExpressionT expression,
pos = position(); pos = position();
} else { } else {
pos = peek_position(); pos = peek_position();
if (expression->IsFunctionLiteral() && mode() == PARSE_EAGERLY) { if (expression->IsFunctionLiteral()) {
// If the tag function looks like an IIFE, set_parenthesized() to // If the tag function looks like an IIFE, set_parenthesized() to
// force eager compilation. // force eager compilation.
expression->AsFunctionLiteral()->SetShouldEagerCompile(); expression->AsFunctionLiteral()->SetShouldEagerCompile();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment