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

Side by Side Diff: src/compiler/node-marker.h

Issue 838783002: [turbofan] Cleanup Graph and related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Parameter pack causes compile errors. Created 5 years, 11 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
« no previous file with comments | « src/compiler/node.cc ('k') | src/compiler/node-marker.cc » ('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 2015 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_NODE_MARKER_H_
6 #define V8_COMPILER_NODE_MARKER_H_
7
8 #include "src/base/macros.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 // Forward declarations.
15 class Graph;
16 class Node;
17
18
19 // Marks are used during traversal of the graph to distinguish states of nodes.
20 // Each node has a mark which is a monotonically increasing integer, and a
21 // {NodeMarker} has a range of values that indicate states of a node.
22 typedef uint32_t Mark;
23
24
25 // Base class for templatized NodeMarkers.
26 class NodeMarkerBase {
27 public:
28 NodeMarkerBase(Graph* graph, uint32_t num_states);
29
30 Mark Get(Node* node);
31 void Set(Node* node, Mark mark);
32
33 private:
34 Mark mark_min_;
35 Mark mark_max_;
36
37 DISALLOW_COPY_AND_ASSIGN(NodeMarkerBase);
38 };
39
40
41 // A NodeMarker uses monotonically increasing marks to assign local "states"
42 // to nodes. Only one NodeMarker per graph is valid at a given time.
43 template <typename State>
44 class NodeMarker : public NodeMarkerBase {
45 public:
46 NodeMarker(Graph* graph, uint32_t num_states)
47 : NodeMarkerBase(graph, num_states) {}
48
49 State Get(Node* node) {
50 return static_cast<State>(NodeMarkerBase::Get(node));
51 }
52
53 void Set(Node* node, State state) {
54 NodeMarkerBase::Set(node, static_cast<Mark>(state));
55 }
56 };
57
58 } // namespace compiler
59 } // namespace internal
60 } // namespace v8
61
62 #endif // V8_COMPILER_NODE_MARKER_H_
OLDNEW
« no previous file with comments | « src/compiler/node.cc ('k') | src/compiler/node-marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698