summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/node-marker.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/node-marker.h')
-rw-r--r--deps/v8/src/compiler/node-marker.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/deps/v8/src/compiler/node-marker.h b/deps/v8/src/compiler/node-marker.h
index 5ef2063f18..84666d5f07 100644
--- a/deps/v8/src/compiler/node-marker.h
+++ b/deps/v8/src/compiler/node-marker.h
@@ -42,9 +42,22 @@ class NodeMarkerBase {
DISALLOW_COPY_AND_ASSIGN(NodeMarkerBase);
};
-
-// A NodeMarker uses monotonically increasing marks to assign local "states"
-// to nodes. Only one NodeMarker per graph is valid at a given time.
+// A NodeMarker assigns a local "state" to every node of a graph in constant
+// memory. Only one NodeMarker per graph is valid at a given time, that is,
+// after you create a NodeMarker you should no longer use NodeMarkers that
+// were created earlier. Internally, the local state is stored in the Node
+// structure.
+//
+// When you initialize a NodeMarker, all the local states are conceptually
+// set to State(0) in constant time.
+//
+// In its current implementation, in debug mode NodeMarker will try to
+// (efficiently) detect invalid use of an older NodeMarker. Namely, if you get
+// or set a node with a NodeMarker, and then get or set that node
+// with an older NodeMarker you will get a crash.
+//
+// GraphReducer uses a NodeMarker, so individual Reducers cannot use a
+// NodeMarker.
template <typename State>
class NodeMarker : public NodeMarkerBase {
public: