Index: src/compilation-info.h |
diff --git a/src/compilation-info.h b/src/compilation-info.h |
index bd05639aabfaf80316d2026ea26a43e1a278afd5..422826a592cb6d29fc26e827b60699830f8f2db6 100644 |
--- a/src/compilation-info.h |
+++ b/src/compilation-info.h |
@@ -19,6 +19,7 @@ |
namespace v8 { |
namespace internal { |
+class CoverageInfo; |
class DeclarationScope; |
class DeferredHandles; |
class FunctionLiteral; |
@@ -51,6 +52,7 @@ class V8_EXPORT_PRIVATE CompilationInfo final { |
kBailoutOnUninitialized = 1 << 14, |
kOptimizeFromBytecode = 1 << 15, |
kLoopPeelingEnabled = 1 << 16, |
+ kBlockCoverageEnabled = 1 << 17, |
}; |
CompilationInfo(Zone* zone, ParseInfo* parse_info, Isolate* isolate, |
@@ -179,6 +181,12 @@ class V8_EXPORT_PRIVATE CompilationInfo final { |
bool is_loop_peeling_enabled() const { return GetFlag(kLoopPeelingEnabled); } |
+ void MarkAsBlockCoverageEnabled() { SetFlag(kBlockCoverageEnabled); } |
+ |
+ bool is_block_coverage_enabled() const { |
+ return GetFlag(kBlockCoverageEnabled); |
+ } |
+ |
bool GeneratePreagedPrologue() const { |
// Generate a pre-aged prologue if we are optimizing for size, which |
// will make code old more aggressive. Only apply to Code::FUNCTION, |
@@ -312,6 +320,12 @@ class V8_EXPORT_PRIVATE CompilationInfo final { |
SourcePositionTableBuilder::RecordingMode SourcePositionRecordingMode() const; |
+ bool has_coverage_info() const { return !coverage_info_.is_null(); } |
+ Handle<CoverageInfo> coverage_info() const { return coverage_info_; } |
+ void set_coverage_info(Handle<CoverageInfo> coverage_info) { |
+ coverage_info_ = coverage_info; |
+ } |
+ |
private: |
// Compilation mode. |
// BASE is generated by the full codegen, optionally prepared for bailouts. |
@@ -382,6 +396,10 @@ class V8_EXPORT_PRIVATE CompilationInfo final { |
Vector<const char> debug_name_; |
+ // Encapsulates coverage information gathered by the bytecode generator. |
+ // Needs to be stored on the shared function info once compilation completes. |
+ Handle<CoverageInfo> coverage_info_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
}; |