Nodes in Graal: ParameterNode
Juan Jose Fumero
juan.fumero at ed.ac.uk
Tue Mar 18 17:17:33 UTC 2014
Hello,
I am working with lambda expression on JDK8 and Graal. My question is
related with the creation of new nodes in the Graph to update or change
the information.
Given this lambda expression:
stream.map((x,y) -> x + y);
The StructuredGraph is the following:
0|StartNode
1|Parameter(0)
2|Parameter(1)
3|FrameState at 0
4|MethodCallTarget
5|Invoke#intValue
6|FrameState at 4
8|MethodCallTarget
9|Invoke#intValue
10|FrameState at 8
12|+
13|MethodCallTarget
14|Invoke#valueOf
15|FrameState at 12
17|Return
13|Invoke#valueOf
Parameter(0) and Parameter(1) are Objects in the moment that I get the
lambda expression. But later on, I know that could be Integer[],
Double[], etc.
I would like to rewrite this part of the Graph with the new information.
Is there any utility in Graal to do that?
For instance: if I get the parameterNode from the previous graph:
if (((ObjectStamp) parameterNode.stamp()).type().isArray()) {
...
}
The nodes Parameter(0) and Parameter(1) in the lambda expression are not
arrays. What I want to do is to change or update these nodes. What I am
using now is a new node (paramNode):
IntegerStamp integerStamp = new IntegerStamp(Kind.Int);
ParameterNode paramNode = new ParameterNode(index, integerStamp);
newGraph.unique(paramNode);
But I need also to store the array information (size and dimension). The
aim is facilitates the OpenCL code generation from this expression.
Many thanks
Juanjo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the graal-dev
mailing list