Comment #3 on issue 4353 by [email protected]: Inlining code containing an array literal leads to a performance loss
https://code.google.com/p/v8/issues/detail?id=4353

Disregard my previous comment, which I deleted. It is kinda a Crankshaft problem - inability to inline push at sites that are slightly polymorphic (in this case FAST_SMI_ELEMENTS vs FAST_ELEMENTS). But it is also a runtime problem - absence of more reliable ArrayPush fast path. I think the ancient ArrayPush call stub could at least handle this without constantly falling into runtime. Seems to be a very unfortunate regression.

Small repro:

function a() { return []; }
function b() { return []; }

function pushy(arr, obj) {
  for (var i = 0; i < 100; i++) {
    arr.push(obj);
  }
}

var o = {}
pushy(a(), o);  // immediately after the first push
                // a() starts producing FAST_ELEMENTS arrays
%OptimizeFunctionOnNextCall(pushy);
pushy(a(), o);  // optimized, push inlined

pushy(b(), o);  // DEOPT! because first time you call b you get an
                // empty FAST_SMI_ELEMENTS array.
%OptimizeFunctionOnNextCall(pushy);
pushy(a(), o);  // Now push is *not* inlined
pushy(b(), o);



--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" 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