On Thu, Nov 7, 2013 at 7:44 PM, dhruvbird <[email protected]> wrote:
>
> On Thursday, November 7, 2013 9:39:04 AM UTC-8, Ben Noordhuis wrote:
>>
>> On Thu, Nov 7, 2013 at 5:22 PM, dhruvbird <[email protected]> wrote:
>> > I'm getting a lot of such lines printed with I run with --trace_opt
>> > --trace_deopt
>> > 1. What does it mean (simplified)?
>> > 2. Any idea how I can find out which operations are leading to this?
>> > 3. Also, the function name isn't printed, but a funny hex number is.
>> > This is
>> > making it hard for me to understand which part of the code is causing
>> > this
>> > issue.
>> >
>> > Thanks!
>> > -Dhruv.
>>
>> V8 tries to hold off on optimizing a hot function until it has
>> determined that the types of arguments and variables in that function
>> are stable.  (For example, that x is always a number in the function
>> f(x) { return x * x }.)
>>
>> That message you're seeing means that the profiler has figured out the
>> first half ('function is hot') but not yet the second half ('types are
>> stable'.)
>
>
> Okay, so is it possible that this is happening because different types are
> passed in to that function all the time? Will the optimizer not create 2
> different functions for each type passed in? I'm basically passing in

Kind of.  V8 generates polymorphic code when the optimizer deems it
worthwhile.  In pseudo-code:

  if (typeof(x) === 'number') {
    // number code path
  } else if (typeof(x) === 'object') {
    // object code path
  } else {
    bailout();
  }

> multiple types to some functions, and those could be the ones that this
> trace is referring to (just a hunch). Is there any way to know which
> functions (on what line# in the code) this error is referring to?

It's already telling you - it's the ToObject() function. :-)

It's a function in src/runtime.js that's used to do type coercion.  I
guess it's unsurprising that it shows up a lot with that 'not enough
typeinfo' message - the type of its argument changes all the time.

-- 
-- 
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to