// 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. #ifndef V8_DEBUG_DEBUG_COVERAGE_H_ #define V8_DEBUG_DEBUG_COVERAGE_H_ #include #include "src/debug/debug-interface.h" #include "src/objects.h" namespace v8 { namespace internal { // Forward declaration. class Isolate; struct CoverageBlock { CoverageBlock(int s, int e, uint32_t c) : start(s), end(e), count(c) {} CoverageBlock() : CoverageBlock(kNoSourcePosition, kNoSourcePosition, 0) {} int start; int end; uint32_t count; }; struct CoverageFunction { CoverageFunction(int s, int e, uint32_t c, Handle n) : start(s), end(e), count(c), name(n), has_block_coverage(false) {} int start; int end; uint32_t count; Handle name; // Blocks are sorted by start position, from outer to inner blocks. std::vector blocks; bool has_block_coverage; }; struct CoverageScript { // Initialize top-level function in case it has been garbage-collected. explicit CoverageScript(Handle