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

Unified Diff: src/debug/debug-coverage.cc

Issue 2723003007: [debugger] remove default count for top-level functions. (Closed)
Patch Set: fix url Created 3 years, 10 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 | « no previous file | test/inspector/cpu-profiler/coverage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-coverage.cc
diff --git a/src/debug/debug-coverage.cc b/src/debug/debug-coverage.cc
index 8a13b6c92dc5facc5e738d6eb5e673a8b5098fcb..25d80cedf00012ef191774e768d1b491595ff45b 100644
--- a/src/debug/debug-coverage.cc
+++ b/src/debug/debug-coverage.cc
@@ -103,27 +103,16 @@ Coverage* Coverage::Collect(Isolate* isolate, bool reset_count) {
std::vector<CoverageFunction>* functions = &result->back().functions;
std::vector<SharedFunctionInfo*> sorted;
- bool has_toplevel = false;
{
// Sort functions by start position, from outer to inner functions.
SharedFunctionInfo::ScriptIterator infos(script_handle);
while (SharedFunctionInfo* info = infos.Next()) {
- has_toplevel |= info->is_toplevel();
sorted.push_back(info);
}
std::sort(sorted.begin(), sorted.end(), CompareSharedFunctionInfo);
}
- functions->reserve(sorted.size() + (has_toplevel ? 0 : 1));
-
- if (!has_toplevel) {
- // Add a replacement toplevel function if it does not exist.
- int source_end = String::cast(script->source())->length();
- functions->emplace_back(0, source_end, 1u,
- isolate->factory()->empty_string());
- }
-
// Use sorted list to reconstruct function nesting.
for (SharedFunctionInfo* info : sorted) {
int start = StartPosition(info);
« no previous file with comments | « no previous file | test/inspector/cpu-profiler/coverage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698