It will be optimized when V8 decides that it's hot. (or maybe when V8 inlines it into some other function, etc). "Hotness" is estimated based on many factors, e.g. statistical profiling. You can use --trace-opt to see functions that are being optimized by V8.
Why do you want to ensure that this function is optimized? If it is frequently called and it takes non-trivial amount of time to execute --- it will be optimized. -- Vyacheslav Egorov On Fri, Dec 16, 2011 at 9:11 PM, Egor Egorov <[email protected]> wrote: > > Yes but how many calls do I have to fire till this optimisation takes > place? > > On Friday, December 16, 2011 1:51:23 PM UTC+2, Vyacheslav Egorov wrote: > [] > > call it with numbers only V8 will in the end generate code that is >> specialized appropriately for the number case. >> >> -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
