1. 27 Mar, 2018 1 commit
  2. 16 Feb, 2018 1 commit
    • Benedikt Meurer's avatar
      [turbofan] Properly optimize calls to promise extras. · 13ca9a0f
      Benedikt Meurer authored
      Add TurboFan inlining support for the following V8 Extras:
      
       - v8.createPromise
       - v8.rejectPromise
       - v8.resolvePromise
      
      These are used by the streams implementation in Chrome currently, and
      were previously not inlined into TurboFan, although TurboFan already
      had all the necessary functionality (namely the JSCreatePromise,
      JSRejectPromise and JSResolvePromise operators). We might eventually
      want to use these functions in Node core as well (at least short-term
      for Node 10), to replace the C++ internal API functions with the same
      name that are currently being used by parts of Node core.
      
      For this to work, the rejectPromise and resolvePromise builtins had
      to be moved back to CSA, as for JavaScript builtins we still have the
      policy that the optimizing compiler must not inline them. But that's
      straight-forward since the CSA has all the necessary functionality
      available anyways.
      
      Bug: v8:7253
      Change-Id: I39ab015c379956cd58ace866e17f8ec23b2257b2
      Reviewed-on: https://chromium-review.googlesource.com/924146Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51332}
      13ca9a0f
  3. 13 Feb, 2018 1 commit
    • 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
  4. 06 Feb, 2018 1 commit
    • Mathias Bynens's avatar
      [v8-extras] Remove `simpleBind` · fefee7dc
      Mathias Bynens authored
      The `simpleBind` function exposed by V8 Extras was initially added to
      work around the terrible performance of `Function.prototype.bind` at
      the time. Nowadays `Function.prototype.bind` is significantly faster
      and fully optimized by TurboFan, however, so there’s no need for the
      `simpleBind` helper anymore.
      
      Bug: chromium:807522
      Change-Id: I1a0456e2aa34f92a3c9a0234a812b660f969d016
      Reviewed-on: https://chromium-review.googlesource.com/903164Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Mathias Bynens <mathias@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51108}
      fefee7dc
  5. 19 Dec, 2017 1 commit
  6. 15 Dec, 2017 2 commits
  7. 30 Jun, 2017 1 commit
    • Igor Sheludko's avatar
      [runtime] Cleanup js/prologue.js. · f79b3d4e
      Igor Sheludko authored
      This CL removes unused utils.InstallFunctions, utils.InstallGetter(),
      utils.SetFunctionName, utils.OverrideFunction and respective runtime
      functions (%FunctionSetSharedName and %FunctionRemovePrototype).
      
      This CL is one of a series of cleanup CL which are the preliminary steps for
      improving function closures creation.
      
      Bug: v8:6459
      Change-Id: I0fb5940ed628f0c1958f585411e2fca3e2038054
      Reviewed-on: https://chromium-review.googlesource.com/548037
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46336}
      f79b3d4e
  8. 06 Jun, 2017 1 commit
    • Igor Sheludko's avatar
      [parser] Introduce SharedFunctionInfo::has_shared_name(). · 9a2c18f5
      Igor Sheludko authored
      Properly propagate the fact that the function has a statically known name from
      parser to SharedFunctionInfo objects. The empty string that has been set as
      name before this CL does not help to distinguish cases like:
        var o1 = { ''(){} };
        var o1 = { [foo()](){} };
      or
        var o2 = { get ''(){} };
        var o2 = { get [foo()](){} };
      
      This is a preliminary step for using different layouts for closure objects with
      and without computed names.
      
      TBR=bmeurer@chromium.org, marja@chromium.org
      
      Bug: v8:6459
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I10afa6f4bda7881c3714711a75f720f83c1d875d
      Reviewed-on: https://chromium-review.googlesource.com/522073
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45744}
      9a2c18f5
  9. 24 Apr, 2017 1 commit
  10. 19 Apr, 2017 1 commit
  11. 06 Apr, 2017 1 commit
  12. 31 Mar, 2017 1 commit
  13. 13 Mar, 2017 1 commit
    • binji's avatar
      Reland moving Atomics builtins to C++ · 65200967
      binji authored
      This reverts the previous revert, commit
      5a04f4fd.
      
      Previously reverted changes:
      
      >    Revert "[SAB] Move Atomics builtins to C++"
      >
      >     This reverts commit 2b9840d8.
      >
      >     Revert "[SAB] Remove unreachable Uint8Clamped atomics paths"
      >
      >     This reverts commit d1160fb1.
      >
      >     Revert "Remove tiny unit test for MinSimple/MaxSimple"
      >
      >     This reverts commit 837760ec.
      >
      >     Revert "Remove infrastructure for experimental JS natives"
      >
      >     This reverts commit 8cfe45b6.
      
      These changes were reverted to improve a perf regression on a Chrome
      bot. Since then, the regression has reappeared, then disappeared again
      all from seemingly unrelated changes.
      
      BUG=v8:6033
      TBR=adamk@chromium.org,hpayer@chromium.org,yangguo@chromium.org
      
      Review-Url: https://codereview.chromium.org/2732213005
      Cr-Commit-Position: refs/heads/master@{#43758}
      65200967
  14. 27 Feb, 2017 1 commit
  15. 24 Feb, 2017 1 commit
    • adamk's avatar
      Remove infrastructure for experimental JS natives · 8cfe45b6
      adamk authored
      Now that no harmony-flagged features are implemented in experimental
      JS, most of this is simply dead code.
      
      As PostExperimentals() is no longer needed, I also removed the use of
      Import() in the debug context, allowing the deletion of PostDebug()
      along with PostExperimentals(); cleanup code is moved to the
      end of PostNatives.
      
      Also gets rid of some longer-dead code in prologue.js related to
      TypedArrays, and some duplicate code for setting up SharedArrayBuffer
      builtins.
      
      Review-Url: https://codereview.chromium.org/2705293004
      Cr-Commit-Position: refs/heads/master@{#43418}
      8cfe45b6
  16. 23 Feb, 2017 2 commits
  17. 15 Feb, 2017 1 commit
    • littledan's avatar
      [bootstrapper] Remove Intl experimental natives files · 407d6bf1
      littledan authored
      These experimental natives previously only installed functions to the
      appropriate parent. In this patch, the exports container is retained
      so that the bootstrapper may install the functions instead. This
      change is intended to reduce startup time. SharedArrayBuffer retains
      some experimental natives exported from JS; this may be addressed
      in a follow-on patch. The patch includes some minor cleanup of the
      bootstrap process by removing "experimental exports", which was unused.
      
      R=yangguo@chromium.org
      BUG=v8:5880
      CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng
      
      Review-Url: https://codereview.chromium.org/2683083003
      Cr-Commit-Position: refs/heads/master@{#43221}
      407d6bf1
  18. 17 Jan, 2017 1 commit
  19. 04 Jan, 2017 1 commit
  20. 14 Oct, 2016 1 commit
  21. 13 Oct, 2016 1 commit
    • jgruber's avatar
      [regexp] Port RegExp.prototype[@@replace] · 33a4faa4
      jgruber authored
      This moves the implementation of @@replace from regexp.js to builtins-regexp.cc
      (the TurboFan fast path) and runtime-regexp.cc (slow path). The fast path
      handles all cases in which the regexp itself is an unmodified JSRegExp
      instance, the given 'replace' argument is not callable and does not contain any
      '$' characters (i.e. we are doing a string replacement).
      
      BUG=v8:5339
      
      Review-Url: https://codereview.chromium.org/2398423002
      Cr-Commit-Position: refs/heads/master@{#40253}
      33a4faa4
  22. 24 Sep, 2016 1 commit
    • littledan's avatar
      Move async/await JS support code out of experimental natives · 13b8a123
      littledan authored
      The file formerly known as src/js/harmony-async-await.js does not
      expose anything directly to JavaScript code; it just makes a few
      functions available on the native context for the parser desugaring
      to expand into. Experimental natives have various issues with
      larger amounts of code, so this patch moves the JS builtins to
      support async functions out of experimental natives and into the
      core snapshot. The change would be done eventually anyway, but this
      patch does it before removing the flag to support shipping the
      feature while avoiding the pitfalls of experimental natives.
      
      Drive by cleanup: remove more unused functions from the whitelist for experimental natives.
      
      BUG=v8:5427,v8:4483
      
      Review-Url: https://codereview.chromium.org/2365123002
      Cr-Commit-Position: refs/heads/master@{#39706}
      13b8a123
  23. 23 Sep, 2016 1 commit
    • littledan's avatar
      Improve stack traces for async functions · f296dad9
      littledan authored
      This patch tracks the stack of async functions differently from other
      Promise async stack tracking. With this patch, the stack trace of a
      callstack of async functions should look similarly to the call stack
      if all of the functions were synchronous. An example can be found in
      the updated test expectations: https://codereview.chromium.org/2362923002 .
      
      The new stack traces are implemented using existing mechanisms in the
      inspector. The inspector has two ways to save async stack traces: recurring
      and non-recurring stacks. An example of a non-recurring stack is setTimeout,
      and a recurring one is saved for setInterval. Recurring stacks are deleted
      only when a special "cancel" function is called, rather than being deleted
      after being used the first time. Previous Promise async stack tracking always
      used non-recurring stacks.
      
      For async functions, this patch saves a recurring stack. The top frame of
      the stack is duplicated, as the resuming function contains a similar frame;
      the devtools frontend is responsible for removing or marking this frame,
      which it can do based on seeing the [async function] line which follows it.
      The second frame will instead be provided by the resuming execution
      context. The recurring stack is saved when the async function is entered, and
      it is deleted from a finally block. The id of the stack is saved in the outer
      Promise being constructed by the async function. When an intermediate
      throwaway Promise will be triggered as a reaction, it will be identified as
      such based on its debugging metadata, and the corresponding async function's
      recurring stack will be used.
      
      BUG=v8:4483
      
      Review-Url: https://codereview.chromium.org/2357423002
      Cr-Commit-Position: refs/heads/master@{#39695}
      f296dad9
  24. 20 Sep, 2016 2 commits
    • littledan's avatar
      Reland Async/await Promise dependency graph · 1b414e28
      littledan authored
      This patch knits together Promises returned by async/await such that when
      one async function awaits the result of another one, catch prediction works
      across the boundaries, whether the exception comes synchronously or
      asynchronously. Edges are added in three places:
      - When a locally uncaught await happens, if the value passed into await
        is a Promise, from the awaited value to the Promise under construction
        in the broader async function
      - From a "throwaway" Promise, which may be found on the Promise debug
        stack, to the Promise under construction in the async function that
        surrounds it
      - When a Promise is resolved with another Promise (e.g., when returning a
        Promise from an async function)
      
      In this reland, the caught tests are broken up into four parts to avoid
      timeouts.
      
      BUG=v8:5167
      
      Review-Url: https://codereview.chromium.org/2346363004
      Cr-Commit-Position: refs/heads/master@{#39564}
      1b414e28
    • littledan's avatar
      Revert of Async/await Promise dependency graph (patchset #30 id:550001 of... · 100336f5
      littledan authored
      Revert of Async/await Promise dependency graph (patchset #30 id:550001 of https://codereview.chromium.org/2317383002/ )
      
      Reason for revert:
      Need to break up test into smaller tests to avoid timeouts
      
      Original issue's description:
      > Async/await Promise dependency graph
      >
      > This patch knits together Promises returned by async/await such that when
      > one async function awaits the result of another one, catch prediction works
      > across the boundaries, whether the exception comes synchronously or
      > asynchronously. Edges are added in three places:
      > - When a locally uncaught await happens, if the value passed into await
      >   is a Promise, from the awaited value to the Promise under construction
      >   in the broader async function
      > - From a "throwaway" Promise, which may be found on the Promise debug
      >   stack, to the Promise under construction in the async function that
      >   surrounds it
      > - When a Promise is resolved with another Promise (e.g., when returning a
      >   Promise from an async function)
      >
      > BUG=v8:5167
      >
      > Committed: https://crrev.com/7265fdde7c76b9f875b40b0b139515936d491d64
      > Cr-Commit-Position: refs/heads/master@{#39522}
      
      TBR=adamk@chromium.org,jgruber@chromium.org,kozyatinskiy@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:5167
      
      Review-Url: https://codereview.chromium.org/2351953002
      Cr-Commit-Position: refs/heads/master@{#39523}
      100336f5
  25. 19 Sep, 2016 1 commit
    • littledan's avatar
      Async/await Promise dependency graph · 7265fdde
      littledan authored
      This patch knits together Promises returned by async/await such that when
      one async function awaits the result of another one, catch prediction works
      across the boundaries, whether the exception comes synchronously or
      asynchronously. Edges are added in three places:
      - When a locally uncaught await happens, if the value passed into await
        is a Promise, from the awaited value to the Promise under construction
        in the broader async function
      - From a "throwaway" Promise, which may be found on the Promise debug
        stack, to the Promise under construction in the async function that
        surrounds it
      - When a Promise is resolved with another Promise (e.g., when returning a
        Promise from an async function)
      
      BUG=v8:5167
      
      Review-Url: https://codereview.chromium.org/2317383002
      Cr-Commit-Position: refs/heads/master@{#39522}
      7265fdde
  26. 16 Sep, 2016 1 commit
  27. 15 Sep, 2016 1 commit
  28. 13 Sep, 2016 1 commit
    • littledan's avatar
      Mark await expressions as caught or uncaught · edb4d315
      littledan authored
      Handle some examples of the "asynchronous case" by marking await expressions
      as either caught or uncaught; in the caught case, this marks the Promise passed
      in as having a catch predicted. The marking is done in AST numbering, which
      chooses between two different runtime function calls based on catch prediction.
      
      BUG=v8:5167
      
      Review-Url: https://codereview.chromium.org/2276243002
      Cr-Commit-Position: refs/heads/master@{#39394}
      edb4d315
  29. 07 Sep, 2016 1 commit
    • bmeurer's avatar
      [builtins] Migrate Number predicates and make them optimizable. · 7ac19fe5
      bmeurer authored
      Migrate the isNaN, isFinite, Number.isFinite, Number.isInteger,
      Number.isSafeInteger and Number.isNaN predicates to TurboFan
      builtins and make them optimizable (for certain input types) in
      JavaScript callees being optimized by TurboFan. That means both
      the baseline and the optimized version is now always at maximum,
      consistent performance. Especially TurboFan suffered from poor
      baseline (and optimized) performance because it cannot play the
      same weird tricks that Crankshaft plays for %_IsSmi.
      
      This also adds a bunch of new tests to properly cover the use
      of the Harmony predicates in optimized code.
      
      R=franzih@chromium.org
      BUG=v8:5049,v8:5267
      
      Review-Url: https://codereview.chromium.org/2313073002
      Cr-Commit-Position: refs/heads/master@{#39242}
      7ac19fe5
  30. 06 Sep, 2016 1 commit
  31. 01 Sep, 2016 1 commit
  32. 26 Aug, 2016 1 commit
    • littledan's avatar
      Desugar async/await to create the resulting Promise upfront · 5386c006
      littledan authored
      As part of the work to implement catch prediction for async functions,
      the resulting Promise that is the output of the function needs to be
      available earlier for a couple reasons:
      - To be able to do %DebugPushPromise/%DebugPopPromise over the body
        of the async function
      - To be able to pass the resulting promise into AsyncFunctionAwait
        in order to set up the dependency chains
      
      This patch creates the Promise earlier and pushes it onto the debug
      stack; a later patch will set up the dependency chain. Although the
      debug stack is set up, it's not anticipated that this will change
      the catch prediction helpfully yet, as everything will still likely
      be predicted as 'caught' for now, as before.
      
      R=caitp@igalia.com,yangguo@chromium.org
      CC=neis@chromium.org,gsathya@chromium.org
      BUG=v8:5167
      
      Review-Url: https://codereview.chromium.org/2233923003
      Cr-Commit-Position: refs/heads/master@{#38957}
      5386c006
  33. 22 Aug, 2016 1 commit
  34. 09 Aug, 2016 1 commit
  35. 06 Aug, 2016 1 commit
    • littledan's avatar
      [promise] Async/await edge case spec compliance fix · 7826bfa7
      littledan authored
      - Don't read .constructor when returning a Promise from an async function.
        Instead, call out to the internals of Promise.resolve directly.
        This is done by adding back in an "optimization" from an earlier form of
        the async/await code written by Caitlin Potter.
      - Async functions always return a new Promise with a distinct identity,
        even if they simply return another Promise.
      
      R=caitp@igalia.com
      BUG=v8:4483
      
      Review-Url: https://codereview.chromium.org/2219623002
      Cr-Commit-Position: refs/heads/master@{#38404}
      7826bfa7
  36. 04 Aug, 2016 1 commit
    • caitp's avatar
      [promise] separate PerformPromiseThen from PromiseThen · 0272aa50
      caitp authored
      The `PerformPromiseThen` spec-internal operation is used by the async functions
      proposal, in order to ensure that AwaitExpressions are not observable via
      usual mechanisms/hooks, such as Symbol.species.
      
      BUG=v8:5253
      R=littledan@chromium.org, adamk@chromium.org, gsathya@chromium.org, yangguo@chromium.org
      
      Review-Url: https://codereview.chromium.org/2209433003
      Cr-Commit-Position: refs/heads/master@{#38353}
      0272aa50
  37. 03 Aug, 2016 1 commit