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_SOURCE_POSITION_TABLE_H_ | 5 #ifndef V8_SOURCE_POSITION_TABLE_H_ |
6 #define V8_SOURCE_POSITION_TABLE_H_ | 6 #define V8_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/globals.h" | 10 #include "src/globals.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 PositionTableEntry() | 24 PositionTableEntry() |
25 : code_offset(0), source_position(0), is_statement(false) {} | 25 : code_offset(0), source_position(0), is_statement(false) {} |
26 PositionTableEntry(int offset, int source, bool statement) | 26 PositionTableEntry(int offset, int source, bool statement) |
27 : code_offset(offset), source_position(source), is_statement(statement) {} | 27 : code_offset(offset), source_position(source), is_statement(statement) {} |
28 | 28 |
29 int code_offset; | 29 int code_offset; |
30 int source_position; | 30 int source_position; |
31 bool is_statement; | 31 bool is_statement; |
32 }; | 32 }; |
33 | 33 |
34 class SourcePositionTableBuilder { | 34 class V8_EXPORT_PRIVATE SourcePositionTableBuilder { |
35 public: | 35 public: |
36 enum RecordingMode { OMIT_SOURCE_POSITIONS, RECORD_SOURCE_POSITIONS }; | 36 enum RecordingMode { OMIT_SOURCE_POSITIONS, RECORD_SOURCE_POSITIONS }; |
37 | 37 |
38 SourcePositionTableBuilder(Zone* zone, | 38 SourcePositionTableBuilder(Zone* zone, |
39 RecordingMode mode = RECORD_SOURCE_POSITIONS); | 39 RecordingMode mode = RECORD_SOURCE_POSITIONS); |
40 | 40 |
41 void AddPosition(size_t code_offset, int source_position, bool is_statement); | 41 void AddPosition(size_t code_offset, int source_position, bool is_statement); |
42 | 42 |
43 Handle<ByteArray> ToSourcePositionTable(Isolate* isolate, | 43 Handle<ByteArray> ToSourcePositionTable(Isolate* isolate, |
44 Handle<AbstractCode> code); | 44 Handle<AbstractCode> code); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ByteArray* table_; | 82 ByteArray* table_; |
83 int index_; | 83 int index_; |
84 PositionTableEntry current_; | 84 PositionTableEntry current_; |
85 DisallowHeapAllocation no_gc; | 85 DisallowHeapAllocation no_gc; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace internal | 88 } // namespace internal |
89 } // namespace v8 | 89 } // namespace v8 |
90 | 90 |
91 #endif // V8_SOURCE_POSITION_TABLE_H_ | 91 #endif // V8_SOURCE_POSITION_TABLE_H_ |
OLD | NEW |