Commit 0ef9ce4a authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Remove exorbitant duplication of DebuggerHasBreakpoints.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26145}
parent 0707afc8
...@@ -345,7 +345,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { ...@@ -345,7 +345,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
DCHECK(!info()->IsCompilingForDebugging()); DCHECK(!info()->IsCompilingForDebugging());
// Do not use Crankshaft/TurboFan if we need to be able to set break points. // Do not use Crankshaft/TurboFan if we need to be able to set break points.
if (isolate()->DebuggerHasBreakPoints()) { if (isolate()->debug()->has_break_points()) {
return RetryOptimization(kDebuggerHasBreakPoints); return RetryOptimization(kDebuggerHasBreakPoints);
} }
...@@ -967,8 +967,7 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) { ...@@ -967,8 +967,7 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info), ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
Code); Code);
if (FLAG_always_opt && isolate->use_crankshaft() && if (FLAG_always_opt && isolate->use_crankshaft()) {
!isolate->DebuggerHasBreakPoints()) {
Handle<Code> opt_code; Handle<Code> opt_code;
if (Compiler::GetOptimizedCode( if (Compiler::GetOptimizedCode(
function, result, function, result,
...@@ -1520,7 +1519,7 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) { ...@@ -1520,7 +1519,7 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) {
job->RetryOptimization(kOptimizationDisabled); job->RetryOptimization(kOptimizationDisabled);
} else if (info->HasAbortedDueToDependencyChange()) { } else if (info->HasAbortedDueToDependencyChange()) {
job->RetryOptimization(kBailedOutDueToDependencyChange); job->RetryOptimization(kBailedOutDueToDependencyChange);
} else if (isolate->DebuggerHasBreakPoints()) { } else if (isolate->debug()->has_break_points()) {
job->RetryOptimization(kDebuggerHasBreakPoints); job->RetryOptimization(kDebuggerHasBreakPoints);
} else if (job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) { } else if (job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) {
RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared); RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared);
......
...@@ -1361,8 +1361,7 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) { ...@@ -1361,8 +1361,7 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
static bool ShouldOptimizeNewClosure(Isolate* isolate, static bool ShouldOptimizeNewClosure(Isolate* isolate,
Handle<SharedFunctionInfo> info) { Handle<SharedFunctionInfo> info) {
return isolate->use_crankshaft() && !info->is_toplevel() && return isolate->use_crankshaft() && !info->is_toplevel() &&
info->is_compiled() && info->allows_lazy_compilation() && info->is_compiled() && info->allows_lazy_compilation();
!isolate->DebuggerHasBreakPoints();
} }
......
...@@ -25,11 +25,6 @@ SaveContext::SaveContext(Isolate* isolate) ...@@ -25,11 +25,6 @@ SaveContext::SaveContext(Isolate* isolate)
} }
bool Isolate::DebuggerHasBreakPoints() {
return debug()->has_break_points();
}
base::RandomNumberGenerator* Isolate::random_number_generator() { base::RandomNumberGenerator* Isolate::random_number_generator() {
if (random_number_generator_ == NULL) { if (random_number_generator_ == NULL) {
if (FLAG_random_seed != 0) { if (FLAG_random_seed != 0) {
......
...@@ -978,8 +978,6 @@ class Isolate { ...@@ -978,8 +978,6 @@ class Isolate {
Debug* debug() { return debug_; } Debug* debug() { return debug_; }
inline bool DebuggerHasBreakPoints();
CpuProfiler* cpu_profiler() const { return cpu_profiler_; } CpuProfiler* cpu_profiler() const { return cpu_profiler_; }
HeapProfiler* heap_profiler() const { return heap_profiler_; } HeapProfiler* heap_profiler() const { return heap_profiler_; }
......
...@@ -9461,7 +9461,7 @@ void JSFunction::AttemptConcurrentOptimization() { ...@@ -9461,7 +9461,7 @@ void JSFunction::AttemptConcurrentOptimization() {
} }
DCHECK(isolate->use_crankshaft()); DCHECK(isolate->use_crankshaft());
DCHECK(!IsInOptimizationQueue()); DCHECK(!IsInOptimizationQueue());
DCHECK(is_compiled() || isolate->DebuggerHasBreakPoints()); DCHECK(is_compiled() || isolate->debug()->has_break_points());
DCHECK(!IsOptimized()); DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
DCHECK(isolate->concurrent_recompilation_enabled()); DCHECK(isolate->concurrent_recompilation_enabled());
......
...@@ -113,11 +113,7 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { ...@@ -113,11 +113,7 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function,
int loop_nesting_levels) { int loop_nesting_levels) {
SharedFunctionInfo* shared = function->shared(); SharedFunctionInfo* shared = function->shared();
// See AlwaysFullCompiler (in compiler.cc) comment on why we need if (!FLAG_use_osr || function->IsBuiltin()) {
// Debug::has_break_points().
if (!FLAG_use_osr ||
isolate_->DebuggerHasBreakPoints() ||
function->IsBuiltin()) {
return; return;
} }
...@@ -147,7 +143,7 @@ void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, ...@@ -147,7 +143,7 @@ void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function,
void RuntimeProfiler::OptimizeNow() { void RuntimeProfiler::OptimizeNow() {
HandleScope scope(isolate_); HandleScope scope(isolate_);
if (!isolate_->use_crankshaft() || isolate_->DebuggerHasBreakPoints()) return; if (!isolate_->use_crankshaft()) return;
DisallowHeapAllocation no_gc; DisallowHeapAllocation no_gc;
......
...@@ -50,16 +50,13 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) { ...@@ -50,16 +50,13 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) {
DCHECK(isolate->use_crankshaft()); DCHECK(isolate->use_crankshaft());
Handle<Code> unoptimized(function->shared()->code()); Handle<Code> unoptimized(function->shared()->code());
if (function->shared()->optimization_disabled() || if (function->shared()->optimization_disabled()) {
isolate->DebuggerHasBreakPoints()) { // If the function is not optimizable continue using the code from the full
// If the function is not optimizable or debugger is active continue // compiler.
// using the code from the full compiler.
if (FLAG_trace_opt) { if (FLAG_trace_opt) {
PrintF("[failed to optimize "); OFStream os(stdout);
function->PrintName(); os << "[failed to optimize " << Brief(*function)
PrintF(": is code optimizable: %s, is debugger enabled: %s]\n", << ", code is not optimizable]" << std::endl;
function->shared()->optimization_disabled() ? "F" : "T",
isolate->DebuggerHasBreakPoints() ? "T" : "F");
} }
function->ReplaceCode(*unoptimized); function->ReplaceCode(*unoptimized);
return function->code(); return function->code();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment