OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/graph.h" | 5 #include "src/compiler/graph.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
11 #include "src/compiler/node-properties.h" | 11 #include "src/compiler/node-properties.h" |
12 #include "src/compiler/verifier.h" | 12 #include "src/compiler/verifier.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 namespace compiler { | 16 namespace compiler { |
17 | 17 |
18 Graph::Graph(Zone* zone) | 18 Graph::Graph(Zone* zone) |
19 : zone_(zone), | 19 : zone_(zone), |
20 start_(nullptr), | 20 start_(nullptr), |
21 end_(nullptr), | 21 end_(nullptr), |
22 mark_max_(0), | 22 mark_max_(0), |
23 next_node_id_(0), | 23 next_node_id_(0), |
24 decorators_(zone) {} | 24 decorators_(zone) {} |
25 | 25 |
26 | 26 |
27 void Graph::Decorate(Node* node) { | 27 void Graph::Decorate(Node* node) { |
28 for (auto const decorator : decorators_) { | 28 for (GraphDecorator* const decorator : decorators_) { |
29 decorator->Decorate(node); | 29 decorator->Decorate(node); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 | 33 |
34 void Graph::AddDecorator(GraphDecorator* decorator) { | 34 void Graph::AddDecorator(GraphDecorator* decorator) { |
35 decorators_.push_back(decorator); | 35 decorators_.push_back(decorator); |
36 } | 36 } |
37 | 37 |
38 | 38 |
(...skipping 29 matching lines...) Expand all Loading... |
68 | 68 |
69 NodeId Graph::NextNodeId() { | 69 NodeId Graph::NextNodeId() { |
70 NodeId const id = next_node_id_; | 70 NodeId const id = next_node_id_; |
71 CHECK(!base::bits::UnsignedAddOverflow32(id, 1, &next_node_id_)); | 71 CHECK(!base::bits::UnsignedAddOverflow32(id, 1, &next_node_id_)); |
72 return id; | 72 return id; |
73 } | 73 } |
74 | 74 |
75 } // namespace compiler | 75 } // namespace compiler |
76 } // namespace internal | 76 } // namespace internal |
77 } // namespace v8 | 77 } // namespace v8 |
OLD | NEW |