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

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

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Address comments Created 3 years, 6 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
« no previous file with comments | « src/debug/debug-coverage.cc ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-interface.h
diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h
index ffe34c112ebb4c521bf4c7b0c54590450c550110..6ed383aeebf2b4ff1924a775ed3b1ea07cb46a8d 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. Design doc: goo.gl/lA2swZ.
+ 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)
« no previous file with comments | « src/debug/debug-coverage.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698