instrument the HIR by synthesizing code and inserting it
thomas.wuerthinger at oracle.com
Tue Feb 19 15:02:38 PST 2013
Sure, you can define your own subclasses of FloatingNode or FixedNode and add instances of those classes to the graph. You can also create instances of the existing classes. You can first add macro nodes to the graph and then later lower them by replacing them with multiple other nodes. See the method HotSpotRuntime.lower for examples of this. The most fancy way to lower is using snippets (we use this for example for the MonitorEnterNode instances). We will start building up gradually information about how to use the various Graal APIs at https://wikis.oracle.com/display/OpenJDK/Graal. Until then, you can use the existing ways how we do graph transformations in the compiler as examples.
On Feb 18, 2013, at 9:22 PM, lpxz <lpxz at ust.hk> wrote:
> Another question,
> I am aware that graal can easily remove nodes and duplicate nodes in the graphical IR representation.
> I wonder if does graal provide the APIs for synthesizing new nodes and inserting them. For example, I want to insert the
> counter implementation to each control flow edge to profile the execution frequency of each CFG edge.
> Thanks a lot!
More information about the graal-dev