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

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

Issue 2769063004: Revert of [debug] do not report unnecessary coverage data. (Closed)
Patch Set: Created 3 years, 9 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/debug/debug-coverage.h ('k') | 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 c30c017c7d66bc1488bfa7edc4904520959dc040..26a61bc5e486769505614d0db5776c9be2772ed4 100644
--- a/src/debug/debug-coverage.cc
+++ b/src/debug/debug-coverage.cc
@@ -121,7 +121,7 @@
// Create and add new script data.
Handle<Script> script_handle(script, isolate);
- result->emplace_back(script_handle);
+ result->emplace_back(isolate, script_handle);
std::vector<CoverageFunction>* functions = &result->back().functions;
std::vector<SharedFunctionInfo*> sorted;
@@ -135,18 +135,11 @@
std::sort(sorted.begin(), sorted.end(), CompareSharedFunctionInfo);
}
- // Stack to track nested functions, referring function by index.
- std::vector<size_t> nesting;
-
// Use sorted list to reconstruct function nesting.
for (SharedFunctionInfo* info : sorted) {
int start = StartPosition(info);
int end = info->end_position();
uint32_t count = counter_map.Get(info);
- // Find the correct outer function based on start position.
- while (!nesting.empty() && functions->at(nesting.back()).end <= start) {
- nesting.pop_back();
- }
if (count != 0) {
switch (collectionMode) {
case v8::debug::Coverage::kPreciseCount:
@@ -159,18 +152,10 @@
count = 1;
break;
}
- } else if (nesting.empty() || functions->at(nesting.back()).count == 0) {
- // Only include a function range if it has a non-0 count, or
- // if it is directly nested inside a function with non-0 count.
- continue;
}
Handle<String> name(info->DebugName(), isolate);
- nesting.push_back(functions->size());
functions->emplace_back(start, end, count, name);
}
-
- // Remove entries for scripts that have no coverage.
- if (functions->empty()) result->pop_back();
}
return result;
}
« no previous file with comments | « src/debug/debug-coverage.h ('k') | test/inspector/cpu-profiler/coverage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698