Truffle: Incompatible RootNode/TruffleRuntime API changes

Christian Humer christian.humer at
Mon Jan 20 10:22:08 PST 2014

Hey folks,

There will be a binary incompatible change to the Truffle API with the
automated push to openjdk this night 3:00 AM CET.

Until now FrameDescriptor instances were stored inside CallTarget
instances. However this turned out to be a bad choice if you want to inline
your method and duplicate your FrameDescriptor to specialize your local
variables independently. For the inlined version of a method we do not
duplicate the CallTarget, but instead we duplicate just the RootNode inside
the CallTarget. Because of that most guest languages already stored the
FrameDescriptor also in their RootNode implementations.

This is the reason why we decided to move the primary location of the
FrameDescriptor to the RootNode. This led to a couple of
binary-incompatible API changes which should be straight forward to fix.
Find a list of these incompatible changes below:

1) Additional constructor in RootNode: RootNode(SourceSection,
Fix: Instead of passing the FrameDescriptor to
TruffleRuntime#createCallTarget you should now use this new constructor.

2) TruffleRuntime#createCallTarget(RootNode, FrameDescriptor)
changed to
Fix: Just remove the passed additional argument but ensure that the
FrameDescriptor is passed to the previously created RootNode instead.

3) DefaultCallTarget#getFrameDescriptor() removed
Fix: Call DefaultCallTarget#getRootNode() and afterwards
RootNode#getFrameDescriptor() instead.

Don't hesitate to contact me if you have any further questions.

Christian Humer

More information about the graal-dev mailing list