ZipPy status update
java at stefan-marr.de
Fri Dec 20 23:55:05 PST 2013
On 21 Dec 2013, at 01:45, Wei Zhang <ndrzmansn at gmail.com> wrote:
> Only functions that close over its declaration frame (closures) use
> PArguments#declarationFrame. This doesn't happen so often in my
> In most cases, zippy accesses local variable using VirtualFrames,
> which is optimized by Truffle/Graal.
Well, closures are much more common in Smalltalk, I think.
>> I do wonder, what is the typical granularity of a Python method?
>> At least in SOM, methods seem to be rather small. Perhaps a few AST nodes on average.
>> Could that make a difference?
> Zippy inlines function calls when they become hot. Inlining helps
> performance a lot.
> I strongly recommend you to apply inlining in TruffleSOM if you haven’t yet.
TruffleSOM does inlining. I only see two difference when browsing your code.
The first should actually be a benefit for TruffleSOM: I also inline trivial methods immediately, i.e., if a method just contains a literal or something similar, it is directly inlined without even a function call overhead, only protected by a polymorphic inline cache check node.
The second difference I see is that you have a `prepareBodyNode()` operation that rewrites local variable access nodes. Why is that necessary?
>> Another detail I noticed is that you are using another strategy for type handling in the type system. You use a combination of @TypeCheck and @TypeCast, while I use @ImplicitCast.
>> What is the difference of these two approaches?
> I use @TypeCheck and @TypeCast to customize type checks and
> conversions in ZipPy. I just followed the SimpleLanguage examples in
> Truffle API.
> @ImplicitCast is new to me. I don't know how to use it, since there
> isn’t any related document or example.
There is a tiny example in SimpleLanguage… That’s where I took it from. But I have the feeling the generated code when using @TypeCheck and @TypeCast looks quite a bit simpler.
Thanks for the comments
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
Phone: +32 2 629 2974
Fax: +32 2 629 3525
More information about the graal-dev