On 09/27/2012 12:31 PM, riadh chtara wrote:
> For the time needed, could you tell me please how much hours it will( of course approximately) to implement that (js only)?
> Thank you
tl;dr The most practical & useful information to save is likely to be the
monitored type information alone, and not the bytecode (not worth it) or the
assembly (not practical).
This depends what you want to achieve.
Saving the bytecode might be a challenge, the information stored in the
script and aside to it might be tricky to serialize and reload correctly.
Sadly, I don't think saving the bytecode alone is worth doing, the parser is
quite fast and the time spent reading the hard-drive for loading the
bytecode might be save by just calculating it again.
What would be interesting would be to restore the type information aside to
the sources. When a script is running, we are monitoring all the type that
we have seen across the lifetime of the script and this is used to guide
optimizations. This monitoring result is more valuable than the bytecode,
because this is the result of multiple runs and we cannot reproduce it as
fast as the bytecode. The tricky part would be to restore the TypeObject
correctly especially when the TypeObject origin is coming from another script.
I don't think it would be possible to save a compiled (to assembly) version
of the script until we get a baseline compiler which cannot be invalidated
because the way constraints � which are causing invalidations � are handled.
They are mostly registered by external data which means that another script
can hold a constraint which has a lifetime right on the compiled script.
This is a non local problem. So saving the compiled version might imply
saving everything. And this might be an order of magnitude bigger than the
plain sources.
--
Nicolas B. Pierron