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

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

Issue 760493003: Make generic algorithm a little less generic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-generic-stuff-3
Patch Set: Rebased. Created 6 years 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
« no previous file with comments | « src/compiler/generic-algorithm.h ('k') | src/compiler/graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_COMPILER_GENERIC_ALGORITHM_INL_H_
6 #define V8_COMPILER_GENERIC_ALGORITHM_INL_H_
7
8 #include <vector>
9
10 #include "src/compiler/generic-algorithm.h"
11 #include "src/compiler/graph.h"
12 #include "src/compiler/node.h"
13
14 namespace v8 {
15 namespace internal {
16 namespace compiler {
17
18 template <class N>
19 class NodeInputIterationTraits {
20 public:
21 typedef N Node;
22 typedef typename N::InputEdges::iterator Iterator;
23
24 static Iterator begin(Node* node) { return node->input_edges().begin(); }
25 static Iterator end(Node* node) { return node->input_edges().end(); }
26 static int max_id(Graph* graph) { return graph->NodeCount(); }
27 static Node* to(Iterator iterator) { return (*iterator).to(); }
28 static Node* from(Iterator iterator) { return (*iterator).from(); }
29 };
30
31 } // namespace compiler
32 } // namespace internal
33 } // namespace v8
34
35 #endif // V8_COMPILER_GENERIC_ALGORITHM_INL_H_
OLDNEW
« no previous file with comments | « src/compiler/generic-algorithm.h ('k') | src/compiler/graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698