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

Unified Diff: src/debug/debug.cc

Issue 1285793002: Debugger: correctly find closure to recompile eval for debugging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mark toplevel eval as not allow recompile without context Created 5 years, 4 months 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
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/regress/regress-crbug-517592.js » ('j') | 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 891c92e59e30a28492d0ea6d2554db9aa367f4b0..55837342eb9e9547ea300f6d331fbe519ddfc1b9 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1528,10 +1528,12 @@ class SharedFunctionInfoFinder {
if (current_candidate_ != NULL) {
if (current_start_position_ == start_position &&
shared->end_position() == current_candidate_->end_position()) {
+ // If we already have a matching closure, do not throw it away.
+ if (current_candidate_closure_ != NULL && closure == NULL) return;
// If a top-level function contains only one function
// declaration the source for the top-level and the function
// is the same. In that case prefer the non top-level function.
- if (shared->is_toplevel()) return;
+ if (!current_candidate_->is_toplevel() && shared->is_toplevel()) return;
} else if (start_position < current_start_position_ ||
current_candidate_->end_position() < shared->end_position()) {
return;
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/regress/regress-crbug-517592.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698