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

Unified Diff: src/factory.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Comment nit Created 3 years, 7 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 606b6e4b5499f43296bbeaf6fc63f2887f17a88a..8fb8c2fa72b38f6cc164820e93f9dd73c01e63a5 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2483,6 +2483,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
share->set_instance_class_name(*Object_string());
share->set_script(*undefined_value(), SKIP_WRITE_BARRIER);
share->set_debug_info(Smi::kZero, SKIP_WRITE_BARRIER);
+ share->set_coverage_info(Smi::kZero, SKIP_WRITE_BARRIER);
share->set_function_identifier(*undefined_value(), SKIP_WRITE_BARRIER);
StaticFeedbackVectorSpec empty_spec;
Handle<FeedbackMetadata> feedback_metadata =
@@ -2615,6 +2616,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.from, range.to);
+ }
+
+ return info;
+}
+
Handle<BreakPointInfo> Factory::NewBreakPointInfo(int source_position) {
Handle<BreakPointInfo> new_break_point_info =
Handle<BreakPointInfo>::cast(NewStruct(TUPLE2_TYPE));

Powered by Google App Engine
This is Rietveld 408576698