compiler: enable optimizer for function literals

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/821553003

Patch from Ben Noordhuis <ben@strongloop.com>.

Cr-Commit-Position: refs/heads/master@{#25992}
This commit is contained in:
Ben Noordhuis 2015-01-08 14:13:39 +01:00 committed by Yang Guo
parent 7deccd18ed
commit ad0069e8fe

View File

@ -1238,7 +1238,9 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
} else { } else {
// Explicitly disable optimization for eval code. We're not yet prepared // Explicitly disable optimization for eval code. We're not yet prepared
// to handle eval-code in the optimizing compiler. // to handle eval-code in the optimizing compiler.
shared_info->DisableOptimization(kEval); if (restriction != ONLY_SINGLE_FUNCTION_LITERAL) {
shared_info->DisableOptimization(kEval);
}
// If caller is strict mode, the result must be in strict mode as well. // If caller is strict mode, the result must be in strict mode as well.
DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT); DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT);