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/checks.h" | 9 #include "src/checks.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
| 11 #include "src/log.h" |
11 #include "src/zone-containers.h" | 12 #include "src/zone-containers.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 class BytecodeArray; | 17 class BytecodeArray; |
17 class ByteArray; | 18 class ByteArray; |
18 class Isolate; | 19 class Isolate; |
19 class Zone; | 20 class Zone; |
20 | 21 |
21 namespace interpreter { | 22 namespace interpreter { |
22 | 23 |
23 struct PositionTableEntry { | 24 struct PositionTableEntry { |
24 PositionTableEntry() | 25 PositionTableEntry() |
25 : bytecode_offset(0), source_position(0), is_statement(false) {} | 26 : bytecode_offset(0), source_position(0), is_statement(false) {} |
26 PositionTableEntry(int bytecode, int source, bool statement) | 27 PositionTableEntry(int bytecode, int source, bool statement) |
27 : bytecode_offset(bytecode), | 28 : bytecode_offset(bytecode), |
28 source_position(source), | 29 source_position(source), |
29 is_statement(statement) {} | 30 is_statement(statement) {} |
30 | 31 |
31 int bytecode_offset; | 32 int bytecode_offset; |
32 int source_position; | 33 int source_position; |
33 bool is_statement; | 34 bool is_statement; |
34 }; | 35 }; |
35 | 36 |
36 class SourcePositionTableBuilder { | 37 class SourcePositionTableBuilder : public PositionsRecorder { |
37 public: | 38 public: |
38 explicit SourcePositionTableBuilder(Isolate* isolate, Zone* zone) | 39 explicit SourcePositionTableBuilder(Isolate* isolate, Zone* zone) |
39 : isolate_(isolate), | 40 : isolate_(isolate), |
40 bytes_(zone), | 41 bytes_(zone), |
41 #ifdef ENABLE_SLOW_DCHECKS | 42 #ifdef ENABLE_SLOW_DCHECKS |
42 raw_entries_(zone), | 43 raw_entries_(zone), |
43 #endif | 44 #endif |
44 previous_() { | 45 previous_() { |
45 } | 46 } |
46 | 47 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int index_; | 87 int index_; |
87 PositionTableEntry current_; | 88 PositionTableEntry current_; |
88 DisallowHeapAllocation no_gc; | 89 DisallowHeapAllocation no_gc; |
89 }; | 90 }; |
90 | 91 |
91 } // namespace interpreter | 92 } // namespace interpreter |
92 } // namespace internal | 93 } // namespace internal |
93 } // namespace v8 | 94 } // namespace v8 |
94 | 95 |
95 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ | 96 #endif // V8_INTERPRETER_SOURCE_POSITION_TABLE_H_ |
OLD | NEW |