Hi,

We'd like to raise a proposal to cache and reuse the crankshaft optimized 
code for discussion.

We know that V8 currently has the compilation cache with which we can cache 
and reuse the baseline JIT code, and we also have the shared optimized code 
for the same CONTEXT. Do we see any feasibility by going further to cache 
and reuse the Crankshaft optimized code for different contexts? I can 
imagine a scenario where if we switch from one page to another in the same 
tab, and they happen to share some common scripts, ideally we may just 
reuse the cached optimized code for those shared hot functions to 
reduce/eliminate the optimization overhead.
We think to support Crankshaft code sharing is not a trivial task. The most 
challenging work we could figure out is that we need to update the 
addresses of the global variables, the maps, and the functions etc. in the 
new context. We can leverage the relocation support in Crankshaft code, but 
unlike GC where we can easily get the information of the new addresses, in 
this (crankshaft code sharing) scenario it's hard to know the new address 
in the new context for a given relocation point. Any suggestions "if" we 
want to do that?
Another direction to reduce the optimization overhead might be further 
tuning/improving the parallel recompilation in current V8. This might be a 
more reasonable approach and a more general one which benefits more usual 
cases but the benefit may be smaller then crankshaft code sharing in the 
specific scenario. (Is the scenario crankshaft code sharing is effective 
common enough? Or are there any more scenarios that can fit the sharing 
optimization?)

We'd like to hear more opinions from the mailing list before we decide and 
start to move forward. Any comments or suggestions are highly appreciated.

Thanks, -Yuqiang


-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to