// Copyright 2026 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
class GraphPrinter; class Node; template <typename T> class NodePrinter; class TraceTreeScope; class Tree;
template <typename T> class GraphLabeller { public: auto RegisterNode(const T* node) { auto result = nodes_.emplace(node, next_node_label_); if (result.second) {
next_node_label_++;
} return result.first;
}
int NodeId(const T* node) { auto it = nodes_.find(node); if (it == nodes_.end()) {
it = RegisterNode(node);
DCHECK_NE(it, nodes_.end());
} return it->second;
}
int NodeId(const T* node) const { auto it = nodes_.find(node); if (it == nodes_.end()) { return -1;
} return it->second;
}
private:
std::map<const T*, int> nodes_; int next_node_label_ = 1;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.