Revision: 25020
Author:   [email protected]
Date:     Thu Oct 30 14:40:30 2014 UTC
Log:      Do not compile with Turbofan if we cannot deopt for debugging.

[email protected]
BUG=v8:3660
LOG=N

Review URL: https://codereview.chromium.org/677843005
https://code.google.com/p/v8/source/detail?r=25020

Modified:
 /branches/bleeding_edge/src/compiler.cc

=======================================
--- /branches/bleeding_edge/src/compiler.cc     Wed Oct 29 10:28:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler.cc     Thu Oct 30 14:40:30 2014 UTC
@@ -845,14 +845,17 @@


 MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
-  DCHECK(!function->GetIsolate()->has_pending_exception());
+  Isolate* isolate = function->GetIsolate();
+  DCHECK(!isolate->has_pending_exception());
   DCHECK(!function->is_compiled());
-
-  if (FLAG_turbo_asm && function->shared()->asm_function()) {
+  // If the debugger is active, do not compile with turbofan unless we can
+  // deopt from turbofan code.
+  if (FLAG_turbo_asm && function->shared()->asm_function() &&
+      (FLAG_turbo_deoptimization || !isolate->debug()->is_active())) {
     CompilationInfoWithZone info(function);

-    VMState<COMPILER> state(info.isolate());
-    PostponeInterruptsScope postpone(info.isolate());
+    VMState<COMPILER> state(isolate);
+    PostponeInterruptsScope postpone(isolate);

     info.SetOptimizing(BailoutId::None(),
                        Handle<Code>(function->shared()->code()));
@@ -861,7 +864,10 @@
     info.MarkAsTypingEnabled();
     info.MarkAsInliningDisabled();

-    if (GetOptimizedCodeNow(&info)) return info.code();
+    if (GetOptimizedCodeNow(&info)) {
+      DCHECK(function->shared()->is_compiled());
+      return info.code();
+    }
   }

   if (function->shared()->is_compiled()) {
@@ -870,13 +876,12 @@

   CompilationInfoWithZone info(function);
   Handle<Code> result;
-  ASSIGN_RETURN_ON_EXCEPTION(info.isolate(), result,
-                             GetUnoptimizedCodeCommon(&info), Code);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
+                             Code);

-  if (FLAG_always_opt &&
-      info.isolate()->use_crankshaft() &&
+  if (FLAG_always_opt && isolate->use_crankshaft() &&
       !info.shared_info()->optimization_disabled() &&
-      !info.isolate()->DebuggerHasBreakPoints()) {
+      !isolate->DebuggerHasBreakPoints()) {
     Handle<Code> opt_code;
     if (Compiler::GetOptimizedCode(
             function, result,

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to