Truffle CallNode API
Stefan Marr
java at stefan-marr.de
Wed Mar 5 07:57:03 PST 2014
Hi Christian:
I finally adopted CallNodes, however I wonder how this interacts with things like lexical scoping.
Until now, I had special treatment for lexical scoping of blocks that get inlined.
How do I communicate that to your inlining framework?
I found the `split()` method in RootNode, which happens to be unused in SimpleLanguage, and without a comment, I am kind of unsure whether it is the right hook.
Is the idea that I return my properly contextualized copy from split?
Perhaps a brief example to show the problem I am thinking of:
foo: a = (
a = 0 ifTrue: [ ^ a + 1 ]
ifFalse: [ ^ a + ‘foobar' ]
)
Both blocks are methods that are eventually inlined. However, they both access `a`, and thus, they depend on FrameSlot of it.
Now, extending the example by introducing the bar and baz methods:
bar = ( ^ self foo: 0 )
baz = ( ^ self foo: ‘something and ' )
When #foo: gets inlined into these two methods, I need to use independent copies of the original two block methods in each of the inlined versions, so that the FrameSlot can specialize independently. #bar is supposed to specialize completely for integers, and #baz should specialize to strings.
Thanks
Stefan
On 29 Jan 2014, at 22:09, Christian Humer <christian.humer at gmail.com> wrote:
> I just updated the Truffle Inlining API with a more robust solution (will
> get pushed to openjdk this night).
> I removed the old API namely the following interfaces InlinableCallSite and
> InlinedCallSite.
> As a replacement for those classes you should now use a new class CallNode.
> This class is already a Node and can directly be used as such inside of an
> polymorphic function inline cache.
> For further information on how to use it please see SLDirectDispatchNode
> and the javadoc in the CallNode class.
>
> Feel free to ask further questions.
>
> Thanks.
>
> - Christian Humer
--
Stefan Marr
INRIA Lille - Nord Europe
http://stefan-marr.de/research/
More information about the graal-dev
mailing list