Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index a34f2df6968d603088a623b3bd4a65954565c45f..24cbb6f87eabfc6125713afd2132b8915326aad1 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -1328,8 +1328,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) { |
// We do not need to recompile to debug bytecode. |
if (baseline_exists && !shared->code()->has_debug_break_slots()) { |
- DCHECK(functions.length() > 0); |
- if (!Compiler::CompileDebugCode(functions.first())) return false; |
+ if (!Compiler::CompileDebugCode(shared)) return false; |
} |
for (Handle<JSFunction> const function : functions) { |
@@ -1527,44 +1526,9 @@ Handle<Object> Debug::FindSharedFunctionInfoInScript(Handle<Script> script, |
return shared_handle; |
} |
} |
- // If not, compile to reveal inner functions, if possible. |
- if (shared->allows_lazy_compilation()) { |
- HandleScope scope(isolate_); |
- if (!Compiler::CompileDebugCode(handle(shared))) break; |
- continue; |
- } |
- |
- // If not possible, comb the heap for the best suitable compile target. |
- JSFunction* closure; |
- { |
- HeapIterator it(isolate_->heap()); |
- SharedFunctionInfoFinder finder(position); |
- while (HeapObject* object = it.next()) { |
- JSFunction* candidate_closure = NULL; |
- SharedFunctionInfo* candidate = NULL; |
- if (object->IsJSFunction()) { |
- candidate_closure = JSFunction::cast(object); |
- candidate = candidate_closure->shared(); |
- } else if (object->IsSharedFunctionInfo()) { |
- candidate = SharedFunctionInfo::cast(object); |
- if (!candidate->allows_lazy_compilation()) continue; |
- } else { |
- continue; |
- } |
- if (candidate->script() == *script) { |
- finder.NewCandidate(candidate, candidate_closure); |
- } |
- } |
- closure = finder.ResultClosure(); |
- shared = finder.Result(); |
- } |
- if (shared == NULL) break; |
+ // If not, compile to reveal inner functions. |
HandleScope scope(isolate_); |
- if (closure == NULL) { |
- if (!Compiler::CompileDebugCode(handle(shared))) break; |
- } else { |
- if (!Compiler::CompileDebugCode(handle(closure))) break; |
- } |
+ if (!Compiler::CompileDebugCode(handle(shared))) break; |
} |
return isolate_->factory()->undefined_value(); |
} |