InputType

Lukas Stadler lukas.stadler at oracle.com
Tue Apr 8 14:56:25 UTC 2014


Hey,

I pushed some changes that change the way inputs are specified:
The @Input annotation now includes the type of the edge (value, memory, guard, condition, …)
It defaults to InputType.Value, so normal inputs look exactly the same as before:

    @Input private ValueNode x;

For other types of inputs it looks like this:

    @Input(InputType.Condition) private LogicNode condition;

The Node.replaceAtUsages(InputType type, Node other) method can use this information to replace only specific usages of a node.
Also, when iterating over inputs using NodeClassIterator.nextPosition(), each input can be queried for its type.

All this should be verified (by assertions), therefore the @NodeInfo annotation was also extended, so that it now includes an “allowedUsageTypes” field:

@NodeInfo(allowedUsageTypes = {InputType.Memory})
public class MemoryProxyNode extends ProxyNode implements ...

Whether InputType.Value is an allowed usage type for a node is determined automatically by looking at the Stamp of the node - if it is not void, then the node can be used as a value.

The main reason for this change is that some node types have multiple personalities, e.g., an InvokeNode can be used by value edges and by memory edges, and some algorithms need to know which is which.

- Lukas


More information about the graal-dev mailing list