Commit 8c33e289 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[coverage] Enable optimizations in block coverage modes

Now that function counts are based on dedicated call counters instead
of FeedbackVector::invocation_count, we can enable optimizations for
block coverage modes.

This significantly speeds up V8 with enabled coverage:

Before this CL, the web-tooling-benchmark regressed by 70% (block
count coverage vs. no coverage).  With this CL, the regression is
reduced to 40%.

Bug: v8:6000,v8:9148
Change-Id: I6bb538bd66f32f016c66c1d1996bce3b25958232
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615241
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61582}
parent ba7b25e5
...@@ -3696,7 +3696,7 @@ CodeTracer* Isolate::GetCodeTracer() { ...@@ -3696,7 +3696,7 @@ CodeTracer* Isolate::GetCodeTracer() {
bool Isolate::use_optimizer() { bool Isolate::use_optimizer() {
return FLAG_opt && !serializer_enabled_ && CpuFeatures::SupportsOptimizer() && return FLAG_opt && !serializer_enabled_ && CpuFeatures::SupportsOptimizer() &&
!is_count_code_coverage(); !is_precise_count_code_coverage();
} }
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const { bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
......
...@@ -5251,7 +5251,7 @@ bool SharedFunctionInfo::IsInlineable() { ...@@ -5251,7 +5251,7 @@ bool SharedFunctionInfo::IsInlineable() {
return false; return false;
} }
if (GetIsolate()->is_binary_code_coverage() && if (GetIsolate()->is_precise_binary_code_coverage() &&
!has_reported_binary_coverage()) { !has_reported_binary_coverage()) {
// We may miss invocations if this function is inlined. // We may miss invocations if this function is inlined.
TraceInlining(*this, "false (requires reported binary coverage)"); TraceInlining(*this, "false (requires reported binary coverage)");
......
...@@ -221,7 +221,7 @@ Running test: testPreciseCountCoverageIncremental ...@@ -221,7 +221,7 @@ Running test: testPreciseCountCoverageIncremental
result : { result : {
result : { result : {
type : string type : string
value : unoptimized value : optimized
} }
} }
} }
...@@ -262,10 +262,15 @@ Running test: testPreciseCountCoverageIncremental ...@@ -262,10 +262,15 @@ Running test: testPreciseCountCoverageIncremental
startOffset : 74 startOffset : 74
} }
[1] : { [1] : {
count : 0 count : 1
endOffset : 156 endOffset : 156
startOffset : 143 startOffset : 143
} }
[2] : {
count : 1
endOffset : 172
startOffset : 157
}
] ]
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment