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 "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph-inl.h" | 9 #include "src/compiler/graph-inl.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
11 #include "src/compiler/node-aux-data-inl.h" | 11 #include "src/compiler/node-aux-data-inl.h" |
12 #include "src/compiler/node-properties.h" | 12 #include "src/compiler/node-properties.h" |
13 #include "src/compiler/node-properties-inl.h" | 13 #include "src/compiler/node-properties-inl.h" |
14 #include "src/compiler/opcodes.h" | 14 #include "src/compiler/opcodes.h" |
15 #include "src/compiler/operator-properties.h" | 15 #include "src/compiler/operator-properties.h" |
16 #include "src/compiler/operator-properties-inl.h" | 16 #include "src/compiler/operator-properties-inl.h" |
17 | 17 |
18 namespace v8 { | 18 namespace v8 { |
19 namespace internal { | 19 namespace internal { |
20 namespace compiler { | 20 namespace compiler { |
21 | 21 |
22 Graph::Graph(Zone* zone) : GenericGraph<Node>(zone), decorators_(zone) {} | 22 Graph::Graph(Zone* zone) |
| 23 : GenericGraph<Node>(zone), mark_max_(0), decorators_(zone) {} |
23 | 24 |
24 | 25 |
25 void Graph::Decorate(Node* node) { | 26 void Graph::Decorate(Node* node) { |
26 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); | 27 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); |
27 i != decorators_.end(); ++i) { | 28 i != decorators_.end(); ++i) { |
28 (*i)->Decorate(node); | 29 (*i)->Decorate(node); |
29 } | 30 } |
30 } | 31 } |
31 | 32 |
32 | 33 |
33 Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs, | 34 Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs, |
34 bool incomplete) { | 35 bool incomplete) { |
35 DCHECK_LE(op->ValueInputCount(), input_count); | 36 DCHECK_LE(op->ValueInputCount(), input_count); |
36 Node* result = Node::New(this, input_count, inputs, incomplete); | 37 Node* result = Node::New(this, input_count, inputs, incomplete); |
37 result->Initialize(op); | 38 result->Initialize(op); |
38 if (!incomplete) { | 39 if (!incomplete) { |
39 Decorate(result); | 40 Decorate(result); |
40 } | 41 } |
41 return result; | 42 return result; |
42 } | 43 } |
43 | 44 |
44 } // namespace compiler | 45 } // namespace compiler |
45 } // namespace internal | 46 } // namespace internal |
46 } // namespace v8 | 47 } // namespace v8 |
OLD | NEW |