On Sat, Nov 9, 2013 at 4:57 AM, dhruvbird <[email protected]> wrote:
>> 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.
>
>
> ah! thanks - this helped me fix the issue. There were 3 in all:
> 1. Polymorphic types as you mentioned above.
> 2. lambdas resulting from the use of forEach() instead of for(...)
> 3. Calls to hasOwnProperty() were resulting in deopt. I didn't find any docs
> about this anywhere. Shifting to if (obj[prop]) instead of if
> (obj.hasOwnProperty(prop)) helped a great deal.
>
> Do you know if [3] is a known issue?

Not that I know of.  Might be worth reporting.

-- 
-- 
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