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/compiler/node-aux-data.h" | 8 #include "src/compiler/node-aux-data.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 }; | 65 }; |
66 | 66 |
67 explicit SourcePositionTable(Graph* graph); | 67 explicit SourcePositionTable(Graph* graph); |
68 | 68 |
69 void AddDecorator(); | 69 void AddDecorator(); |
70 void RemoveDecorator(); | 70 void RemoveDecorator(); |
71 | 71 |
72 SourcePosition GetSourcePosition(Node* node) const; | 72 SourcePosition GetSourcePosition(Node* node) const; |
73 void SetSourcePosition(Node* node, SourcePosition position); | 73 void SetSourcePosition(Node* node, SourcePosition position); |
74 | 74 |
| 75 void set_current_position(int position) { |
| 76 current_position_ = SourcePosition(position); |
| 77 } |
| 78 |
75 void Print(std::ostream& os) const; | 79 void Print(std::ostream& os) const; |
76 | 80 |
77 private: | 81 private: |
78 class Decorator; | 82 class Decorator; |
79 | 83 |
80 Graph* const graph_; | 84 Graph* const graph_; |
81 Decorator* decorator_; | 85 Decorator* decorator_; |
82 SourcePosition current_position_; | 86 SourcePosition current_position_; |
83 NodeAuxData<SourcePosition> table_; | 87 NodeAuxData<SourcePosition> table_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable); | 89 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace compiler | 92 } // namespace compiler |
89 } // namespace internal | 93 } // namespace internal |
90 } // namespace v8 | 94 } // namespace v8 |
91 | 95 |
92 #endif // V8_COMPILER_SOURCE_POSITION_H_ | 96 #endif // V8_COMPILER_SOURCE_POSITION_H_ |
OLD | NEW |