Debugger: allow recompiling toplevel code for debugging.
authoryangguo <yangguo@chromium.org>
Tue, 30 Jun 2015 09:43:40 +0000 (02:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 30 Jun 2015 09:43:57 +0000 (09:43 +0000)
R=mvstanton@chromium.org
BUG=v8:4132
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29370}

src/compiler.cc
src/debug.cc

index 1013a8a..495ba4f 100644 (file)
@@ -1455,14 +1455,14 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
                                          literal->expected_property_count());
     live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
     return result;
-  } else {
-    // We may have additional data from compilation now.
+  } else if (!lazy) {
+    // We have additional data from compilation now.
     DCHECK(!existing->is_compiled());
     existing->ReplaceCode(*info.code());
     existing->set_scope_info(*scope_info);
     existing->set_feedback_vector(*info.feedback_vector());
-    return existing;
   }
+  return existing;
 }
 
 
index a689de0..d62586a 100644 (file)
@@ -1967,7 +1967,6 @@ void Debug::PrepareForBreakPoints() {
       Handle<SharedFunctionInfo> shared(function->shared());
 
       // If recompilation is not possible just skip it.
-      if (shared->is_toplevel()) continue;
       if (!shared->allows_lazy_compilation()) continue;
       if (shared->code()->kind() == Code::BUILTIN) continue;