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