Commit 90e764b2 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debug] remove --block-coverage.

Change the default to false. Block coverage will need to be
enabled explicitly via inspector protocol, which is already
being done.

R=franzih@chromium.org

Bug: v8:6738
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I08684ce7b501981bc376a6bc6181fabac9628a63
Reviewed-on: https://chromium-review.googlesource.com/689234Reviewed-by: 's avatarFranziska Hinkelmann <franzih@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48235}
parent b455ec11
......@@ -299,8 +299,7 @@ void InstallUnoptimizedCode(CompilationInfo* compilation_info) {
// Install coverage info on the shared function info.
if (compilation_info->has_coverage_info()) {
DCHECK(FLAG_block_coverage &&
compilation_info->isolate()->is_block_code_coverage());
DCHECK(compilation_info->isolate()->is_block_code_coverage());
compilation_info->isolate()->debug()->InstallCoverageInfo(
compilation_info->shared_info(), compilation_info->coverage_info());
}
......
......@@ -2639,8 +2639,6 @@ DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
#undef DEBUG_BREAK
void BytecodeGraphBuilder::VisitIncBlockCounter() {
DCHECK(FLAG_block_coverage);
Node* closure = GetFunctionClosure();
Node* coverage_array_slot =
jsgraph()->Constant(bytecode_iterator().GetIndexOperand(0));
......
......@@ -2820,10 +2820,7 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[], bool last_run) {
{
EnsureEventLoopInitialized(isolate);
if (options.lcov_file) {
debug::Coverage::Mode mode = i::FLAG_block_coverage
? debug::Coverage::kBlockCount
: debug::Coverage::kPreciseCount;
debug::Coverage::SelectMode(isolate, mode);
debug::Coverage::SelectMode(isolate, debug::Coverage::kBlockCount);
}
HandleScope scope(isolate);
Local<Context> context = CreateEvaluationContext(isolate);
......
......@@ -69,7 +69,6 @@ bool CompareCoverageBlock(const CoverageBlock& a, const CoverageBlock& b) {
std::vector<CoverageBlock> GetSortedBlockData(Isolate* isolate,
SharedFunctionInfo* shared) {
DCHECK(FLAG_block_coverage);
DCHECK(shared->HasCoverageInfo());
CoverageInfo* coverage_info =
......@@ -325,7 +324,6 @@ void ClampToBinary(CoverageFunction* function) {
}
void ResetAllBlockCounts(SharedFunctionInfo* shared) {
DCHECK(FLAG_block_coverage);
DCHECK(shared->HasCoverageInfo());
CoverageInfo* coverage_info =
......@@ -349,7 +347,6 @@ bool IsBlockMode(debug::Coverage::Mode mode) {
void CollectBlockCoverage(Isolate* isolate, CoverageFunction* function,
SharedFunctionInfo* info,
debug::Coverage::Mode mode) {
DCHECK(FLAG_block_coverage);
DCHECK(IsBlockMode(mode));
function->has_block_coverage = true;
......@@ -493,8 +490,7 @@ std::unique_ptr<Coverage> Coverage::Collect(
Handle<String> name(info->DebugName(), isolate);
CoverageFunction function(start, end, count, name);
if (FLAG_block_coverage && IsBlockMode(collectionMode) &&
info->HasCoverageInfo()) {
if (IsBlockMode(collectionMode) && info->HasCoverageInfo()) {
CollectBlockCoverage(isolate, &function, info, collectionMode);
}
......@@ -523,7 +519,7 @@ void Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
// recording is stopped. Since we delete coverage infos at that point, any
// following coverage recording (without reloads) will be at function
// granularity.
if (FLAG_block_coverage) isolate->debug()->RemoveAllCoverageInfos();
isolate->debug()->RemoveAllCoverageInfos();
isolate->SetCodeCoverageList(isolate->heap()->undefined_value());
break;
case debug::Coverage::kBlockBinary:
......
......@@ -336,7 +336,7 @@ bool Debug::Load() {
void Debug::Unload() {
ClearAllBreakPoints();
ClearStepping();
if (FLAG_block_coverage) RemoveAllCoverageInfos();
RemoveAllCoverageInfos();
RemoveDebugDelegate();
// Return debugger is not loaded.
......@@ -1344,7 +1344,6 @@ Handle<DebugInfo> Debug::GetOrCreateDebugInfo(
void Debug::InstallCoverageInfo(Handle<SharedFunctionInfo> shared,
Handle<CoverageInfo> coverage_info) {
DCHECK(FLAG_block_coverage);
DCHECK(!coverage_info.is_null());
Handle<DebugInfo> debug_info = GetOrCreateDebugInfo(shared);
......@@ -1356,7 +1355,6 @@ void Debug::InstallCoverageInfo(Handle<SharedFunctionInfo> shared,
}
void Debug::RemoveAllCoverageInfos() {
DCHECK(FLAG_block_coverage);
ClearAllDebugInfos(
[=](Handle<DebugInfo> info) { return info->ClearCoverageInfo(); });
}
......
......@@ -298,10 +298,8 @@ DEFINE_IMPLICATION(track_computed_fields, track_fields)
DEFINE_BOOL(track_field_types, true, "track field types")
DEFINE_IMPLICATION(track_field_types, track_fields)
DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
DEFINE_BOOL(block_coverage, true, "enable block code coverage")
DEFINE_BOOL(trace_block_coverage, false,
"trace collected block coverage information")
DEFINE_IMPLICATION(trace_block_coverage, block_coverage)
DEFINE_BOOL(feedback_normalization, false,
"feed back normalization to constructors")
// TODO(jkummerow): This currently adds too much load on the stub cache.
......
......@@ -245,9 +245,8 @@ void V8ProfilerAgentImpl::restore() {
false)) {
bool callCount = m_state->booleanProperty(
ProfilerAgentState::preciseCoverageCallCount, false);
bool detailed =
m_state->booleanProperty(ProfilerAgentState::preciseCoverageDetailed,
v8::internal::FLAG_block_coverage);
bool detailed = m_state->booleanProperty(
ProfilerAgentState::preciseCoverageDetailed, false);
startPreciseCoverage(Maybe<bool>(callCount), Maybe<bool>(detailed));
}
}
......@@ -283,7 +282,7 @@ Response V8ProfilerAgentImpl::startPreciseCoverage(Maybe<bool> callCount,
Maybe<bool> detailed) {
if (!m_enabled) return Response::Error("Profiler is not enabled");
bool callCountValue = callCount.fromMaybe(false);
bool detailedValue = detailed.fromMaybe(v8::internal::FLAG_block_coverage);
bool detailedValue = detailed.fromMaybe(false);
m_state->setBoolean(ProfilerAgentState::preciseCoverageStarted, true);
m_state->setBoolean(ProfilerAgentState::preciseCoverageCallCount,
callCountValue);
......
......@@ -798,7 +798,6 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info)
catch_prediction_(HandlerTable::UNCAUGHT) {
DCHECK_EQ(closure_scope(), closure_scope()->GetClosureScope());
if (info->has_source_range_map()) {
DCHECK(FLAG_block_coverage);
block_coverage_builder_ = new (zone())
BlockCoverageBuilder(zone(), builder(), info->source_range_map());
}
......
......@@ -13408,7 +13408,6 @@ bool SharedFunctionInfo::HasCoverageInfo() const {
if (!HasDebugInfo()) return false;
DebugInfo* info = DebugInfo::cast(debug_info());
bool has_coverage_info = info->HasCoverageInfo();
DCHECK_IMPLIES(has_coverage_info, FLAG_block_coverage);
return has_coverage_info;
}
......
......@@ -175,7 +175,6 @@ bool DebugInfo::HasCoverageInfo() const {
}
bool DebugInfo::ClearCoverageInfo() {
DCHECK(FLAG_block_coverage);
if (HasCoverageInfo()) {
Isolate* isolate = GetIsolate();
......@@ -301,34 +300,29 @@ int BreakPointInfo::GetBreakPointCount() {
}
int CoverageInfo::SlotCount() const {
DCHECK(FLAG_block_coverage);
DCHECK_EQ(kFirstSlotIndex, length() % kSlotIndexCount);
return (length() - kFirstSlotIndex) / kSlotIndexCount;
}
int CoverageInfo::StartSourcePosition(int slot_index) const {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
return Smi::ToInt(get(slot_start + kSlotStartSourcePositionIndex));
}
int CoverageInfo::EndSourcePosition(int slot_index) const {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
return Smi::ToInt(get(slot_start + kSlotEndSourcePositionIndex));
}
int CoverageInfo::BlockCount(int slot_index) const {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
return Smi::ToInt(get(slot_start + kSlotBlockCountIndex));
}
void CoverageInfo::InitializeSlot(int slot_index, int from_pos, int to_pos) {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
set(slot_start + kSlotStartSourcePositionIndex, Smi::FromInt(from_pos));
......@@ -337,7 +331,6 @@ void CoverageInfo::InitializeSlot(int slot_index, int from_pos, int to_pos) {
}
void CoverageInfo::IncrementBlockCount(int slot_index) {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
const int old_count = BlockCount(slot_index);
......@@ -345,7 +338,6 @@ void CoverageInfo::IncrementBlockCount(int slot_index) {
}
void CoverageInfo::ResetBlockCount(int slot_index) {
DCHECK(FLAG_block_coverage);
DCHECK_LT(slot_index, SlotCount());
const int slot_start = CoverageInfo::FirstIndexForSlot(slot_index);
set(slot_start + kSlotBlockCountIndex, Smi::kZero);
......
......@@ -152,12 +152,8 @@ void ParseInfo::InitFromIsolate(Isolate* isolate) {
set_unicode_cache(isolate->unicode_cache());
set_runtime_call_stats(isolate->counters()->runtime_call_stats());
set_ast_string_constants(isolate->ast_string_constants());
if (FLAG_block_coverage && isolate->is_block_code_coverage()) {
set_block_coverage_enabled();
}
if (isolate->is_collecting_type_profile()) {
set_collect_type_profile();
}
if (isolate->is_block_code_coverage()) set_block_coverage_enabled();
if (isolate->is_collecting_type_profile()) set_collect_type_profile();
}
void ParseInfo::UpdateStatisticsAfterBackgroundParse(Isolate* isolate) {
......
......@@ -1989,8 +1989,6 @@ RUNTIME_FUNCTION(Runtime_IncBlockCounter) {
CONVERT_ARG_CHECKED(JSFunction, function, 0);
CONVERT_SMI_ARG_CHECKED(coverage_array_slot_index, 1);
DCHECK(FLAG_block_coverage);
// It's quite possible that a function contains IncBlockCounter bytecodes, but
// no coverage info exists. This happens e.g. by selecting the best-effort
// coverage collection mode, which triggers deletion of all coverage infos in
......
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