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

Side by Side Diff: src/interpreter/source-position-table.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 unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/interpreter/source-position-table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_INTERPRETER_SOURCE_POSITION_TABLE_H_ 5 #ifndef V8_INTERPRETER_SOURCE_POSITION_TABLE_H_
6 #define V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ 6 #define V8_INTERPRETER_SOURCE_POSITION_TABLE_H_
7 7
8 #include "src/assert-scope.h" 8 #include "src/assert-scope.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 17 matching lines...) Expand all
28 void AddExpressionPosition(size_t bytecode_offset, int source_position); 28 void AddExpressionPosition(size_t bytecode_offset, int source_position);
29 void RevertPosition(size_t bytecode_offset); 29 void RevertPosition(size_t bytecode_offset);
30 Handle<FixedArray> ToFixedArray(); 30 Handle<FixedArray> ToFixedArray();
31 31
32 private: 32 private:
33 struct Entry { 33 struct Entry {
34 int bytecode_offset; 34 int bytecode_offset;
35 uint32_t source_position_and_type; 35 uint32_t source_position_and_type;
36 }; 36 };
37 37
38 void AssertMonotonic(int bytecode_offset) { 38 bool CodeOffsetHasPosition(int bytecode_offset) {
39 DCHECK(entries_.size() == 0 || 39 // Return whether bytecode offset already has a position assigned.
40 entries_.back().bytecode_offset < bytecode_offset); 40 return entries_.size() > 0 &&
41 entries_.back().bytecode_offset == bytecode_offset;
41 } 42 }
42 43
43 Isolate* isolate_; 44 Isolate* isolate_;
44 ZoneVector<Entry> entries_; 45 ZoneVector<Entry> entries_;
45 }; 46 };
46 47
47 class SourcePositionTableIterator { 48 class SourcePositionTableIterator {
48 public: 49 public:
49 explicit SourcePositionTableIterator(BytecodeArray* bytecode_array); 50 explicit SourcePositionTableIterator(BytecodeArray* bytecode_array);
50 51
(...skipping 21 matching lines...) Expand all
72 int bytecode_offset_; 73 int bytecode_offset_;
73 int source_position_; 74 int source_position_;
74 DisallowHeapAllocation no_gc; 75 DisallowHeapAllocation no_gc;
75 }; 76 };
76 77
77 } // namespace interpreter 78 } // namespace interpreter
78 } // namespace internal 79 } // namespace internal
79 } // namespace v8 80 } // namespace v8
80 81
81 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ 82 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/interpreter/source-position-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698