chromium/v8/src/debug/debug-coverage.cc

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// A utility class to simplify logic for performing passes over block coverage
// ranges. Provides access to the implicit tree structure of ranges (i.e. access
// to parent and sibling blocks), and supports efficient in-place editing and
// deletion. The underlying backing store is the array of CoverageBlocks stored
// on the CoverageFunction.
class CoverageBlockIterator final {};

bool HaveSameSourceRange(const CoverageBlock& lhs, const CoverageBlock& rhs) {}

void MergeDuplicateRanges(CoverageFunction* function) {}

// Rewrite position singletons (produced by unconditional control flow
// like return statements, and by continuation counters) into source
// ranges that end at the next sibling range or the end of the parent
// range, whichever comes first.
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) {}

// A {SFI, count} tuple is used to sort by source range (stored on
// the SFI) and call count (in the counter map).
struct SharedFunctionInfoAndCount {};

}  // anonymous namespace

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) {}

}  // namespace internal
}  // namespace v8