Compile optimized code with active debugger but no break points.

R=ulan@chromium.org
BUG=386492
LOG=Y

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22029 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2014-06-26 06:32:51 +00:00
parent 8ff53a8d62
commit a2d15ce518
4 changed files with 24 additions and 4 deletions

View File

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

View File

@ -306,8 +306,10 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
// 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.

View File

@ -1043,7 +1043,7 @@ template <class C> inline bool Is(Object* obj);
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") \

View File

@ -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);