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

Unified Diff: src/debug/debug.h

Issue 1682853004: [interpreter, debugger] implement bytecode break location iterator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix build Created 4 years, 10 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 | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.h
diff --git a/src/debug/debug.h b/src/debug/debug.h
index a4dbce484f67f0d9d5f9ab595ddf69a648d52cbb..78ab81ff2a27efbc48e97b1b112786d862c8a774 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -16,6 +16,7 @@
#include "src/flags.h"
#include "src/frames.h"
#include "src/hashmap.h"
+#include "src/interpreter/source-position-table.h"
#include "src/runtime/runtime.h"
#include "src/string-stream.h"
#include "src/v8threads.h"
@@ -84,6 +85,10 @@ class BreakLocation {
inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; }
inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; }
+ inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
+ inline bool IsDebuggerStatement() const {
+ return type_ == DEBUGGER_STATEMENT;
+ }
inline bool HasBreakPoint() const {
return debug_info_->HasBreakPoint(code_offset_);
}
@@ -106,7 +111,7 @@ class BreakLocation {
return debug_info_->abstract_code();
}
- private:
+ protected:
enum DebugBreakType {
NOT_DEBUG_BREAK,
DEBUGGER_STATEMENT,
@@ -136,7 +141,7 @@ class BreakLocation {
inline int statement_position() const { return statement_position_; }
protected:
- Iterator(Handle<DebugInfo> debug_info, BreakLocatorType type);
+ explicit Iterator(Handle<DebugInfo> debug_info);
Handle<DebugInfo> debug_info_;
int break_index_;
@@ -151,7 +156,7 @@ class BreakLocation {
class CodeIterator : public Iterator {
public:
CodeIterator(Handle<DebugInfo> debug_info, BreakLocatorType type);
- ~CodeIterator() override{};
+ ~CodeIterator() override {}
BreakLocation GetBreakLocation() override;
bool Done() const override { return reloc_iterator_.done(); }
@@ -172,9 +177,32 @@ class BreakLocation {
DISALLOW_COPY_AND_ASSIGN(CodeIterator);
};
+ class BytecodeArrayIterator : public Iterator {
+ public:
+ BytecodeArrayIterator(Handle<DebugInfo> debug_info, BreakLocatorType type);
+ ~BytecodeArrayIterator() override {}
+
+ BreakLocation GetBreakLocation() override;
+ bool Done() const override { return source_position_iterator_.done(); }
+ void Next() override;
+
+ int code_offset() override {
+ return source_position_iterator_.bytecode_offset();
+ }
+
+ private:
+ DebugBreakType GetDebugBreakType();
+
+ interpreter::SourcePositionTableIterator source_position_iterator_;
+ BreakLocatorType break_locator_type_;
+ int start_position_;
+ DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator);
+ };
+
static Iterator* GetIterator(Handle<DebugInfo> debug_info,
BreakLocatorType type = ALL_BREAK_LOCATIONS);
+ private:
friend class Debug;
static int BreakIndexFromCodeOffset(Handle<DebugInfo> debug_info, int offset);
@@ -182,11 +210,6 @@ class BreakLocation {
void SetDebugBreak();
void ClearDebugBreak();
- inline bool IsDebuggerStatement() const {
- return type_ == DEBUGGER_STATEMENT;
- }
- inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
-
Handle<DebugInfo> debug_info_;
int code_offset_;
DebugBreakType type_;
« no previous file with comments | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698