Revision: 22029
Author:   [email protected]
Date:     Thu Jun 26 06:32:51 2014 UTC
Log:      Compile optimized code with active debugger but no break points.

[email protected]
BUG=386492
LOG=Y

Review URL: https://codereview.chromium.org/356713004
http://code.google.com/p/v8/source/detail?r=22029

Added:
 /branches/bleeding_edge/test/mjsunit/debug-compile-optimized.js
Modified:
 /branches/bleeding_edge/src/codegen.cc
 /branches/bleeding_edge/src/compiler.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/debug-compile-optimized.js Thu Jun 26 06:32:51 2014 UTC
@@ -0,0 +1,18 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --expose-debug-as debug --allow-natives-syntax --crankshaft
+
+Debug = debug.Debug;
+
+Debug.setListener(function() {});
+
+function f() {}
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
+assertOptimized(f);
+
+Debug.setListener(null);
=======================================
--- /branches/bleeding_edge/src/codegen.cc      Tue Jun  3 08:12:43 2014 UTC
+++ /branches/bleeding_edge/src/codegen.cc      Thu Jun 26 06:32:51 2014 UTC
@@ -151,7 +151,7 @@
       isolate->factory()->NewCode(desc, flags, masm->CodeObject(),
                                   false, is_crankshafted,
                                   info->prologue_offset(),
-                                  info->is_debug());
+                                  info->is_debug() && !is_crankshafted);
   isolate->counters()->total_compiled_code_size()->Increment(
       code->instruction_size());
   isolate->heap()->IncrementCodeGeneratedBytes(is_crankshafted,
=======================================
--- /branches/bleeding_edge/src/compiler.cc     Wed Jun 25 12:37:06 2014 UTC
+++ /branches/bleeding_edge/src/compiler.cc     Thu Jun 26 06:32:51 2014 UTC
@@ -306,8 +306,10 @@
   // generated code for this from the shared function object.
   if (FLAG_always_full_compiler) return AbortOptimization();

-  // Do not use crankshaft if compiling for debugging.
-  if (info()->is_debug()) return AbortOptimization(kDebuggerIsActive);
+  // Do not use crankshaft if we need to be able to set break points.
+  if (isolate()->DebuggerHasBreakPoints()) {
+    return AbortOptimization(kDebuggerHasBreakPoints);
+  }

   // Limit the number of times we re-compile a functions with
   // the optimizing compiler.
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu Jun 26 00:40:45 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Thu Jun 26 06:32:51 2014 UTC
@@ -1043,7 +1043,7 @@
V(kCopyBuffersOverlap, "Copy buffers overlap") \ V(kCouldNotGenerateZero, "Could not generate +0.0") \ V(kCouldNotGenerateNegativeZero, "Could not generate -0.0") \ - V(kDebuggerIsActive, "Debugger is active") \ + V(kDebuggerHasBreakPoints, "Debugger has break points") \ V(kDebuggerStatement, "DebuggerStatement") \ V(kDeclarationInCatchContext, "Declaration in catch context") \ V(kDeclarationInWithContext, "Declaration in with context") \

--
--
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