DCHECK(!info()->IsCompilingForDebugging());
// 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);
}
ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
Code);
- if (FLAG_always_opt && isolate->use_crankshaft() &&
- !isolate->DebuggerHasBreakPoints()) {
+ if (FLAG_always_opt && isolate->use_crankshaft()) {
Handle<Code> opt_code;
if (Compiler::GetOptimizedCode(
function, result,
job->RetryOptimization(kOptimizationDisabled);
} else if (info->HasAbortedDueToDependencyChange()) {
job->RetryOptimization(kBailedOutDueToDependencyChange);
- } else if (isolate->DebuggerHasBreakPoints()) {
+ } else if (isolate->debug()->has_break_points()) {
job->RetryOptimization(kDebuggerHasBreakPoints);
} else if (job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) {
RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared);
static bool ShouldOptimizeNewClosure(Isolate* isolate,
Handle<SharedFunctionInfo> info) {
return isolate->use_crankshaft() && !info->is_toplevel() &&
- info->is_compiled() && info->allows_lazy_compilation() &&
- !isolate->DebuggerHasBreakPoints();
+ info->is_compiled() && info->allows_lazy_compilation();
}
}
-bool Isolate::DebuggerHasBreakPoints() {
- return debug()->has_break_points();
-}
-
-
base::RandomNumberGenerator* Isolate::random_number_generator() {
if (random_number_generator_ == NULL) {
if (FLAG_random_seed != 0) {
Debug* debug() { return debug_; }
- inline bool DebuggerHasBreakPoints();
-
CpuProfiler* cpu_profiler() const { return cpu_profiler_; }
HeapProfiler* heap_profiler() const { return heap_profiler_; }
}
DCHECK(isolate->use_crankshaft());
DCHECK(!IsInOptimizationQueue());
- DCHECK(is_compiled() || isolate->DebuggerHasBreakPoints());
+ DCHECK(is_compiled() || isolate->debug()->has_break_points());
DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
DCHECK(isolate->concurrent_recompilation_enabled());
void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function,
int loop_nesting_levels) {
SharedFunctionInfo* shared = function->shared();
- // See AlwaysFullCompiler (in compiler.cc) comment on why we need
- // Debug::has_break_points().
- if (!FLAG_use_osr ||
- isolate_->DebuggerHasBreakPoints() ||
- function->IsBuiltin()) {
+ if (!FLAG_use_osr || function->IsBuiltin()) {
return;
}
void RuntimeProfiler::OptimizeNow() {
HandleScope scope(isolate_);
- if (!isolate_->use_crankshaft() || isolate_->DebuggerHasBreakPoints()) return;
+ if (!isolate_->use_crankshaft()) return;
DisallowHeapAllocation no_gc;
DCHECK(isolate->use_crankshaft());
Handle<Code> unoptimized(function->shared()->code());
- if (function->shared()->optimization_disabled() ||
- isolate->DebuggerHasBreakPoints()) {
- // If the function is not optimizable or debugger is active continue
- // using the code from the full compiler.
+ if (function->shared()->optimization_disabled()) {
+ // If the function is not optimizable continue using the code from the full
+ // compiler.
if (FLAG_trace_opt) {
- PrintF("[failed to optimize ");
- function->PrintName();
- PrintF(": is code optimizable: %s, is debugger enabled: %s]\n",
- function->shared()->optimization_disabled() ? "F" : "T",
- isolate->DebuggerHasBreakPoints() ? "T" : "F");
+ OFStream os(stdout);
+ os << "[failed to optimize " << Brief(*function)
+ << ", code is not optimizable]" << std::endl;
}
function->ReplaceCode(*unoptimized);
return function->code();