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

Unified Diff: src/feedback-vector.cc

Issue 2686063002: [debugger] add precise mode for code coverage. (Closed)
Patch Set: fix flag 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 | « src/feedback-vector.h ('k') | src/feedback-vector-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/feedback-vector.cc
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc
index cde673157f4bc871fcb02f88b8e87ff036db9e0e..b801d8b29b2617800c160a574b064e00f8a1ba96 100644
--- a/src/feedback-vector.cc
+++ b/src/feedback-vector.cc
@@ -230,7 +230,10 @@ Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate,
}
i += entry_size;
}
- return Handle<FeedbackVector>::cast(array);
+
+ Handle<FeedbackVector> result = Handle<FeedbackVector>::cast(array);
+ if (isolate->IsCodeCoverageEnabled()) AddToCodeCoverageList(isolate, result);
+ return result;
}
// static
@@ -239,9 +242,21 @@ Handle<FeedbackVector> FeedbackVector::Copy(Isolate* isolate,
Handle<FeedbackVector> result;
result = Handle<FeedbackVector>::cast(
isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector)));
+ if (isolate->IsCodeCoverageEnabled()) AddToCodeCoverageList(isolate, result);
return result;
}
+// static
+void FeedbackVector::AddToCodeCoverageList(Isolate* isolate,
+ Handle<FeedbackVector> vector) {
+ DCHECK(isolate->IsCodeCoverageEnabled());
+ if (!vector->shared_function_info()->IsSubjectToDebugging()) return;
+ Handle<ArrayList> list =
+ Handle<ArrayList>::cast(isolate->factory()->code_coverage_list());
+ list = ArrayList::Add(list, vector);
+ isolate->SetCodeCoverageList(*list);
+}
+
// This logic is copied from
// StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget.
static bool ClearLogic(Isolate* isolate) {
« no previous file with comments | « src/feedback-vector.h ('k') | src/feedback-vector-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698