Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/compiler/typer.cc

Issue 545223002: Fix typer to actually visit the entire graph. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Ben Titzer. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/pipeline.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-inl.h" 5 #include "src/compiler/graph-inl.h"
6 #include "src/compiler/js-operator.h" 6 #include "src/compiler/js-operator.h"
7 #include "src/compiler/node.h" 7 #include "src/compiler/node.h"
8 #include "src/compiler/node-properties-inl.h" 8 #include "src/compiler/node-properties-inl.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 MaybeHandle<Context> context_; 110 MaybeHandle<Context> context_;
111 }; 111 };
112 112
113 113
114 class Typer::RunVisitor : public Typer::Visitor { 114 class Typer::RunVisitor : public Typer::Visitor {
115 public: 115 public:
116 RunVisitor(Typer* typer, MaybeHandle<Context> context) 116 RunVisitor(Typer* typer, MaybeHandle<Context> context)
117 : Visitor(typer, context), 117 : Visitor(typer, context),
118 phis(NodeSet::key_compare(), NodeSet::allocator_type(typer->zone())) {} 118 phis(NodeSet::key_compare(), NodeSet::allocator_type(typer->zone())) {}
119 119
120 GenericGraphVisit::Control Pre(Node* node) {
121 return NodeProperties::IsControl(node)
122 && node->opcode() != IrOpcode::kEnd
123 && node->opcode() != IrOpcode::kMerge
124 && node->opcode() != IrOpcode::kReturn
125 ? GenericGraphVisit::SKIP : GenericGraphVisit::CONTINUE;
126 }
127
128 GenericGraphVisit::Control Post(Node* node) { 120 GenericGraphVisit::Control Post(Node* node) {
129 Bounds bounds = TypeNode(node); 121 Bounds bounds = TypeNode(node);
130 if (node->opcode() == IrOpcode::kPhi) { 122 if (node->opcode() == IrOpcode::kPhi) {
131 // Remember phis for least fixpoint iteration. 123 // Remember phis for least fixpoint iteration.
132 phis.insert(node); 124 phis.insert(node);
133 } else { 125 } else {
134 NodeProperties::SetBounds(node, bounds); 126 NodeProperties::SetBounds(node, bounds);
135 } 127 }
136 return GenericGraphVisit::CONTINUE; 128 return GenericGraphVisit::CONTINUE;
137 } 129 }
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 841 }
850 842
851 843
852 void Typer::DecorateGraph(Graph* graph) { 844 void Typer::DecorateGraph(Graph* graph) {
853 graph->AddDecorator(new (zone()) TyperDecorator(this)); 845 graph->AddDecorator(new (zone()) TyperDecorator(this));
854 } 846 }
855 847
856 } 848 }
857 } 849 }
858 } // namespace v8::internal::compiler 850 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698