Chromium Code Reviews| Index: src/debug/debug.h |
| diff --git a/src/debug/debug.h b/src/debug/debug.h |
| index a4dbce484f67f0d9d5f9ab595ddf69a648d52cbb..e71917ae154abd7eb7565b1e64bd868588d3b09e 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_; |
| @@ -172,9 +177,30 @@ class BreakLocation { |
| DISALLOW_COPY_AND_ASSIGN(CodeIterator); |
| }; |
| + class BytecodeArrayIterator : public Iterator { |
| + public: |
| + BytecodeArrayIterator(Handle<DebugInfo> debug_info, BreakLocatorType type); |
| + ~BytecodeArrayIterator() override{}; |
|
vogelheim
2016/02/11 12:33:59
nitpick: whitespace between override and {} ?
nitp
Yang
2016/02/11 14:16:55
Ah yes. Makes sense. I simply let clang-format han
|
| + |
| + BreakLocation GetBreakLocation() override; |
| + bool Done() const override { return iterator_.done(); } |
| + void Next() override; |
| + |
| + int code_offset() override { return iterator_.bytecode_offset(); } |
| + |
| + private: |
| + DebugBreakType DebugBreakType(); |
| + |
| + interpreter::SourcePositionTableIterator iterator_; |
|
rmcilroy
2016/02/11 12:32:03
nit - source_position_iterator_
Yang
2016/02/11 14:16:55
Done.
|
| + 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 +208,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_; |