| 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 #include "src/compiler/source-position.h" | 5 #include "src/compiler/source-position.h" |
| 6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
| 7 #include "src/compiler/node-aux-data-inl.h" | 7 #include "src/compiler/node-aux-data-inl.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 private: | 23 private: |
| 24 SourcePositionTable* source_positions_; | 24 SourcePositionTable* source_positions_; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 | 27 |
| 28 SourcePositionTable::SourcePositionTable(Graph* graph) | 28 SourcePositionTable::SourcePositionTable(Graph* graph) |
| 29 : graph_(graph), | 29 : graph_(graph), |
| 30 decorator_(NULL), | 30 decorator_(NULL), |
| 31 current_position_(SourcePosition::Invalid()), | 31 current_position_(SourcePosition::Invalid()), |
| 32 table_(graph) {} | 32 table_(graph->zone()) {} |
| 33 | 33 |
| 34 | 34 |
| 35 void SourcePositionTable::AddDecorator() { | 35 void SourcePositionTable::AddDecorator() { |
| 36 DCHECK(decorator_ == NULL); | 36 DCHECK(decorator_ == NULL); |
| 37 decorator_ = new (graph_->zone()) Decorator(this); | 37 decorator_ = new (graph_->zone()) Decorator(this); |
| 38 graph_->AddDecorator(decorator_); | 38 graph_->AddDecorator(decorator_); |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 void SourcePositionTable::RemoveDecorator() { | 42 void SourcePositionTable::RemoveDecorator() { |
| 43 DCHECK(decorator_ != NULL); | 43 DCHECK(decorator_ != NULL); |
| 44 graph_->RemoveDecorator(decorator_); | 44 graph_->RemoveDecorator(decorator_); |
| 45 decorator_ = NULL; | 45 decorator_ = NULL; |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 SourcePosition SourcePositionTable::GetSourcePosition(Node* node) { | 49 SourcePosition SourcePositionTable::GetSourcePosition(Node* node) { |
| 50 return table_.Get(node); | 50 return table_.Get(node); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace compiler | 53 } // namespace compiler |
| 54 } // namespace internal | 54 } // namespace internal |
| 55 } // namespace v8 | 55 } // namespace v8 |
| OLD | NEW |