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. On Mon, Feb 29, 2016 at 9:30 AM, Scott Hulbert <sahulb...@gmail.com> wrote: > I am seeing lines such as: > > [compiling method 0x39790c6f2379 <JS Function getVirtuals > (SharedFunctionInfo 0x2e54cd11ffa9)> using Crankshaft] > [aborted optimizing 0x39790c6f2379 <JS Function getVirtuals > (SharedFunctionInfo 0x2e54cd11ffa9)> because: Unsupported phi use of const > variable] > > In spite of this code not using `const` declarations (nor the method that > invokes it). I even tried replacing `const` with `var` in all > `node_modules` files on a smaller project and saw the same issue. > > This leads me to believe the explanation is inaccurate and the aborted > optimization is not directly related to use of ES6 const? > > Here's the above function that won't optimize, though it's technically > already copied into our codebase and I've tried rewriting it a few > different ways: > https://github.com/tgriesser/bookshelf/blob/ca08ec0850f758ec5610e3c543db5a276026624e/plugins/virtuals.js#L92-L100 > > Thanks, > > Scott Hulbert > > -- > -- > 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. > -- -- 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.