#include "src/debug/debug-coverage.h"
#include "src/ast/ast-source-ranges.h"
#include "src/base/hashmap.h"
#include "src/common/assert-scope.h"
#include "src/common/globals.h"
#include "src/debug/debug.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/execution/frames-inl.h"
#include "src/execution/isolate.h"
#include "src/objects/objects.h"
namespace v8 {
namespace internal {
class SharedToCounterMap
: public base::TemplateHashMapImpl<Tagged<SharedFunctionInfo>, uint32_t,
base::KeyEqualityMatcher<Tagged<Object>>,
base::DefaultAllocationPolicy> { … };
namespace {
int StartPosition(Tagged<SharedFunctionInfo> info) { … }
bool CompareCoverageBlock(const CoverageBlock& a, const CoverageBlock& b) { … }
void SortBlockData(std::vector<CoverageBlock>& v) { … }
std::vector<CoverageBlock> GetSortedBlockData(
Isolate* isolate, Tagged<SharedFunctionInfo> shared) { … }
class CoverageBlockIterator final { … };
bool HaveSameSourceRange(const CoverageBlock& lhs, const CoverageBlock& rhs) { … }
void MergeDuplicateRanges(CoverageFunction* function) { … }
void RewritePositionSingletonsToRanges(CoverageFunction* function) { … }
void MergeConsecutiveRanges(CoverageFunction* function) { … }
void MergeNestedRanges(CoverageFunction* function) { … }
void RewriteFunctionScopeCounter(CoverageFunction* function) { … }
void FilterAliasedSingletons(CoverageFunction* function) { … }
void FilterUncoveredRanges(CoverageFunction* function) { … }
void FilterEmptyRanges(CoverageFunction* function) { … }
void ClampToBinary(CoverageFunction* function) { … }
void ResetAllBlockCounts(Isolate* isolate, Tagged<SharedFunctionInfo> shared) { … }
bool IsBlockMode(debug::CoverageMode mode) { … }
bool IsBinaryMode(debug::CoverageMode mode) { … }
void CollectBlockCoverageInternal(Isolate* isolate, CoverageFunction* function,
Tagged<SharedFunctionInfo> info,
debug::CoverageMode mode) { … }
void CollectBlockCoverage(Isolate* isolate, CoverageFunction* function,
Tagged<SharedFunctionInfo> info,
debug::CoverageMode mode) { … }
void PrintBlockCoverage(const CoverageFunction* function,
Tagged<SharedFunctionInfo> info,
bool has_nonempty_source_range,
bool function_is_relevant) { … }
void CollectAndMaybeResetCounts(Isolate* isolate,
SharedToCounterMap* counter_map,
v8::debug::CoverageMode coverage_mode) { … }
struct SharedFunctionInfoAndCount { … };
}
std::unique_ptr<Coverage> Coverage::CollectPrecise(Isolate* isolate) { … }
std::unique_ptr<Coverage> Coverage::CollectBestEffort(Isolate* isolate) { … }
std::unique_ptr<Coverage> Coverage::Collect(
Isolate* isolate, v8::debug::CoverageMode collectionMode) { … }
void Coverage::SelectMode(Isolate* isolate, debug::CoverageMode mode) { … }
}
}