diff options
Diffstat (limited to 'deps/v8/src/compilation-info.h')
-rw-r--r-- | deps/v8/src/compilation-info.h | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/deps/v8/src/compilation-info.h b/deps/v8/src/compilation-info.h index 3fd35ea06e..c95664a62b 100644 --- a/deps/v8/src/compilation-info.h +++ b/deps/v8/src/compilation-info.h @@ -19,6 +19,7 @@ namespace v8 { namespace internal { +class CoverageInfo; class DeclarationScope; class DeferredHandles; class FunctionLiteral; @@ -38,19 +39,19 @@ class V8_EXPORT_PRIVATE CompilationInfo final { kNonDeferredCalling = 1 << 1, kSavesCallerDoubles = 1 << 2, kRequiresFrame = 1 << 3, - kDeoptimizationSupport = 1 << 4, - kAccessorInliningEnabled = 1 << 5, - kSerializing = 1 << 6, - kFunctionContextSpecializing = 1 << 7, - kFrameSpecializing = 1 << 8, - kInliningEnabled = 1 << 9, - kDisableFutureOptimization = 1 << 10, - kSplittingEnabled = 1 << 11, - kDeoptimizationEnabled = 1 << 12, - kSourcePositionsEnabled = 1 << 13, - kBailoutOnUninitialized = 1 << 14, - kOptimizeFromBytecode = 1 << 15, - kLoopPeelingEnabled = 1 << 16, + kAccessorInliningEnabled = 1 << 4, + kSerializing = 1 << 5, + kFunctionContextSpecializing = 1 << 6, + kFrameSpecializing = 1 << 7, + kInliningEnabled = 1 << 8, + kDisableFutureOptimization = 1 << 9, + kSplittingEnabled = 1 << 10, + kDeoptimizationEnabled = 1 << 11, + kSourcePositionsEnabled = 1 << 12, + kBailoutOnUninitialized = 1 << 13, + kOptimizeFromBytecode = 1 << 14, + kLoopPeelingEnabled = 1 << 15, + kBlockCoverageEnabled = 1 << 16, }; CompilationInfo(Zone* zone, ParseInfo* parse_info, Isolate* isolate, @@ -113,10 +114,8 @@ class V8_EXPORT_PRIVATE CompilationInfo final { // Compiles marked as debug produce unoptimized code with debug break slots. // Inner functions that cannot be compiled w/o context are compiled eagerly. - // Always include deoptimization support to avoid having to recompile again. void MarkAsDebug() { set_is_debug(); - SetFlag(kDeoptimizationSupport); } bool is_debug() const; @@ -179,10 +178,16 @@ 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 flushing more aggressive. Only apply to Code::FUNCTION, - // since StaticMarkingVisitor::IsFlushable only flushes proper functions. + // will make code old more aggressive. Only apply to Code::FUNCTION, + // since only functions are aged in the compilation cache. return FLAG_optimize_for_size && FLAG_age_code && !is_debug() && output_code_kind() == Code::FUNCTION; } @@ -219,13 +224,6 @@ class V8_EXPORT_PRIVATE CompilationInfo final { } // Deoptimization support. - bool HasDeoptimizationSupport() const { - return GetFlag(kDeoptimizationSupport); - } - void EnableDeoptimizationSupport() { - DCHECK_EQ(BASE, mode_); - SetFlag(kDeoptimizationSupport); - } bool ShouldEnsureSpaceForLazyDeopt() { return !IsStub(); } bool ExpectsJSReceiverAsReceiver(); @@ -269,10 +267,14 @@ class V8_EXPORT_PRIVATE CompilationInfo final { int optimization_id() const { return optimization_id_; } - int osr_expr_stack_height() { return osr_expr_stack_height_; } + int osr_expr_stack_height() { + DCHECK_GE(osr_expr_stack_height_, 0); + return osr_expr_stack_height_; + } void set_osr_expr_stack_height(int height) { - DCHECK(height >= 0); + DCHECK_EQ(osr_expr_stack_height_, -1); osr_expr_stack_height_ = height; + DCHECK_GE(osr_expr_stack_height_, 0); } bool has_simple_parameters(); @@ -280,18 +282,11 @@ class V8_EXPORT_PRIVATE CompilationInfo final { struct InlinedFunctionHolder { Handle<SharedFunctionInfo> shared_info; - // Root that holds the unoptimized code of the inlined function alive - // (and out of reach of code flushing) until we finish compilation. - // Do not remove. - Handle<Code> inlined_code_object_root; - InliningPosition position; InlinedFunctionHolder(Handle<SharedFunctionInfo> inlined_shared_info, - Handle<Code> inlined_code_object_root, SourcePosition pos) - : shared_info(inlined_shared_info), - inlined_code_object_root(inlined_code_object_root) { + : shared_info(inlined_shared_info) { position.position = pos; // initialized when generating the deoptimization literals position.inlined_function_id = DeoptimizationInputData::kNotInlinedIndex; @@ -319,6 +314,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. @@ -389,6 +390,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); }; |