1. 19 Dec, 2018 1 commit
  2. 31 Oct, 2018 1 commit
  3. 26 Oct, 2018 1 commit
  4. 23 Oct, 2018 1 commit
  5. 16 Oct, 2018 2 commits
    • Benedikt Meurer's avatar
      [async] Improve wrapper promise initialization code. · 4f023875
      Benedikt Meurer authored
      The code for the initialization of the wrapper promise was using the
      generic InitializeJSObjectFromMap() helper, which generates a loop to
      initialization all fields of some generic object. In this particular
      case we're constructing a JSPromise, so we only need to initialize the
      elements and properties pointers, since all the other fields are taken
      care of by the PromiseInit() call on the next line anyways.
      
      Bug: v8:7253, v8:8238
      Change-Id: If11963d1f94607ed9e48788f597c81c7344aafbe
      Reviewed-on: https://chromium-review.googlesource.com/c/1281602Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56665}
      4f023875
    • Benedikt Meurer's avatar
      [async] Reduce generated size of `await` builtins. · 8201da29
      Benedikt Meurer authored
      There's a AsyncBuiltinsAssembler::InitializeNativeClosure() helper which
      is used by the `await` builtins to initialize the native closures, which
      are registered as fulfill/reject handlers. This helper initializes a
      JSFunction based on the builtin SharedFunctionInfo. Since we are dealing
      with builtins here, there's no point in using the fully generic helper
      CodeStubAssembler::GetSharedFunctionInfoCode(), but we can immediately
      assume that the SharedFunctionInfo::function_data() field contains a Smi
      builtin index (guarded by TNode CASTs).
      
      This almost cuts the generated code size for the `await` builtins in a
      half, and might also yield some performance improvements due to reduced
      register and instruction cache pressure.
      
      Bug: v8:7253, v8:8238
      Change-Id: I3415c2f9e0f04a7154c4bf4c3fe8156854dbfe13
      Reviewed-on: https://chromium-review.googlesource.com/c/1281604Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56662}
      8201da29
  6. 15 Oct, 2018 1 commit
    • Maya Lekova's avatar
      [async-await] Fix INIT hook with --harmony-await-optimization · 860ddfc0
      Maya Lekova authored
      Split the runtime function for initializing a promise into AwaitPromisesInit
      and AwaitPromisesInitOld, the former not firing the INIT hook and being used
      by the AwaitOptimized builtin. In addition to this the AsyncHooks now caches
      all the previously inited promises and checks that the init hook is not fired
      twice for the same promise.
      
      Modified test expectations for the new async ids in the async hooks tests.
      
      Bug: v8:8300
      Change-Id: If4a17e501b2a233578fa70b6442f219473f001d9
      Reviewed-on: https://chromium-review.googlesource.com/c/1280442
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56642}
      860ddfc0
  7. 10 Oct, 2018 1 commit
  8. 08 Oct, 2018 1 commit
  9. 05 Oct, 2018 1 commit
  10. 29 Sep, 2018 1 commit
    • Benedikt Meurer's avatar
      [async-await] Unify handling of await closure contexts. · 9e99297e
      Benedikt Meurer authored
      Change the way that the (internal) await closures store the link to the
      generator object by introducing a dedicated AwaitContext, which stores
      the generator object into the extension slot (instead of misusing a
      regular FunctionContext here). Also unify the allocation+initialization
      of these contexts in the await-related builtins (both for async functions
      and generators).
      
      The rationale behind this is that for (zero-cost) async stack traces, we
      will need to dig into these contexts and we can do better checking with
      a dedicated instance type there. As an additional benefit, we save one
      word per await context, since we just use (the otherwise unused) extension
      slot to remember the generator object. As yet another benefit we will
      never accidentally use any of these contexts in the regular scope chain
      lookups, meaning we can also catch bugs there. And last but not least
      the objects printing machinery understands these contexts now and can
      even print the generator object for AwaitContexts for short printing,
      which is really valuable for debugging.
      
      Tbr: ulan@chromium.org
      Bug: v8:7253, v8:7522, v8:8015
      Change-Id: I86955f5701e694e8a10b91ebe5f52705aa90968d
      Reviewed-on: https://chromium-review.googlesource.com/1249491Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56301}
      9e99297e
  11. 20 Sep, 2018 1 commit
  12. 06 Aug, 2018 1 commit
  13. 20 Jun, 2018 1 commit
    • Maya Lekova's avatar
      Reland "[async] Optimize await and AsyncFromSyncIterator" · ef8c1861
      Maya Lekova authored
      This is a reland of 21c0d77e
      
      Original change's description:
      > [async] Optimize await and AsyncFromSyncIterator
      > 
      > Simplify the promise wrapping in await and
      > %AsyncFromSyncIteratorPrototype%.next/return/throw to reuse the PromiseResolve
      > primitive. Now await takes 1 tick instead of 3 on the microtask queue.
      > 
      > Change-Id: I7e99b8689eb8fcb09c48915b11c1e06684dc0f1a
      > Reviewed-on: https://chromium-review.googlesource.com/1090272
      > Commit-Queue: Maya Lekova <mslekova@chromium.org>
      > Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
      > Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Reviewed-by: Mathias Bynens <mathias@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#53853}
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: Ifa5b2fb8b2fb84b635b2dc1b6455d6aaf154cbfd
      Reviewed-on: https://chromium-review.googlesource.com/1106977
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53900}
      ef8c1861
  14. 19 Jun, 2018 2 commits
  15. 05 Jun, 2018 1 commit
  16. 30 May, 2018 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] reworked async stack instrumentation for async functions · b6c9086c
      Alexey Kozyatinskiy authored
      New intstrumentation consists of:
      - kAsyncFunctionSuspended when async function is suspended on await
        (called on each await),
      - kAsyncFunctionFinished when async function is finished.
      
      Old instrumentation was based on reusing async function promise.
      Using this promise produces couple side effects:
      - for any promise instrumentation we first need to check if it is
        special case for async function promise or not - it requires
        expensive reading from promise object.
      - we capture stack for async functions even if it does not contain
        awaits.
      - we do not properly cancel async task created for async function.
      
      New intsrumntation resolved all these problems as well as provide
      clear mapping between async task and generator which we can use later
      to fetch scope information for async functions on pause.
      
      R=dgozman@chromium.org,yangguo@chromium.org
      
      Bug: v8:7078
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: Ifdcec947d91e6e3d4d5f9029bc080a19b8e23d41
      Reviewed-on: https://chromium-review.googlesource.com/1043096Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53445}
      b6c9086c
  17. 24 May, 2018 1 commit
  18. 14 May, 2018 1 commit
  19. 02 May, 2018 1 commit
  20. 09 Apr, 2018 1 commit
  21. 06 Apr, 2018 2 commits
    • Michael Achenbach's avatar
      Revert "[cleanup] Refactor the Factory" · 503e07c3
      Michael Achenbach authored
      This reverts commit f9a2e24b.
      
      Reason for revert: gc stress failures not all fixed by follow up.
      
      Original change's description:
      > [cleanup] Refactor the Factory
      > 
      > There is no good reason to have the meat of most objects' initialization
      > logic in heap.cc, all wrapped by the CALL_HEAP_FUNCTION macro. Instead,
      > this CL changes the protocol between Heap and Factory to be AllocateRaw,
      > and all object initialization work after (possibly retried) successful
      > raw allocation happens in the Factory.
      > 
      > This saves about 20KB of binary size on x64.
      > 
      > Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      > Change-Id: Icbfdc4266d7be8b48d2fe085f03411743dc6a0ca
      > Reviewed-on: https://chromium-review.googlesource.com/959533
      > Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Hannes Payer <hpayer@chromium.org>
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52416}
      
      TBR=jkummerow@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,hpayer@chromium.org
      
      Change-Id: Idbbc53478742f3e9525eee83342afc6aedae122f
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/999414Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52420}
      503e07c3
    • Jakob Kummerow's avatar
      [cleanup] Refactor the Factory · f9a2e24b
      Jakob Kummerow authored
      There is no good reason to have the meat of most objects' initialization
      logic in heap.cc, all wrapped by the CALL_HEAP_FUNCTION macro. Instead,
      this CL changes the protocol between Heap and Factory to be AllocateRaw,
      and all object initialization work after (possibly retried) successful
      raw allocation happens in the Factory.
      
      This saves about 20KB of binary size on x64.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Change-Id: Icbfdc4266d7be8b48d2fe085f03411743dc6a0ca
      Reviewed-on: https://chromium-review.googlesource.com/959533
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52416}
      f9a2e24b
  22. 19 Feb, 2018 1 commit
  23. 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
  24. 08 Feb, 2018 1 commit
    • Adam Klein's avatar
      Revert "[builtins] Mega-revert to address the Dev blocker in crbug.com/808911." · 3916401e
      Adam Klein authored
      This reverts commit 14108f4c.
      
      Reason for revert: Not the culprit for Canary microtask crashes
      
      Original change's description:
      > [builtins] Mega-revert to address the Dev blocker in crbug.com/808911.
      > 
      > - Revert "[builtins] Save one word in contexts for Promise.all."
      >   This reverts commit 7632da06.
      > - Revert "[builtins] Also use the Promise#then protector for Promise#finally()."
      >   This reverts commit d4f072ce.
      > - Revert "[builtins] Don't mess with entered context for MicrotaskCallbacks."
      >   This reverts commit 6703dacd.
      > - Revert "[debugger] Properly deal with settled promises in catch prediction."
      >   This reverts commit 40dd0658.
      > - Revert "[builtins] Widen the fast-path for Promise builtins."
      >   This reverts commit db0556b7.
      > - Revert "[builtins] Unify PerformPromiseThen and optimize it with TurboFan."
      >   This reverts commit a582199c.
      > - Revert "[builtins] Remove obsolete PromiseBuiltinsAssembler::AppendPromiseCallback."
      >   This reverts commit 6bf88852.
      > - Revert "[builtins] Turn NewPromiseCapability into a proper builtin."
      >   This reverts commit 313b490d.
      > - Revert "[builtins] Inline InternalPromiseThen into it's only caller"
      >   This reverts commit f7bd6a2f.
      > - Revert "[builtins] Implement Promise#catch by really calling into Promise#then."
      >   This reverts commit b23b098f.
      > - Revert "[promise] Remove incorrect fast path"
      >   This reverts commit 0f6eafe8.
      > - Revert "[builtins] Squeeze JSPromise::result and JSPromise::reactions into a single field."
      >   This reverts commit 8a677a28.
      > - Revert "[builtins] Refactor promises to reduce GC overhead."
      >   This reverts commit 8e7737cb.
      > 
      > Tbr: hpayer@chromium.org
      > Bug: chromium:800651, chromium:808911, v8:5691, v8:7253
      > Change-Id: I8c8ea5ed32ed62f6cd8b0d027a3707ddd891e5f1
      > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      > Reviewed-on: https://chromium-review.googlesource.com/906991
      > Commit-Queue: Yang Guo <yangguo@chromium.org>
      > Commit-Queue: Adam Klein <adamk@chromium.org>
      > Reviewed-by: Adam Klein <adamk@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#51158}
      
      Change-Id: I09d958cbebd635a325809072a290f2f53df8c5d4
      Tbr: adamk@chromium.org,yangguo@chromium.org,bmeurer@chromium.org
      Bug: chromium:800651, chromium:808911, v8:5691, v8:7253
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/908988Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51181}
      3916401e
  25. 07 Feb, 2018 1 commit
    • Benedikt Meurer's avatar
      [builtins] Mega-revert to address the Dev blocker in crbug.com/808911. · 14108f4c
      Benedikt Meurer authored
      - Revert "[builtins] Save one word in contexts for Promise.all."
        This reverts commit 7632da06.
      - Revert "[builtins] Also use the Promise#then protector for Promise#finally()."
        This reverts commit d4f072ce.
      - Revert "[builtins] Don't mess with entered context for MicrotaskCallbacks."
        This reverts commit 6703dacd.
      - Revert "[debugger] Properly deal with settled promises in catch prediction."
        This reverts commit 40dd0658.
      - Revert "[builtins] Widen the fast-path for Promise builtins."
        This reverts commit db0556b7.
      - Revert "[builtins] Unify PerformPromiseThen and optimize it with TurboFan."
        This reverts commit a582199c.
      - Revert "[builtins] Remove obsolete PromiseBuiltinsAssembler::AppendPromiseCallback."
        This reverts commit 6bf88852.
      - Revert "[builtins] Turn NewPromiseCapability into a proper builtin."
        This reverts commit 313b490d.
      - Revert "[builtins] Inline InternalPromiseThen into it's only caller"
        This reverts commit f7bd6a2f.
      - Revert "[builtins] Implement Promise#catch by really calling into Promise#then."
        This reverts commit b23b098f.
      - Revert "[promise] Remove incorrect fast path"
        This reverts commit 0f6eafe8.
      - Revert "[builtins] Squeeze JSPromise::result and JSPromise::reactions into a single field."
        This reverts commit 8a677a28.
      - Revert "[builtins] Refactor promises to reduce GC overhead."
        This reverts commit 8e7737cb.
      
      Tbr: hpayer@chromium.org
      Bug: chromium:800651, chromium:808911, v8:5691, v8:7253
      Change-Id: I8c8ea5ed32ed62f6cd8b0d027a3707ddd891e5f1
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/906991
      Commit-Queue: Yang Guo <yangguo@chromium.org>
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51158}
      14108f4c
  26. 02 Feb, 2018 1 commit
    • Benedikt Meurer's avatar
      [builtins] Unify PerformPromiseThen and optimize it with TurboFan. · a582199c
      Benedikt Meurer authored
      This creates a uniform PerformPromiseThen builtin, which performs the
      operation with the same name from the spec, except that it expects the
      handlers to be either undefined or callable already, since this is only
      relevant for a single callsite (namely Promise.prototype.then).
      
      Introduce a matching operator JSPerformPromiseThen into TurboFan, which
      represents this operation and removes the additional checks in case of
      Promise.prototype.then based on the information we can derived from the
      receiver maps.
      
      This yields a nice 20-25% improvement on Promise.prototype.then, as
      illustrated by the following micro-benchmark
      
      ```js
      const N = 1e7;
      function inc(x) { return x + 1; }
      function chain(promise) {
        return promise.then(inc).then(value => {
            if (value < N) chain(Promise.resolve(value));
          });
      }
      console.time('total');
      chain(Promise.resolve(0));
      setTimeout(console.timeEnd.bind(console, 'total'));
      ```
      
      which goes from around 1230ms to 930ms with this patch.
      
      Bug: v8:7253
      Change-Id: I5712a863acdbe7da3bb8e621887c7b952148c51a
      Reviewed-on: https://chromium-review.googlesource.com/899064Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#51071}
      a582199c
  27. 30 Nov, 2017 1 commit
  28. 17 Nov, 2017 1 commit
    • Ulan Degenbaev's avatar
      [runtime] Make layout descriptor helper safe for concurrent marking. · 61bf2cc6
      Ulan Degenbaev authored
      The layout descriptor helper computes the object header size using
      map->instance_size() and map->GetInObjectProperties().
      
      It races with finalization of slack tracking, which changes both
      the instance size and the in-object properties count.
      
      This patch replaces the in-object properties count byte in the map
      with the byte that stores the start offset of in-object properties.
      
      The new byte can be used in the layout descriptor to compute the
      object header size and it is immutable.
      
      This patch also renames InstanceSize to InstanceSizeInWords where
      the instance size is represented in words.
      
      Bug: chromium:786069, chromium:694255
      Change-Id: I4b48c6944d3fe8a950bd7b0ba43d75216b177a78
      Reviewed-on: https://chromium-review.googlesource.com/776720
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49461}
      61bf2cc6
  29. 13 Nov, 2017 1 commit
  30. 25 Oct, 2017 1 commit
  31. 16 Oct, 2017 1 commit
  32. 13 Oct, 2017 1 commit
  33. 13 Sep, 2017 1 commit
  34. 07 Sep, 2017 1 commit
  35. 09 Aug, 2017 1 commit
  36. 08 Aug, 2017 1 commit
  37. 24 Jul, 2017 1 commit