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)); |