1. 13 Feb, 2018 5 commits
    • Benedikt Meurer's avatar
      [builtins] Optimize PromiseResolveThenableJob for the common case. · 1f8dcc5d
      Benedikt Meurer authored
      The idea here is that in case the `thenable` is a JSPromise and `then`
      is the initial `Promise.prototype.then` method, and the @@species lookup
      chain is intact, we can skip creating the temporary promise and the
      closures (with the shared context), and instead directly call into our
      PerformPromiseThen. This is sound since - given above mentioned
      conditions - our short-cut
      
        PerformPromiseThen(thenable, undefined, undefined, promise_to_resolve)
      
      is not observably different from the actual
      
        resolve, reject = CreateResolvingFunctions(promise_to_resolve)
        result_capability = NewPromiseCapability(%Promise%)
        PerformPromiseThen(thenable, resolve, reject, result_capability)
      
      except through PromiseHooks (and potentially via the async stack
      traces). So we disable the fast-path if either promise hooks are enabled
      or the debugger is active for now.
      
      This improves the performance on the wikipedia benchmark by 20-25% and
      the bluebird-doxbee benchmark by around 20%.
      
      Bug: v8:7253
      Change-Id: I23c92ad365c2b71d65057573f2d8febe2afe00b0
      Reviewed-on: https://chromium-review.googlesource.com/911800
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51261}
      1f8dcc5d
    • Benedikt Meurer's avatar
      [builtins] Refactor the promise resolution and rejection logic. · c0412961
      Benedikt Meurer authored
      This introduces dedicated builtins
      
        - FulfillPromise,
        - RejectPromise, and
        - ResolvePromise,
      
      which perform the corresponding operations from the language
      specification, and removes the redundant entry points and the
      excessive inlining of these operations into other builtins. We
      also add the same logic on the C++ side, so that we don't need
      to go into JavaScript land when resolving/rejecting from the
      API.
      
      The C++ side has a complete implementation, including full support
      for the debugger and the current PromiseHook machinery. This is to
      avoid constantly crossing the boundary for those cases, and to also
      simplify the CSA side (and soon the TurboFan side), where we only
      do the fast-path and bail out to the runtime for the general handling.
      
      On top of this we introduce %_RejectPromise and %_ResolvePromise,
      which are entry points used by the bytecode and parser desugarings
      for async functions, and also used by the V8 Extras API. Thanks to
      this we can uniformly optimize these in TurboFan, where we have
      corresponding operators JSRejectPromise and JSResolvePromise, which
      currently just call into the builtins, but middle-term can be further
      optimized, i.e. to skip the "then" lookup for JSResolvePromise when
      we know something about the resolution.
      
      In TurboFan we can also already inline the default PromiseCapability
      [[Reject]] and [[Resolve]] functions, although this is not as effective
      as it can be right now, until we have inlining support for the Promise
      constructor (being worked on by petermarshall@ right now) and/or SFI
      based CALL_IC feedback.
      
      Overall this change is meant as a refactoring without significant
      performance impact anywhere; it seems to improve performance of
      simple async functions a bit, but otherwise is neutral.
      
      Bug: v8:7253
      Change-Id: Id0b979f9b2843560e38cd8df4b02627dad4b6d8c
      Reviewed-on: https://chromium-review.googlesource.com/911632Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51260}
      c0412961
    • Sergiy Byelozyorov's avatar
      Add Peter as an owner of the JSTests benchmark · 07955372
      Sergiy Byelozyorov authored
      This information is useful to know whom to assign bugs to when these tests are
      crashing on our infrastructure.
      
      R=petermarshall@chromium.org
      
      No-Try: true
      Change-Id: Ia165e0236602cae73e144011537d642e3535fa6b
      Reviewed-on: https://chromium-review.googlesource.com/908563
      Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
      Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51259}
      07955372
    • Sergiy Byelozyorov's avatar
      Whitespace CL · 5e006978
      Sergiy Byelozyorov authored
      R=sergiyb@google.com
      
      No-Try: true
      Bug: chromium:616879
      Change-Id: If52f419c7447c88313526fceed10e7dd2e89b10c
      Reviewed-on: https://chromium-review.googlesource.com/913948
      Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
      Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51258}
      5e006978
    • Sergiy Byelozyorov's avatar
      Correct try bucket name for internal V8 bots on swarming · d8dc1fc5
      Sergiy Byelozyorov authored
      TBR=machenbach@chromium.org
      
      No-Try: true
      Bug: chromium:616879
      Change-Id: I49d3f12216cdc2d26761e8f82fef18512d8eb6fd
      Reviewed-on: https://chromium-review.googlesource.com/915141
      Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
      Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51257}
      d8dc1fc5
  2. 12 Feb, 2018 30 commits
  3. 10 Feb, 2018 3 commits
  4. 09 Feb, 2018 2 commits
    • Ben L. Titzer's avatar
      Normalize names of call descriptor local variables · 855cb90d
      Ben L. Titzer authored
      This is a purely cosmetic change. Rename all local variables and
      parameters of type CallDescriptor* to "call_descriptor".
      For locals that are now named "call_descriptor", use auto upon
      initialization, following the Google style guide
      (https://google.github.io/styleguide/cppguide.html#auto).
      
      Note: fields in structs and classes were not renamed in this CL.
      
      R=clemensh@chromium.org,mstarzinger@chromium.org,jarin@chromium.org
      
      Change-Id: Ic6f7afdba12f7b97741b098a9d0e0f58c41c587e
      Reviewed-on: https://chromium-review.googlesource.com/909866
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51223}
      855cb90d
    • Benedikt Meurer's avatar
      [ic] Support negative indices for typed array OOB accesses. · 317fad95
      Benedikt Meurer authored
      Extend the current OOB support for typed arrays to also handle the
      negative integer indices in the fast-path. This is safe because in
      ECMAScript we never look up integer indexed properties (including
      negative indices) on typed arrays in the prototype chain.
      
      This reduces the performance cliff shown in the benchmark on the
      relevant bug from
      
        console.timeEnd: Runtime deopt, 596.185000
        console.timeEnd: Runtime deopt, 1444.289000
        console.timeEnd: Runtime deopt, 1445.191000
        console.timeEnd: Runtime deopt, 1443.008000
      
      to
      
        console.timeEnd: Runtime deopt, 590.017000
        console.timeEnd: Runtime deopt, 784.899000
        console.timeEnd: Runtime deopt, 792.428000
        console.timeEnd: Runtime deopt, 786.740000
      
      which corresponds to a 2x improvement overall. It's not for free,
      especially not in this benchmark, but the cliff isn't as bad as
      it was previously.
      
      Bug: v8:7027
      Change-Id: Icf8a7ee87bb7ebc54f82c1b9166fc5e78c12bc0e
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/911574Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51222}
      317fad95