Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: src/debug/debug.cc

Issue 2497213002: [debugger] simplify compile for debugging. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/compiler.cc ('K') | « src/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« src/compiler.cc ('K') | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698