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

Side by Side Diff: src/compiler/generic-algorithm.h

Issue 512123002: Revert "Remove C++11-ism, until all bots support it." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | 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 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 #ifndef V8_COMPILER_GENERIC_ALGORITHM_H_ 5 #ifndef V8_COMPILER_GENERIC_ALGORITHM_H_
6 #define V8_COMPILER_GENERIC_ALGORITHM_H_ 6 #define V8_COMPILER_GENERIC_ALGORITHM_H_
7 7
8 #include <stack> 8 #include <stack>
9 9
10 #include "src/compiler/generic-graph.h" 10 #include "src/compiler/generic-graph.h"
(...skipping 25 matching lines...) Expand all
36 // void PreEdge(Traits::Node* from, int index, Traits::Node* to); 36 // void PreEdge(Traits::Node* from, int index, Traits::Node* to);
37 // void PostEdge(Traits::Node* from, int index, Traits::Node* to); 37 // void PostEdge(Traits::Node* from, int index, Traits::Node* to);
38 // } 38 // }
39 template <class Visitor, class Traits, class RootIterator> 39 template <class Visitor, class Traits, class RootIterator>
40 static void Visit(GenericGraphBase* graph, Zone* zone, 40 static void Visit(GenericGraphBase* graph, Zone* zone,
41 RootIterator root_begin, RootIterator root_end, 41 RootIterator root_begin, RootIterator root_end,
42 Visitor* visitor) { 42 Visitor* visitor) {
43 typedef typename Traits::Node Node; 43 typedef typename Traits::Node Node;
44 typedef typename Traits::Iterator Iterator; 44 typedef typename Traits::Iterator Iterator;
45 typedef std::pair<Iterator, Iterator> NodeState; 45 typedef std::pair<Iterator, Iterator> NodeState;
46 typedef std::stack<NodeState, ZoneDeque<NodeState> > NodeStateStack; 46 typedef std::stack<NodeState, ZoneDeque<NodeState>> NodeStateStack;
47 NodeStateStack stack((ZoneDeque<NodeState>(zone))); 47 NodeStateStack stack((ZoneDeque<NodeState>(zone)));
48 BoolVector visited(Traits::max_id(graph), false, zone); 48 BoolVector visited(Traits::max_id(graph), false, zone);
49 Node* current = *root_begin; 49 Node* current = *root_begin;
50 while (true) { 50 while (true) {
51 DCHECK(current != NULL); 51 DCHECK(current != NULL);
52 const int id = current->id(); 52 const int id = current->id();
53 DCHECK(id >= 0); 53 DCHECK(id >= 0);
54 DCHECK(id < Traits::max_id(graph)); // Must be a valid id. 54 DCHECK(id < Traits::max_id(graph)); // Must be a valid id.
55 bool visit = !GetVisited(&visited, id); 55 bool visit = !GetVisited(&visited, id);
56 if (visit) { 56 if (visit) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 static bool GetVisited(BoolVector* visited, int id) { 123 static bool GetVisited(BoolVector* visited, int id) {
124 if (id >= static_cast<int>(visited->size())) return false; 124 if (id >= static_cast<int>(visited->size())) return false;
125 return visited->at(id); 125 return visited->at(id);
126 } 126 }
127 }; 127 };
128 } 128 }
129 } 129 }
130 } // namespace v8::internal::compiler 130 } // namespace v8::internal::compiler
131 131
132 #endif // V8_COMPILER_GENERIC_ALGORITHM_H_ 132 #endif // V8_COMPILER_GENERIC_ALGORITHM_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698