compiler: enable optimizer for function literals
authorBen Noordhuis <ben@strongloop.com>
Thu, 8 Jan 2015 13:13:39 +0000 (14:13 +0100)
committerYang Guo <yangguo@chromium.org>
Thu, 8 Jan 2015 13:13:59 +0000 (13:13 +0000)
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}

src/compiler.cc

index 3b52aa2..59d2fb8 100644 (file)
@@ -1238,7 +1238,9 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
     } else {
       // Explicitly disable optimization for eval code. We're not yet prepared
       // 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.
       DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT);