OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DEBUG_DEBUG_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_DEBUG_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
11 #include "src/base/atomicops.h" | 11 #include "src/base/atomicops.h" |
12 #include "src/base/hashmap.h" | 12 #include "src/base/hashmap.h" |
13 #include "src/base/platform/platform.h" | 13 #include "src/base/platform/platform.h" |
14 #include "src/debug/liveedit.h" | 14 #include "src/debug/liveedit.h" |
15 #include "src/execution.h" | 15 #include "src/execution.h" |
16 #include "src/factory.h" | 16 #include "src/factory.h" |
17 #include "src/flags.h" | 17 #include "src/flags.h" |
18 #include "src/frames.h" | 18 #include "src/frames.h" |
19 #include "src/interpreter/source-position-table.h" | |
20 #include "src/runtime/runtime.h" | 19 #include "src/runtime/runtime.h" |
| 20 #include "src/source-position-table.h" |
21 #include "src/string-stream.h" | 21 #include "src/string-stream.h" |
22 #include "src/v8threads.h" | 22 #include "src/v8threads.h" |
23 | 23 |
24 #include "include/v8-debug.h" | 24 #include "include/v8-debug.h" |
25 | 25 |
26 namespace v8 { | 26 namespace v8 { |
27 namespace internal { | 27 namespace internal { |
28 | 28 |
29 | 29 |
30 // Forward declarations. | 30 // Forward declarations. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 rinfo()->pc() - | 171 rinfo()->pc() - |
172 debug_info_->abstract_code()->GetCode()->instruction_start()); | 172 debug_info_->abstract_code()->GetCode()->instruction_start()); |
173 } | 173 } |
174 | 174 |
175 private: | 175 private: |
176 int GetModeMask(BreakLocatorType type); | 176 int GetModeMask(BreakLocatorType type); |
177 RelocInfo::Mode rmode() { return reloc_iterator_.rinfo()->rmode(); } | 177 RelocInfo::Mode rmode() { return reloc_iterator_.rinfo()->rmode(); } |
178 RelocInfo* rinfo() { return reloc_iterator_.rinfo(); } | 178 RelocInfo* rinfo() { return reloc_iterator_.rinfo(); } |
179 | 179 |
180 RelocIterator reloc_iterator_; | 180 RelocIterator reloc_iterator_; |
| 181 SourcePositionTableIterator source_position_iterator_; |
| 182 int start_position_; |
181 DISALLOW_COPY_AND_ASSIGN(CodeIterator); | 183 DISALLOW_COPY_AND_ASSIGN(CodeIterator); |
182 }; | 184 }; |
183 | 185 |
184 class BytecodeArrayIterator : public Iterator { | 186 class BytecodeArrayIterator : public Iterator { |
185 public: | 187 public: |
186 BytecodeArrayIterator(Handle<DebugInfo> debug_info, BreakLocatorType type); | 188 BytecodeArrayIterator(Handle<DebugInfo> debug_info, BreakLocatorType type); |
187 ~BytecodeArrayIterator() override {} | 189 ~BytecodeArrayIterator() override {} |
188 | 190 |
189 BreakLocation GetBreakLocation() override; | 191 BreakLocation GetBreakLocation() override; |
190 bool Done() const override { return source_position_iterator_.done(); } | 192 bool Done() const override { return source_position_iterator_.done(); } |
191 void Next() override; | 193 void Next() override; |
192 | 194 |
193 int code_offset() override { | 195 int code_offset() override { |
194 return source_position_iterator_.bytecode_offset(); | 196 return source_position_iterator_.code_offset(); |
195 } | 197 } |
196 | 198 |
197 private: | 199 private: |
198 DebugBreakType GetDebugBreakType(); | 200 DebugBreakType GetDebugBreakType(); |
199 | 201 |
200 interpreter::SourcePositionTableIterator source_position_iterator_; | 202 SourcePositionTableIterator source_position_iterator_; |
201 BreakLocatorType break_locator_type_; | 203 BreakLocatorType break_locator_type_; |
202 int start_position_; | 204 int start_position_; |
203 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator); | 205 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator); |
204 }; | 206 }; |
205 | 207 |
206 static Iterator* GetIterator(Handle<DebugInfo> debug_info, | 208 static Iterator* GetIterator(Handle<DebugInfo> debug_info, |
207 BreakLocatorType type = ALL_BREAK_LOCATIONS); | 209 BreakLocatorType type = ALL_BREAK_LOCATIONS); |
208 | 210 |
209 private: | 211 private: |
210 friend class Debug; | 212 friend class Debug; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 Handle<Code> code); | 814 Handle<Code> code); |
813 static bool DebugBreakSlotIsPatched(Address pc); | 815 static bool DebugBreakSlotIsPatched(Address pc); |
814 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 816 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
815 }; | 817 }; |
816 | 818 |
817 | 819 |
818 } // namespace internal | 820 } // namespace internal |
819 } // namespace v8 | 821 } // namespace v8 |
820 | 822 |
821 #endif // V8_DEBUG_DEBUG_H_ | 823 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |