Index: src/compiler/graph.cc |
diff --git a/src/compiler/graph.cc b/src/compiler/graph.cc |
index 3f47eace8159e9d7ef97566db8bfe39a1e1acc8c..a0ec171aba77668a53076c7981970267da4786d2 100644 |
--- a/src/compiler/graph.cc |
+++ b/src/compiler/graph.cc |
@@ -20,17 +20,26 @@ namespace compiler { |
Graph::Graph(Zone* zone) |
: GenericGraph<Node>(zone), |
- decorators_(DecoratorVector::allocator_type(zone)) {} |
+ decorators_(DecoratorVector::allocator_type(zone)), |
+ is_typed_(false) {} |
+ |
+ |
+void Graph::Decorate(Node* node) { |
+ for (DecoratorVector::iterator i = decorators_.begin(); |
+ i != decorators_.end(); ++i) { |
+ (*i)->Decorate(node); |
+ } |
+ // Iff the graph is typed, then there _must_ be a decorator to type new nodes. |
+ DCHECK(NodeProperties::IsTyped(node) == |
+ (is_typed_ && OperatorProperties::HasValueOutput(node->op()))); |
+} |
Node* Graph::NewNode(Operator* op, int input_count, Node** inputs) { |
DCHECK(op->InputCount() <= input_count); |
Node* result = Node::New(this, input_count, inputs); |
result->Initialize(op); |
- for (DecoratorVector::iterator i = decorators_.begin(); |
- i != decorators_.end(); ++i) { |
- (*i)->Decorate(result); |
- } |
+ Decorate(result); |
return result; |
} |