[Truffle] Generated type system overrides isObject()/asObject() methods.

Thomas Wuerthinger thomas.wuerthinger at oracle.com
Thu Oct 3 00:04:32 PDT 2013


Stefan,

The recommended way to initialise local variables from arguments is via WriteLocalNode and ReadArgumentNode instances (one for each argument) that are added at the beginning of the method. This way the local variable can also be specialized on primitive type (and the FrameSlot can be a final field in the WriteLocalNode instance).

There is one question I have about the determineContext and getSelfFromMaterialized methods. Could the self value be transmitted via an argument? The lookup over the chain of frames seems slow (and forces materialisation), so is there some other way one could pass these values? Could you describe the requirements for this self value in the system?

Thanks, thomas

On Oct 1, 2013, at 10:57 PM, Stefan Marr <java at stefan-marr.de> wrote:

> Hi Thomas:
> 
> On 01 Oct 2013, at 21:40, Thomas Wuerthinger <thomas.wuerthinger at oracle.com> wrote:
> 
>> Based on the results we are seeing on Truffle/Ruby versus Topaz, we expect that TruffleSOM will be able to outperform the PyPy version.
> 
> Sounds promising.
> 
>> Before introducing the type system for specialisations, we should check that the Truffle-level inlining works as expected and frame materialisation is avoided wherever possible. We'll take a look at running some of your examples. Do you have a particular one we should look at first?
> 
> Well, that's where I am stuck. I am not yet making the toolchain happy with my use of VirtualFrames.
> 
> Here the steps to check out a concrete version:
> 
>    git clone --recursive https://github.com/smarr/TruffleSOM.git
>    cd TruffleSOM
>    git checkout 1f6c74149f17b888094f6a953a854a32d83705f2
>    ant tests
> 
> This is using the latest, unmodified Graal code.
> 
> In my Graal folder, I can then execute the following:
> 
>    export SOM=/Users/smarr/Projects/SOM/TruffleSOM 
>    ./mx.sh --vm server vm -Xbootclasspath/a:$SOM/build/classes:$SOM/libs/com.oracle.truffle.api.jar:$SOM/libs/com.oracle.truffle.api.dsl.jar som.vm.Universe -cp $SOM/Smalltalk $SOM/Examples/Benchmarks/Loop.som
> 
> So, my problems start with: "Frame escapes at: […] ExpressionNode.executeGeneric(VirtualFrame)".
> Any other of the benchmarks results in the same, I think.
> 
> On the branch 'poc/constant-args-and-temps', I tried to get rid of the materialization of the frame during initializing it, but that didn't had a lot of success.
> 
> Get the branch with: `git checkout -b const origin/poc/constant-args-and-temps`
> The main commit is [1].
> 
> So, well, if you got suggestions how to approach these escaped frames, I would be more than happy to try something new.
> 
> Thanks
> Stefan
> 
> [1] https://github.com/smarr/TruffleSOM/commit/8be69f33677dd7738d3e437cd74e4f1d151f09da
> 
> -- 
> Stefan Marr
> Software Languages Lab
> Vrije Universiteit Brussel
> Pleinlaan 2 / B-1050 Brussels / Belgium
> http://soft.vub.ac.be/~smarr
> Phone: +32 2 629 2974
> Fax:   +32 2 629 3525
> 



More information about the graal-dev mailing list