So to be clear, this is for OSR or just invoking crankshaft? In my
mind, I am viewing them as 2 different things (although I guess OSR is
part of crankshaft), the first for optimizing the function as it goes,
and the other trying to recompile the function for its next use.

Is it that seeing the same JS Function at the top of the stack several
times in a row, which means that its still executing the same function
, or that the same function has been invoked multiple times  and now
its deemed "hot" for optimization.



On Fri, Mar 13, 2015 at 1:46 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
> On Fri, Mar 13, 2015 at 6:14 PM, Malek Musleh <malek.mus...@gmail.com> wrote:
>> Hi,
>>
>> I am trying to get a better understanding of when the OSR optimization
>> is invoked. As per my understanding, CrankShaft is only invoked for
>> functions which have been seen at least 2, based on the parameter
>> kProfilerTicksBeforeOptimization = 2 in runtime-profiler.cc. But
>> because there might be functions that get invoked only once, because
>> they may be "long running", there is opportunity for optimizing the
>> long running function via on stack replacement.
>>
>> My specific question is how does the runtime profiler determine if the
>> function in question is "long enough" to attempt OSR? I can see OSR is
>> not attempted if there are too many formal parameters, but not where
>> it is decided that it passes the checks?
>>
>>
>> Malek
>
> If I understand your question right: V8 inserts checks in function
> prologs and around loop edges where it calls into the run-time.[0]  If
> the run-time sees the same JS function at the top of the stack several
> times in a row, and if that function meets all criteria, it will
> optimize it.
>
> Hope that helps.  Let me know if I need to go into more detail.
>
> [0]  That's the "call StackCheck" and "call InterruptCheck"
> instructions you see in the generated machine code.  The stack check
> doubles as an interrupt check.
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the Google 
> Groups "v8-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/v8-users/qXapyd-Yc_Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to