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 1013a8ae0620dfdd1230f3e446f16b658268892d..495ba4f6c4d0a6ba4af585182011a8aa642002e7 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 a689de08ae6c9e1dcc6f5d4a7076e7576414e87a..d62586a2e5c7a796135ac3e44ba25f855510e529 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;