I found the bailout reason message to be confusing too. What it really is
trying to check is if there is a 'unsupport Phi use of a constant HOLE
value' (Here's the bailout check: [1]).

Changing the `let virtualName` to `var virtualName` in the for-in loop in
your code would fix the problem with the bailout:

function getVirtuals(model) {
    var virtuals
    var attrs = {}
    if (virtuals = model.virtuals) {
        for (*var* virtualName in virtuals) {
            attrs[virtualName] = getVirtual(model, virtualName)
        }
    }
    return attrs
}


As for the explanation, someone who understands Hydrogen IR better
would have to explain that. I don't understand why the culprit phi
value (v88) is there to begin with. It doesn't seem to have real uses.
For convenience, here's a link to the Hydrogen IR for the
`getVirtuals` function: [2].


[1] 
https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/crankshaft/hydrogen.cc&sq=package:chromium&type=cs&rcl=1456748799&l=4005

[2] https://gist.github.com/ofrobots/6d8d391a047ee8f0766a


On Mon, Feb 29, 2016 at 2:12 PM, Scott Hulbert <[email protected]> wrote:

> In interest of providing extra information, my installation of Node 5.6.0
> is using V8 version 4.6.85.31.
>
> I’ve also committed the `node_modules` directory for my sample project and
> replaced all the instances of `const` I could find via search with `var`:
> https://github.com/hulbert/bookshelf-sample-v8/commits/modules-directory
>
> Results are the same.
>
> Best,
> Scott Hulbert
>
> On Mon, Feb 29, 2016 at 12:40 PM, Ben Noordhuis <[email protected]>
> wrote:
>
>> On Mon, Feb 29, 2016 at 1:23 PM, Jakob Kummerow <[email protected]>
>> wrote:
>> > This is indeed surprising.
>> > Crankshaft predates ES6, so this has nothing to do with ES6 const. That
>> > said, I don't see why this function would bail out; and in a quick repro
>> > attempt it doesn't. Do you have an example I can run that reproduces
>> this
>> > behavior?
>> >
>> > Also, is this actually a performance problem for you? Crankshaft aborts
>> > compilation in some cases by design, often there's no need to worry
>> about
>> > it.
>>
>> If it helps, see [0] - we had to revert some changes to the url module
>> because of this issue.  That's with V8 4.8.271.17.
>>
>> The benchmarks are in [1].  They normally run in a child process but
>> you can run an individual benchmark directly with `./node
>> benchmark/url/url-parse.js type=one n=25e4`.
>>
>> [0] https://github.com/nodejs/node/pull/5300
>> [1] https://github.com/nodejs/node/blob/v5.7.0/benchmark/url/url-parse.js
>>
>> --
>> --
>> v8-users mailing list
>> [email protected]
>> 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/hsUrt4I2D98/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> --
> 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/d/optout.
>



-- 
Ali

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

Reply via email to