OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_SOURCE_POSITION_H_ | 5 #ifndef V8_COMPILER_SOURCE_POSITION_H_ |
6 #define V8_COMPILER_SOURCE_POSITION_H_ | 6 #define V8_COMPILER_SOURCE_POSITION_H_ |
7 | 7 |
| 8 #include "src/base/compiler-specific.h" |
8 #include "src/compiler/node-aux-data.h" | 9 #include "src/compiler/node-aux-data.h" |
9 #include "src/globals.h" | 10 #include "src/globals.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 namespace compiler { | 14 namespace compiler { |
14 | 15 |
15 // Encapsulates encoding and decoding of sources positions from which Nodes | 16 // Encapsulates encoding and decoding of sources positions from which Nodes |
16 // originated. | 17 // originated. |
17 class SourcePosition final { | 18 class SourcePosition final { |
(...skipping 13 matching lines...) Expand all Loading... |
31 | 32 |
32 | 33 |
33 inline bool operator==(const SourcePosition& lhs, const SourcePosition& rhs) { | 34 inline bool operator==(const SourcePosition& lhs, const SourcePosition& rhs) { |
34 return lhs.raw() == rhs.raw(); | 35 return lhs.raw() == rhs.raw(); |
35 } | 36 } |
36 | 37 |
37 inline bool operator!=(const SourcePosition& lhs, const SourcePosition& rhs) { | 38 inline bool operator!=(const SourcePosition& lhs, const SourcePosition& rhs) { |
38 return !(lhs == rhs); | 39 return !(lhs == rhs); |
39 } | 40 } |
40 | 41 |
41 class SourcePositionTable final : public ZoneObject { | 42 class V8_EXPORT_PRIVATE SourcePositionTable final |
| 43 : public NON_EXPORTED_BASE(ZoneObject) { |
42 public: | 44 public: |
43 class Scope final { | 45 class Scope final { |
44 public: | 46 public: |
45 Scope(SourcePositionTable* source_positions, SourcePosition position) | 47 Scope(SourcePositionTable* source_positions, SourcePosition position) |
46 : source_positions_(source_positions), | 48 : source_positions_(source_positions), |
47 prev_position_(source_positions->current_position_) { | 49 prev_position_(source_positions->current_position_) { |
48 Init(position); | 50 Init(position); |
49 } | 51 } |
50 Scope(SourcePositionTable* source_positions, Node* node) | 52 Scope(SourcePositionTable* source_positions, Node* node) |
51 : source_positions_(source_positions), | 53 : source_positions_(source_positions), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 NodeAuxData<SourcePosition> table_; | 89 NodeAuxData<SourcePosition> table_; |
88 | 90 |
89 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable); | 91 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable); |
90 }; | 92 }; |
91 | 93 |
92 } // namespace compiler | 94 } // namespace compiler |
93 } // namespace internal | 95 } // namespace internal |
94 } // namespace v8 | 96 } // namespace v8 |
95 | 97 |
96 #endif // V8_COMPILER_SOURCE_POSITION_H_ | 98 #endif // V8_COMPILER_SOURCE_POSITION_H_ |
OLD | NEW |