Lines Matching refs:Node

33 // A Node is the basic primitive of graphs. Nodes are chained together by
41 // by the Node's id.
42 class V8_EXPORT_PRIVATE Node final {
44 static Node* New(Zone* zone, NodeId id, const Operator* op, int input_count,
45 Node* const* inputs, bool has_extensible_inputs);
46 static Node* Clone(Zone* zone, NodeId id, const Node* node);
71 Node* InputAt(int index) const {
77 void ReplaceInput(int index, Node* new_to) {
81 Node* old_to = *input_ptr;
90 void AppendInput(Zone* zone, Node* new_to);
91 void InsertInput(Zone* zone, int index, Node* new_to);
94 Node* RemoveInput(int index);
101 void ReplaceUses(Node* replace_to);
119 explicit UseEdges(Node* node) : node_(node) {}
122 Node* node_;
129 using value_type = Node*;
137 explicit Uses(Node* node) : node_(node) {}
140 Node* node_;
146 bool OwnedBy(Node const* owner) const;
149 bool OwnedBy(Node const* owner1, Node const* owner2) const;
157 inline static Node* NewImpl(Zone* zone, NodeId id, const Operator* op,
192 is_inline_use() ? reinterpret_cast<Node*>(start)->inline_inputs()
197 Node* from() {
199 return is_inline_use() ? reinterpret_cast<Node*>(start)
211 // be able to map {Node} objects to {Use} objects and vice-versa in a
214 // {Use} links are laid out in memory directly before a {Node}, followed by
218 // |Use #N |Use #N-1|...|Use #1 |Use #0 |Node xxxx |I#0|I#1|...|I#N-1|I#N|
220 // + Use + Node + Input
223 // can compute the {Node}.
226 // |Node xxxx |
238 Node(NodeId id, const Operator* op, int inline_count, int inline_capacity);
239 Node(const Node&) = delete;
240 Node& operator=(const Node&) = delete;
307 Address Node::inputs_location() const {
308 return reinterpret_cast<Address>(this) + sizeof(Node);
311 ZoneNodePtr* Node::OutOfLineInputs::inputs() {
313 sizeof(Node::OutOfLineInputs));
316 std::ostream& operator<<(std::ostream& os, const Node& n);
321 explicit constexpr NodeWrapper(Node* node) : node_(node) {}
322 operator Node*() const { return node_; }
323 Node* operator->() const { return node_; }
326 Node* node() const { return node_; }
327 void set_node(Node* node) {
333 Node* node_;
340 explicit constexpr Effect(Node* node) : NodeWrapper(node) {
346 // Support the common `Node* x = effect = ...` pattern.
347 Node* operator=(Node* value) {
356 explicit constexpr Control(Node* node) : NodeWrapper(node) {
362 // Support the common `Node* x = control = ...` pattern.
363 Node* operator=(Node* value) {
370 // Typedefs to shorten commonly used Node containers.
371 using NodeDeque = ZoneDeque<Node*>;
372 using NodeSet = ZoneSet<Node*>;
373 using NodeVector = ZoneVector<Node*>;
376 class Node::InputEdges final {
398 class V8_EXPORT_PRIVATE Node::Inputs final {
400 using value_type = Node*;
424 Node* from() const { return use_->from(); }
425 Node* to() const { return *input_ptr_; }
435 void UpdateTo(Node* new_to) {
436 Node* old_to = *input_ptr_;
445 friend class Node::UseEdges::iterator;
446 friend class Node::InputEdges;
447 friend class Node::InputEdges::iterator;
449 Edge(Node::Use* use, ZoneNodePtr* input_ptr)
456 Node::Use* use_;
460 bool Node::IsDead() const {
461 Node::Inputs inputs = this->inputs();
465 Node::InputEdges Node::input_edges() {
477 Node::Inputs Node::inputs() const {
487 class Node::InputEdges::iterator final {
522 friend class Node;
532 Node::InputEdges::iterator Node::InputEdges::begin() const {
533 return Node::InputEdges::iterator(use_root_, input_root_);
537 Node::InputEdges::iterator Node::InputEdges::end() const {
538 return Node::InputEdges::iterator(use_root_ - count_, input_root_ + count_);
541 Edge Node::InputEdges::operator[](int index) const {
546 class Node::Inputs::const_iterator final {
550 using value_type = Node*;
556 Node* operator*() const { return *input_ptr_; }
580 friend class Node::Inputs;
589 Node::Inputs::const_iterator Node::Inputs::begin() const {
594 Node::Inputs::const_iterator Node::Inputs::end() const {
598 Node* Node::Inputs::operator[](int index) const { return input_root_[index]; }
601 class Node::UseEdges::iterator final {
613 next_ = current_ ? static_cast<Node::Use*>(current_->next) : nullptr;
619 friend class Node::UseEdges;
622 explicit iterator(Node* node)
624 next_(current_ ? static_cast<Node::Use*>(current_->next) : nullptr) {}
626 Node::Use* current_;
627 Node::Use* next_;
631 Node::UseEdges::iterator Node::UseEdges::begin() const {
632 return Node::UseEdges::iterator(this->node_);
636 Node::UseEdges::iterator Node::UseEdges::end() const {
637 return Node::UseEdges::iterator();
642 class Node::Uses::const_iterator final {
646 using value_type = Node*;
647 using pointer = Node**;
648 using reference = Node*&;
650 Node* operator*() const { return current_->from(); }
671 friend class Node::Uses;
674 explicit const_iterator(Node* node)
683 Node::Use* current_;
685 Node::Use* next_;
690 Node::Uses::const_iterator Node::Uses::begin() const {
695 Node::Uses::const_iterator Node::Uses::end() const { return const_iterator(); }