• bmeurer's avatar
    [turbofan] Further optimize spread/apply with arguments/rest parameters. · 1c555714
    bmeurer authored
    Extend the use list check for the arguments object/rest parameters
    during apply/spread optimization to allow for more cases, such that
    even in code like
    
      function foo() {
        if (arguments.length === 1) return arguments[0];
        return bar.apply(this, arguments);
      }
    
    we don't need to materialize the arguments object. This obviously comes
    with a phase ordering problem, which we resolve by introducing a
    waitlist in the JSCallReducer, which contains the nodes that we should
    check again after all the other reductions are done, and which might
    then be reducible. This is not 100% ideal, but get's us closer to where
    we want to be, and it's crucial to speed up Node core, especially the
    event emitter.
    
    BUG=v8:4551,v8:5511, v8:5726
    R=petermarshall@chromium.org
    
    Review-Url: https://codereview.chromium.org/2956233002
    Cr-Commit-Position: refs/heads/master@{#46337}
    1c555714
js-call-reducer.h 3.51 KB