Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: src/debug/debug-interface.h

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Two fixes Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/debug/debug-interface.h
diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h
index ffe34c112ebb4c521bf4c7b0c54590450c550110..eb3af74e55c042a63ddcee62de0cdc9a5751c5b3 100644
--- a/src/debug/debug-interface.h
+++ b/src/debug/debug-interface.h
@@ -17,6 +17,7 @@
namespace v8 {
namespace internal {
+struct CoverageBlock;
struct CoverageFunction;
struct CoverageScript;
class Coverage;
@@ -245,10 +246,28 @@ class V8_EXPORT_PRIVATE Coverage {
// We are only interested in a yes/no result for the function. Optimization
// and GC can be allowed once a function has been invoked. Collecting
// precise binary coverage resets counters for incremental updates.
- kPreciseBinary
+ kPreciseBinary,
+ // Similar to the precise coverage modes but provides coverage at a
+ // lower granularity. See go/v8-designdoc-block-code-coverage.
+ kBlockCount,
};
- class ScriptData; // Forward declaration.
+ // Forward declarations.
+ class ScriptData;
+ class FunctionData;
+
+ class V8_EXPORT_PRIVATE BlockData {
+ public:
+ int StartOffset() const;
+ int EndOffset() const;
+ uint32_t Count() const;
+
+ private:
+ explicit BlockData(i::CoverageBlock* block) : block_(block) {}
+ i::CoverageBlock* block_;
+
+ friend class v8::debug::Coverage::FunctionData;
+ };
class V8_EXPORT_PRIVATE FunctionData {
public:
@@ -256,6 +275,8 @@ class V8_EXPORT_PRIVATE Coverage {
int EndOffset() const;
uint32_t Count() const;
MaybeLocal<String> Name() const;
+ size_t BlockCount() const;
+ BlockData GetBlockData(size_t i) const;
private:
explicit FunctionData(i::CoverageFunction* function)

Powered by Google App Engine
This is Rietveld 408576698