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/operator-properties.h" | 15 #include "src/compiler/operator-properties.h" |
15 #include "src/compiler/operator-properties-inl.h" | 16 #include "src/compiler/operator-properties-inl.h" |
16 | 17 |
17 namespace v8 { | 18 namespace v8 { |
18 namespace internal { | 19 namespace internal { |
19 namespace compiler { | 20 namespace compiler { |
20 | 21 |
21 Graph::Graph(Zone* zone) : GenericGraph<Node>(zone), decorators_(zone) {} | 22 Graph::Graph(Zone* zone) : GenericGraph<Node>(zone), decorators_(zone) {} |
22 | 23 |
23 | 24 |
24 void Graph::Decorate(Node* node) { | 25 void Graph::Decorate(Node* node) { |
25 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); | 26 for (ZoneVector<GraphDecorator*>::iterator i = decorators_.begin(); |
26 i != decorators_.end(); ++i) { | 27 i != decorators_.end(); ++i) { |
27 (*i)->Decorate(node); | 28 (*i)->Decorate(node); |
28 } | 29 } |
29 } | 30 } |
30 | 31 |
31 | 32 |
32 Node* Graph::NewNode( | 33 Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs, |
33 const Operator* op, int input_count, Node** inputs, bool incomplete) { | 34 bool incomplete) { |
34 DCHECK_LE(op->InputCount(), input_count); | 35 DCHECK_LE(op->InputCount(), input_count); |
35 Node* result = Node::New(this, input_count, inputs); | 36 Node* result = Node::New(this, input_count, inputs, incomplete); |
36 result->Initialize(op); | 37 result->Initialize(op); |
37 if (!incomplete) Decorate(result); | 38 if (!incomplete && !IrOpcode::IsControlOpcode(result->opcode())) { |
Michael Starzinger
2014/10/27 09:34:19
Is there a particular reason not to decorate contr
| |
39 Decorate(result); | |
40 } | |
38 return result; | 41 return result; |
39 } | 42 } |
40 | 43 |
41 } // namespace compiler | 44 } // namespace compiler |
42 } // namespace internal | 45 } // namespace internal |
43 } // namespace v8 | 46 } // namespace v8 |
OLD | NEW |