[coverage] Fix SFI::IsInlineable for block binary coverage

Block binary coverage currently also relies on invocation counts on
the feedback vector, which are not maintained in optimized code. This
fixes the SFI::IsInlineable predicate to also prevent inlining
functions when 1. binary coverage is enabled and 2. the function has
no reported binary coverage.

Drive-by: Add new predicates for binary/count modes.

Bug: v8:6000
Change-Id: I0039e43ebae880e3552e8349d20a144fe941ef3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571615
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60920}
This commit is contained in:
Jakob Gruber 2019-04-18 13:20:17 +02:00 committed by Commit Bot
parent f434acc458
commit 47a690501d
3 changed files with 11 additions and 3 deletions

View File

@ -3668,7 +3668,7 @@ CodeTracer* Isolate::GetCodeTracer() {
bool Isolate::use_optimizer() {
return FLAG_opt && !serializer_enabled_ && CpuFeatures::SupportsOptimizer() &&
!is_precise_count_code_coverage() && !is_block_count_code_coverage();
!is_count_code_coverage();
}
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {

View File

@ -1071,6 +1071,14 @@ class Isolate final : private HiddenFactory {
return is_block_count_code_coverage() || is_block_binary_code_coverage();
}
bool is_binary_code_coverage() const {
return is_precise_binary_code_coverage() || is_block_binary_code_coverage();
}
bool is_count_code_coverage() const {
return is_precise_count_code_coverage() || is_block_count_code_coverage();
}
bool is_collecting_type_profile() const {
return type_profile_mode() == debug::TypeProfileMode::kCollect;
}

View File

@ -5335,10 +5335,10 @@ bool SharedFunctionInfo::IsInlineable() {
return false;
}
if (GetIsolate()->is_precise_binary_code_coverage() &&
if (GetIsolate()->is_binary_code_coverage() &&
!has_reported_binary_coverage()) {
// We may miss invocations if this function is inlined.
TraceInlining(*this, "false (requires precise binary coverage)");
TraceInlining(*this, "false (requires reported binary coverage)");
return false;
}