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

Unified Diff: src/factory.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Address comments Created 3 years, 6 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/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 4fa6925b4a515a9a8c6da50288f3852a7bfa773d..23c3034937e2359f59b5646323eabaff2ac1c82b 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2608,6 +2608,22 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
return debug_info;
}
+Handle<CoverageInfo> Factory::NewCoverageInfo(
+ const ZoneVector<SourceRange>& slots) {
+ const int slot_count = static_cast<int>(slots.size());
+
+ const int length = CoverageInfo::FixedArrayLengthForSlotCount(slot_count);
+ Handle<CoverageInfo> info =
+ Handle<CoverageInfo>::cast(NewUninitializedFixedArray(length));
+
+ for (int i = 0; i < slot_count; i++) {
+ SourceRange range = slots[i];
+ info->InitializeSlot(i, range.start, range.end);
+ }
+
+ return info;
+}
+
Handle<BreakPointInfo> Factory::NewBreakPointInfo(int source_position) {
Handle<BreakPointInfo> new_break_point_info =
Handle<BreakPointInfo>::cast(NewStruct(TUPLE2_TYPE));
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698