Commit c6732a9f authored by bgeron's avatar bgeron Committed by Commit bot

[turbofan] node-marker.h: Fix an incorrect comment, and elaborate.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2068463005
Cr-Commit-Position: refs/heads/master@{#36994}
parent 231ae291
...@@ -42,9 +42,22 @@ class NodeMarkerBase { ...@@ -42,9 +42,22 @@ class NodeMarkerBase {
DISALLOW_COPY_AND_ASSIGN(NodeMarkerBase); DISALLOW_COPY_AND_ASSIGN(NodeMarkerBase);
}; };
// A NodeMarker assigns a local "state" to every node of a graph in constant
// A NodeMarker uses monotonically increasing marks to assign local "states" // memory. Only one NodeMarker per graph is valid at a given time, that is,
// to nodes. Only one NodeMarker per graph is valid at a given time. // 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> template <typename State>
class NodeMarker : public NodeMarkerBase { class NodeMarker : public NodeMarkerBase {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment