Graal - first step

Thomas Wuerthinger thomas.wuerthinger at
Wed Apr 4 02:23:29 PDT 2012

On 04.04.2012 00:16, Rémi Forax wrote:
>>> Another related problem is that there is currently no node that does 
>>> profiling so
>>> I can't generate a graph of nodes with profile information that I 
>>> will be able to extract
>>> using Graal interface with Hotspot.
>> It is possible to generate a node that will lower itself to a 
>> store/load to an object that is pointing to the profiling data. The 
>> Graal snippet mechanism would allow to specify the lowering in Java 
>> code (like we do with arraycopy intrinsification, see 
>> ArrayCopySnippets class). What kind of general-purpose interface 
>> would you suggest for weaving profiling code into the Graal IR?
> I think some nodes like IfNode, SwitchNode, InstanceOfNode etc. should 
> have a boolean
> asking for generating the record code, in order to record branch taken,
> type profile and exception seen.
> By example for IfNode, a boolean profileBranchTakenProbability will ask
> the code generator to generate the record code for each branch of the if.
> and as you said, a new phase should be introduced that will add new 
> Nodes (using snippet)
> to generate the record code where it should be generated.
We could add a phase that automatically inserts such code on every 
control split. What is the format / Java data structure in which you 
would like to have it recorded?

- thomas

More information about the graal-dev mailing list