Separating parsing and execution

Benoit Daloze eregontp at gmail.com
Mon Aug 3 11:22:37 UTC 2015


On Fri, Jul 31, 2015 at 7:35 PM, Jaroslav Tulach <jaroslav.tulach at oracle.com
> wrote:

> Dear Truffle language writers,
> have you ever thought about what Truffle does when the same source code is
> executed multiple times in the same JVM? Did you wonder if that is
> effective?
> Well, it wasn't, but today we are making the first step to improve it. We
> now
> ask you to parse the Source first and delay execution for later:
>
> http://lafo.ssw.uni-linz.ac.at/hg/truffle/rev/e7c2d36daf72#l5.21
>
> How does that help? Well, we can cache the CallTarget (and its ASTs) and if
> the same file gets executed twice, we can re-use them. There is just one
> catch: you cannot store single execution data in your nodes persistently.
> We
> are still working on the best way to store/obtain them. Right now there is
>
> http://lafo.ssw.uni-linz.ac.at/hg/truffle/rev/e7c2d36daf72#l5.47
>
> but it may not be the best solution. It is likely to change a bit.
>

Where should we store the local execution state then?
For instance, execution profiles?
Also, of course the nodes will specialize and create new nodes, is that a
special form of allowed state?

The current strategy to keep a never-run copy of the AST
and create the CallTarget on a copy of that AST when needed seems to be
much easier (but of course the compilation results are not shared).


More information about the graal-dev mailing list