chromium/v8/src/compiler/node.h

// Copyright 2013 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.

#ifndef V8_COMPILER_NODE_H_
#define V8_COMPILER_NODE_H_

#include "src/common/globals.h"
#include "src/compiler/graph-zone-traits.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
#include "src/compiler/types.h"
#include "src/zone/zone-containers.h"

namespace v8 {
namespace internal {
namespace compiler {

// Forward declarations.
class Edge;
class Graph;


// Marks are used during traversal of the graph to distinguish states of nodes.
// Each node has a mark which is a monotonically increasing integer, and a
// {NodeMarker} has a range of values that indicate states of a node.
Mark;

// NodeIds are identifying numbers for nodes that can be used to index auxiliary
// out-of-line data associated with each node.
NodeId;

// A Node is the basic primitive of graphs. Nodes are chained together by
// input/use chains but by default otherwise contain only an identifying number
// which specific applications of graphs and nodes can use to index auxiliary
// out-of-line data, especially transient data.
//
// In addition Nodes only contain a mutable Operator that may change during
// compilation, e.g. during lowering passes. Other information that needs to be
// associated with Nodes during compilation must be stored out-of-line indexed
// by the Node's id.
class V8_EXPORT_PRIVATE Node final {};

Address Node::inputs_location() const {}

ZoneNodePtr* Node::OutOfLineInputs::inputs() {}

std::ostream& operator<<(std::ostream& os, const Node& n);

// Base class for node wrappers.
class NodeWrapper {};

// Wrapper classes for special node/edge types (effect, control, frame states).

class Effect : public NodeWrapper {};

class Control : public NodeWrapper {};

// Typedefs to shorten commonly used Node containers.
NodeDeque;
using NodeSet = ZoneSet<Node*>;
NodeVector;
NodeVectorVector;

class Node::InputEdges final {};

class V8_EXPORT_PRIVATE Node::Inputs final {};

// An encapsulation for information associated with a single use of a node as an
// input from another node, allowing access to both the defining node and
// the node having the input.
class Edge final {};

bool Node::IsDead() const {}

Node::InputEdges Node::input_edges() {}

Node::Inputs Node::inputs() const {}

base::Vector<Node*> Node::inputs_vector() const {}

// A forward iterator to visit the edges for the input dependencies of a node.
class Node::InputEdges::iterator final {};


Node::InputEdges::iterator Node::InputEdges::begin() const {}


Node::InputEdges::iterator Node::InputEdges::end() const {}

Edge Node::InputEdges::operator[](int index) const {}

// A forward iterator to visit the inputs of a node.
class Node::Inputs::const_iterator final {};


Node::Inputs::const_iterator Node::Inputs::begin() const {}


Node::Inputs::const_iterator Node::Inputs::end() const {}

Node* Node::Inputs::operator[](int index) const {}

// A forward iterator to visit the uses edges of a node.
class Node::UseEdges::iterator final {};


Node::UseEdges::iterator Node::UseEdges::begin() const {}


Node::UseEdges::iterator Node::UseEdges::end() const {}


// A forward iterator to visit the uses of a node.
class Node::Uses::const_iterator final {};


Node::Uses::const_iterator Node::Uses::begin() const {}


Node::Uses::const_iterator Node::Uses::end() const {}

inline Node::Uses::const_iterator begin(const Node::Uses& uses) {}
inline Node::Uses::const_iterator end(const Node::Uses& uses) {}

}  // namespace compiler
}  // namespace internal
}  // namespace v8

#endif  // V8_COMPILER_NODE_H_