Reviewers: ulan,
Description:
Compile optimized code with active debugger but no break points.
[email protected]
BUG=386492
LOG=Y
Please review this at https://codereview.chromium.org/356713004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+11, -10 lines):
M src/codegen.cc
M src/compiler.cc
A + test/mjsunit/debug-compile-optimized.js
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index
753d522d6f6d8d00556781f21bd44d552c005a5f..c039e40c93317668b25bed72c6c743a4e40abba7
100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -151,7 +151,7 @@ Handle<Code>
CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
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,
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index
f471224b42c5430f7f2c551efe569f0e10609990..7b4afe375f9e5346ddf8da8ea38423b46ded7344
100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -307,7 +307,9 @@ OptimizedCompileJob::Status
OptimizedCompileJob::CreateGraph() {
if (FLAG_always_full_compiler) return AbortOptimization();
// Do not use crankshaft if compiling for debugging.
- if (info()->is_debug()) return AbortOptimization(kDebuggerIsActive);
+ if (isolate()->DebuggerHasBreakPoints()) {
+ return AbortOptimization(kDebuggerIsActive);
+ }
// Limit the number of times we re-compile a functions with
// the optimizing compiler.
Index: test/mjsunit/debug-compile-optimized.js
diff --git a/test/mjsunit/regress/regress-crbug-387599.js
b/test/mjsunit/debug-compile-optimized.js
similarity index 58%
copy from test/mjsunit/regress/regress-crbug-387599.js
copy to test/mjsunit/debug-compile-optimized.js
index
98750aa918261f707bdee8a05d230c2805aa11e9..468605abaab079d4b19250b90fed7048bec205aa
100644
--- a/test/mjsunit/regress/regress-crbug-387599.js
+++ b/test/mjsunit/debug-compile-optimized.js
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --allow-natives-syntax --expose-debug-as debug
+// Flags: --expose-debug-as debug --allow-natives-syntax --crankshaft
Debug = debug.Debug;
-Debug.setListener(function() {});
-function f() {
- for (var i = 0; i < 100; i++) {
- %OptimizeFunctionOnNextCall(f, "osr");
- }
-}
+Debug.setListener(function() {});
-Debug.setBreakPoint(f, 0, 0);
+function f() {}
f();
f();
+%OptimizeFunctionOnNextCall(f);
+f();
+assertOptimized(f);
+
Debug.setListener(null);
--
--
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.