OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 Isolate* isolate_; | 43 Isolate* isolate_; |
44 ZoneVector<Entry> entries_; | 44 ZoneVector<Entry> entries_; |
45 }; | 45 }; |
46 | 46 |
47 class SourcePositionTableIterator { | 47 class SourcePositionTableIterator { |
48 public: | 48 public: |
49 explicit SourcePositionTableIterator(BytecodeArray* bytecode_array); | 49 explicit SourcePositionTableIterator(BytecodeArray* bytecode_array); |
50 | 50 |
51 static int PositionFromBytecodeOffset(BytecodeArray* bytecode_array, | |
52 int bytecode_offset); | |
53 void Advance(); | 51 void Advance(); |
54 | 52 |
55 int bytecode_offset() const { | 53 int bytecode_offset() const { |
56 DCHECK(!done()); | 54 DCHECK(!done()); |
57 return bytecode_offset_; | 55 return bytecode_offset_; |
58 } | 56 } |
59 int source_position() const { | 57 int source_position() const { |
60 DCHECK(!done()); | 58 DCHECK(!done()); |
61 return source_position_; | 59 return source_position_; |
62 } | 60 } |
(...skipping 11 matching lines...) Expand all Loading... |
74 int bytecode_offset_; | 72 int bytecode_offset_; |
75 int source_position_; | 73 int source_position_; |
76 DisallowHeapAllocation no_gc; | 74 DisallowHeapAllocation no_gc; |
77 }; | 75 }; |
78 | 76 |
79 } // namespace interpreter | 77 } // namespace interpreter |
80 } // namespace internal | 78 } // namespace internal |
81 } // namespace v8 | 79 } // namespace v8 |
82 | 80 |
83 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ | 81 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ |
OLD | NEW |