I am not sure if we can get what you are asking for without adding a mapping
from Code to JSFunction.


https://codereview.chromium.org/159783002/diff/200001/src/deoptimizer.cc
File src/deoptimizer.cc (right):

https://codereview.chromium.org/159783002/diff/200001/src/deoptimizer.cc#newcode326
src/deoptimizer.cc:326: if (code->marked_for_instant_optimization()) {
On 2014/05/12 12:05:24, titzer wrote:
This isn't the right place for this somehow. It's surprising that
DeoptimizeMarkedCode actually calls the compiler.

Not sure, it seems like the right place to express "deoptimize and
re-optimize immediately semantics". And since we just have the code
object at gc time which we can mark for deoptimization and
re-optimization, it seems to be fine.

https://codereview.chromium.org/159783002/diff/200001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/159783002/diff/200001/src/objects.cc#newcode12352
src/objects.cc:12352: if (instant_optimization)
code->set_marked_for_deoptimization(true);
On 2014/05/12 12:05:24, titzer wrote:
You're setting the wrong thing here, I think. Why don't you collect
the
functions you want to reoptimize here, and then do a loop over them to
compile
them? Then you don't need extra machinery in the deoptimizer.

Done, that was a renaming mistake.

https://codereview.chromium.org/159783002/diff/200001/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/159783002/diff/200001/src/objects.h#newcode5730
src/objects.h:5730: static const int
kMarkedForInstantOptimizationBitCount = 1;
On 2014/05/12 12:05:24, titzer wrote:
This bit is just carrying stuff through the deoptimizer, to a place
that I don't
think it belongs. I think you want to gather the list of functions to
reoptimize
outside of the deoptimization infrastructure and then process them
there.

This is problematic on so many levels:
1) For allocation sites when we set the stack guard for deoptimization
at gc time we just have the dependent code i.e. the code objects. There
is no mapping from code to JSFunction (and friends). Getting the
JSFunction would require us to go over all  JSFunctions and find the
given code objects.
2) If we have that, we could just mark the JSFunction for optimization.
One problem with that approach is that an active activation on the stack
would never get replaced.
3) If we want a list of functions, this list would have to be weak. I do
not want to add another weak list.

WDYT?

https://codereview.chromium.org/159783002/

--
--
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/d/optout.

Reply via email to