public final class NodeClass<T> extends FieldIntrospection<T>
Node
type. The metadata includes:
Node.Input
and Node.Successor
as well as methods
for iterating over such fields.IterableNodeType
class.Modifier and Type | Class and Description |
---|---|
protected static class |
NodeClass.EdgeInfo
Describes a field representing an input or successor edge in a node.
|
(package private) static interface |
NodeClass.InplaceUpdateClosure |
protected static class |
NodeClass.InputInfo
Describes a field representing an input edge in a node.
|
protected static class |
NodeClass.NodeFieldsScanner |
data
unsafe
Constructor and Description |
---|
NodeClass(Class<T> clazz,
NodeClass<? super T> superNodeClass) |
NodeClass(Class<T> clazz,
NodeClass<? super T> superNodeClass,
FieldsScanner.CalcOffset calcOffset,
int[] presetIterableIds,
int presetIterableId) |
Modifier and Type | Method and Description |
---|---|
(package private) static Map<Node,Node> |
addGraphDuplicate(Graph graph,
Graph oldGraph,
int estimatedNodeCount,
Iterable<? extends Node> nodes,
Graph.DuplicationReplacement replacements) |
private void |
addIterableId(int newIterableId) |
(package private) static int |
allocatedNodeIterabledIds() |
Node |
allocateInstance()
Returns a newly allocated node for which no subclass-specific constructor has been called.
|
private static boolean |
assertUpdateValid(Node node,
Edges edges,
int index,
Node newEdge) |
private static boolean |
containsId(int iterableId,
int[] iterableIds) |
static <T> NodeClass<T> |
create(Class<T> c)
|
private static void |
createNodeDuplicates(Graph graph,
Iterable<? extends Node> nodes,
Graph.DuplicationReplacement replacements,
Map<Node,Node> newNodes) |
boolean |
dataEquals(Node a,
Node b) |
private static boolean |
deepEquals0(Object e1,
Object e2) |
private static int |
deepHashCode0(Object o) |
static <T> NodeClass<T> |
get(Class<T> superclass) |
Fields[] |
getAllFields() |
EnumSet<InputType> |
getAllowedUsageTypes() |
private static <T extends Annotation> |
getAnnotationTimed(AnnotatedElement e,
Class<T> annotationClass) |
Edges |
getEdges(Edges.Type type)
Gets the input or successor edges defined by this node class.
|
Edges |
getInputEdges() |
Class<T> |
getJavaClass() |
String |
getNameTemplate()
The template used to build the
Verbosity.Name version. |
Edges |
getSuccessorEdges() |
boolean |
isCanonicalizable()
Determines if this node type implements
Canonicalizable . |
boolean |
isCommutative()
Determines if this node type implements
Canonicalizable.BinaryCommutative . |
boolean |
isLeafNode() |
boolean |
isSimplifiable()
Determines if this node type implements
Simplifiable . |
boolean |
isValid(Position pos,
NodeClass<?> from,
Edges fromEdges) |
int |
iterableId() |
int[] |
iterableIds() |
String |
shortName() |
String |
toString() |
private static void |
transferEdges(Graph graph,
Graph.DuplicationReplacement replacements,
Map<Node,Node> newNodes,
Node oldNode,
Node node,
Edges.Type type) |
private static void |
transferEdgesDifferentNodeClass(Graph graph,
Graph.DuplicationReplacement replacements,
Map<Node,Node> newNodes,
Node oldNode,
Node node) |
private static NodeList<Node> |
updateEdgeListCopy(Node node,
NodeList<Node> list,
NodeClass.InplaceUpdateClosure duplicationReplacement,
Edges.Type type) |
(package private) static void |
updateEdgesInPlace(Node node,
NodeClass.InplaceUpdateClosure duplicationReplacement,
Edges edges) |
(package private) void |
updateInputSuccInPlace(Node node,
NodeClass.InplaceUpdateClosure duplicationReplacement) |
int |
valueNumber(Node n) |
boolean |
valueNumberable() |
private boolean |
verifyIterableIds() |
getClazz, getData
createCString, readCString, writeCString
private static final DebugTimer Init_FieldScanning
private static final DebugTimer Init_FieldScanningInner
private static final DebugTimer Init_AnnotationParsing
private static final DebugTimer Init_Edges
private static final DebugTimer Init_Data
private static final DebugTimer Init_AllowedUsages
private static final DebugTimer Init_IterableIds
private static final Class<?> NODE_CLASS
private static final Class<?> INPUT_LIST_CLASS
private static final Class<?> SUCCESSOR_LIST_CLASS
private static AtomicInteger nextIterableId
private final InputEdges inputs
private final SuccessorEdges successors
private final NodeClass<? super T> superNodeClass
private final boolean canGVN
private final int startGVNNumber
private final String nameTemplate
private final int iterableId
private final EnumSet<InputType> allowedUsageTypes
private int[] iterableIds
private static final DebugMetric ITERABLE_NODE_TYPES
private final DebugMetric nodeIterableCount
private final boolean isCanonicalizable
Canonicalizable
.private final boolean isCommutative
Canonicalizable.BinaryCommutative
.private final boolean isSimplifiable
Simplifiable
.private final boolean isLeafNode
private static <T extends Annotation> T getAnnotationTimed(AnnotatedElement e, Class<T> annotationClass)
private void addIterableId(int newIterableId)
private boolean verifyIterableIds()
private static boolean containsId(int iterableId, int[] iterableIds)
public Fields[] getAllFields()
getAllFields
in class FieldIntrospection<T>
public int[] iterableIds()
public int iterableId()
public boolean valueNumberable()
public boolean isCanonicalizable()
Canonicalizable
.public boolean isCommutative()
Canonicalizable.BinaryCommutative
.public boolean isSimplifiable()
Simplifiable
.static int allocatedNodeIterabledIds()
public EnumSet<InputType> getAllowedUsageTypes()
private static int deepHashCode0(Object o)
public int valueNumber(Node n)
private static boolean deepEquals0(Object e1, Object e2)
public boolean dataEquals(Node a, Node b)
static void updateEdgesInPlace(Node node, NodeClass.InplaceUpdateClosure duplicationReplacement, Edges edges)
private static boolean assertUpdateValid(Node node, Edges edges, int index, Node newEdge)
void updateInputSuccInPlace(Node node, NodeClass.InplaceUpdateClosure duplicationReplacement)
private static NodeList<Node> updateEdgeListCopy(Node node, NodeList<Node> list, NodeClass.InplaceUpdateClosure duplicationReplacement, Edges.Type type)
public Edges getEdges(Edges.Type type)
public Edges getInputEdges()
public Edges getSuccessorEdges()
public Node allocateInstance()
public Class<T> getJavaClass()
public String getNameTemplate()
Verbosity.Name
version. Variable parts are specified
using {i#inputName} or {p#propertyName}.static Map<Node,Node> addGraphDuplicate(Graph graph, Graph oldGraph, int estimatedNodeCount, Iterable<? extends Node> nodes, Graph.DuplicationReplacement replacements)
private static void createNodeDuplicates(Graph graph, Iterable<? extends Node> nodes, Graph.DuplicationReplacement replacements, Map<Node,Node> newNodes)
private static void transferEdgesDifferentNodeClass(Graph graph, Graph.DuplicationReplacement replacements, Map<Node,Node> newNodes, Node oldNode, Node node)
private static void transferEdges(Graph graph, Graph.DuplicationReplacement replacements, Map<Node,Node> newNodes, Node oldNode, Node node, Edges.Type type)
public boolean isLeafNode()