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) | 22 Graph::Graph(Zone* zone) |
23 : GenericGraph<Node>(zone), mark_max_(0), decorators_(zone) {} | 23 : zone_(zone), |
| 24 start_(NULL), |
| 25 end_(NULL), |
| 26 mark_max_(0), |
| 27 next_node_id_(0), |
| 28 decorators_(zone) {} |
24 | 29 |
25 | 30 |
26 void Graph::Decorate(Node* node) { | 31 void Graph::Decorate(Node* node) { |
27 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); | 32 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); |
28 i != decorators_.end(); ++i) { | 33 i != decorators_.end(); ++i) { |
29 (*i)->Decorate(node); | 34 (*i)->Decorate(node); |
30 } | 35 } |
31 } | 36 } |
32 | 37 |
33 | 38 |
34 Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs, | 39 Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs, |
35 bool incomplete) { | 40 bool incomplete) { |
36 DCHECK_LE(op->ValueInputCount(), input_count); | 41 DCHECK_LE(op->ValueInputCount(), input_count); |
37 Node* result = Node::New(this, input_count, inputs, incomplete); | 42 Node* result = Node::New(this, input_count, inputs, incomplete); |
38 result->Initialize(op); | 43 result->Initialize(op); |
39 if (!incomplete) { | 44 if (!incomplete) { |
40 Decorate(result); | 45 Decorate(result); |
41 } | 46 } |
42 return result; | 47 return result; |
43 } | 48 } |
44 | 49 |
45 } // namespace compiler | 50 } // namespace compiler |
46 } // namespace internal | 51 } // namespace internal |
47 } // namespace v8 | 52 } // namespace v8 |
OLD | NEW |