1. 05 May, 2020 1 commit
  2. 14 Apr, 2020 1 commit
    • Leszek Swirski's avatar
      [test] Create one Isolate per unit test (not test suite) · 0c2530ff
      Leszek Swirski authored
      Change the unittests Isolate mixin to create one Isolate per test,
      rather than one per test suite. We usually run these tests independently
      in separate processes anyway, so this shouldn't affect normal test
      execution, but it will avoid Isolate state leaking across tests when
      running the unittests binary directly.
      
      Take this opportunity to also clean up the mixins, changing counter
      initialization and forcing pointer compression into template traits.
      
      Bug: v8:10142
      Change-Id: If92046f9c6f2056252d099faed04d97844ef7319
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2143818Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67110}
      0c2530ff
  3. 04 Mar, 2020 1 commit
    • Timothy Gu's avatar
      Reland "Use context of then function for PromiseResolveThenableJob" · 92a2f0c7
      Timothy Gu authored
      This is a reland of 93253978
      
      Original change's description:
      > Use context of then function for PromiseResolveThenableJob
      > 
      > When a microtask is executed, we need to use an appropriate,
      > non-detached Context for its execution. Currently with
      > PromiseResolveThenableJobs [1], the Context used is always drawn from
      > the realm of the Promise constructor being used. This may cause
      > non-intuitive behavior, such as in the following case:
      > 
      >   const DeadPromise = iframe.contentWindow.Promise;
      >   const p = DeadPromise.resolve({
      >     then() {
      >       return { success: true };
      >     }
      >   });
      >   p.then(result => { console.log(result); });
      > 
      >   // Some time later, but synchronously...
      >   iframe.src = "http://example.com"; // navigate away.
      >   // DeadPromise's Context is detached state now.
      >   // p never gets resolved, and its reaction handler never gets called.
      > 
      > To fix this behavior, when PromiseResolveThenableJob is being queued up,
      > the `then` method of the thenable should be used to determine the
      > context of the resultant microtask. Doing so aligns with Firefox, and
      > also with the latest HTML spec [2][3].
      > 
      > This change is analogous to CL 1465902, which uses the realm of the
      > reaction handlers to determine the Context PromiseReactionJobs run in.
      > 
      > [1]: https://tc39.es/ecma262/#sec-promiseresolvethenablejob
      > [2]: https://html.spec.whatwg.org/C/#enqueuejob(queuename,-job,-arguments)
      > [3]: https://github.com/whatwg/html/pull/5212
      > 
      > Bug: v8:10200
      > Change-Id: I2312788eeea0f9e870c13cf3cb5730a87d15609e
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2071624
      > Commit-Queue: Timothy Gu <timothygu@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Shu-yu Guo <syg@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#66507}
      
      Bug: v8:10200
      Change-Id: I5af003a06c60b0c8cd19de47f847a947d40d046c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2082109Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Timothy Gu <timothygu@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#66586}
      92a2f0c7
  4. 29 Feb, 2020 1 commit
    • Francis McCabe's avatar
      Revert "Use context of then function for PromiseResolveThenableJob" · 7558e182
      Francis McCabe authored
      This reverts commit 93253978.
      
      Reason for revert: Causing blink layout failures. See 
      
      https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Linux%20Future/2684
      
      Original change's description:
      > Use context of then function for PromiseResolveThenableJob
      > 
      > When a microtask is executed, we need to use an appropriate,
      > non-detached Context for its execution. Currently with
      > PromiseResolveThenableJobs [1], the Context used is always drawn from
      > the realm of the Promise constructor being used. This may cause
      > non-intuitive behavior, such as in the following case:
      > 
      >   const DeadPromise = iframe.contentWindow.Promise;
      >   const p = DeadPromise.resolve({
      >     then() {
      >       return { success: true };
      >     }
      >   });
      >   p.then(result => { console.log(result); });
      > 
      >   // Some time later, but synchronously...
      >   iframe.src = "http://example.com"; // navigate away.
      >   // DeadPromise's Context is detached state now.
      >   // p never gets resolved, and its reaction handler never gets called.
      > 
      > To fix this behavior, when PromiseResolveThenableJob is being queued up,
      > the `then` method of the thenable should be used to determine the
      > context of the resultant microtask. Doing so aligns with Firefox, and
      > also with the latest HTML spec [2][3].
      > 
      > This change is analogous to CL 1465902, which uses the realm of the
      > reaction handlers to determine the Context PromiseReactionJobs run in.
      > 
      > [1]: https://tc39.es/ecma262/#sec-promiseresolvethenablejob
      > [2]: https://html.spec.whatwg.org/C/#enqueuejob(queuename,-job,-arguments)
      > [3]: https://github.com/whatwg/html/pull/5212
      > 
      > Bug: v8:10200
      > Change-Id: I2312788eeea0f9e870c13cf3cb5730a87d15609e
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2071624
      > Commit-Queue: Timothy Gu <timothygu@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Shu-yu Guo <syg@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#66507}
      
      TBR=verwaest@chromium.org,timothygu@chromium.org,syg@chromium.org
      
      Change-Id: I81737750f8b369567ba586c5a2cfb489836b7e74
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:10200
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2081091Reviewed-by: 's avatarFrancis McCabe <fgm@chromium.org>
      Commit-Queue: Francis McCabe <fgm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#66510}
      7558e182
  5. 28 Feb, 2020 1 commit
  6. 24 Feb, 2020 1 commit
  7. 30 Jul, 2019 1 commit
    • Sathya Gunasekaran's avatar
      [WeakRefs] Make cleanup callback run as a task · 743ce772
      Sathya Gunasekaran authored
      Previously, this was run as a microtask and this CL changes it to run
      as a separate task as mandated by the current WeakRef spec.
      
      This CL also introduces a FinalizationGroup type to the V8 API
      representing the JSFinalizationGroup. This has a `Cleanup`
      function that runs the cleanup callback associated with it.
      
      SetHostCleanupFinalizationGroupCallback is added to set
      the embedder defined HostCleanupFinalizationGroupCallback.
      
      ClearKeptObject is exposed on the v8::Isolate to reset the strongly
      held set of objects.
      
      The general workflow is the following:
      
      (a) When the GC notices that a given finalization group has dirty
          cells, it calls HostCleanupFinalizationGroupCallback with the given
          finalization group.
      
      (b) As part of HostCleanupFinalizationGroupCallback, the embedder
          enqueues a task that at some point later calls
          FinalizationGroup::Cleanup.
      
      (c) At some point in the future, FinalizationGroup::Cleanup is called,
          which runs the cleanup callback of the finalization group.
      
      This patch also includes d8 changes to use these new APIs. Currently,
      d8 cycles through the enqueued finalization groups after a synchronous
      turn (and it's microtask checkpoint) and runs the cleanup callbacks.
      
      Change-Id: I06eb4da2c103b2792a9c62bc4b98fd4e5c4892fc
      Bug: v8:8179
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655655
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#62984}
      743ce772
  8. 27 May, 2019 1 commit