16 Commits
Author SHA1 Message Date
Shu-yu Guo 1a2d9b6c8e [tests] Clean up flags for staged JS features
Bug: 391658080
Change-Id: Ib68e18d2f3c31e39236e019ebcdd91701ed6653c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6199809
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#98370}
2025-01-28 08:31:31 -08:00
Leszek Swirski ac3021f6bf Reland "[d8] Add support for onmessage from Workers"
This is a reland of commit a700450d2a

Reland fixes:

  * Include the unsubscription fix in crrev.com/c/5664938
  * Move ownership of the context/callback from the Worker to the
    PerIsolateData. This means the Worker unconditionally posts
    CheckMessageFromWorkerTask, and the main thread decides what to do
    with it.
  * The worker now always knows its parent isolate, and this is the one
    it posts events to. This matches web behaviour.
  * Correspondingly, change callback lookup to happen during
    CheckMessageFromWorkerTask's execution, rather than at the moment of
    posting the CheckMessageFromWorkerTask. This avoids a race between
    the main thread subscribing to message events, and the worker
    emitting them, by serializing these operations on the main thread.
  * We now keep track both of _all_ child workers, and of all child
    workers with registered callbacks. This allows keeping the backward
    compatible behaviour of not waiting for workers to close, while
    allowing the main thread to wait for subscribed workers.

Original change's description:
> [d8] Add support for onmessage from Workers
>
> Add support for Worker.prototype.onmessage, which subscribes the main
> thread Isolate to message events posted by Workers. An isolate's event
> loop will wait until all workers that it has subscribed to have
> terminated (with terminate or close).
>
> Also, onmessage events are supposed to have the message data in a .data
> field on the callback parameter, rather than having the data as the
> parameter itself. So, change the existing Worker onmessage (for posting
> messages _to_ a Worker rather than from it) to send messages like this,
> and update tests to read off the data field from the message they
> receive.
>
> As a cleanup, remove the unused streaming task counter that could also
> make the event loop block.
>
> Change-Id: I205b37131688a237b5bc229dbb2a856dd2390243
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5659938
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94704}

Change-Id: Ieb76e541b9cfc83cb07caa6287050f5c559cbf69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5666586
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94747}
2024-07-01 16:23:12 +00:00
Michael Achenbach 2f32b083de Revert "[d8] Add support for onmessage from Workers"
This reverts commit a700450d2a.

Reason for revert: Suspected to cause a benchmark hang.

Original change's description:
> [d8] Add support for onmessage from Workers
>
> Add support for Worker.prototype.onmessage, which subscribes the main
> thread Isolate to message events posted by Workers. An isolate's event
> loop will wait until all workers that it has subscribed to have
> terminated (with terminate or close).
>
> Also, onmessage events are supposed to have the message data in a .data
> field on the callback parameter, rather than having the data as the
> parameter itself. So, change the existing Worker onmessage (for posting
> messages _to_ a Worker rather than from it) to send messages like this,
> and update tests to read off the data field from the message they
> receive.
>
> As a cleanup, remove the unused streaming task counter that could also
> make the event loop block.
>
> Change-Id: I205b37131688a237b5bc229dbb2a856dd2390243
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5659938
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94704}

Change-Id: I46df79657bafcc1fd11d8f007d759f730cd26040
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5665572
Owners-Override: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#94727}
2024-07-01 07:45:32 +00:00
Leszek Swirski a700450d2a [d8] Add support for onmessage from Workers
Add support for Worker.prototype.onmessage, which subscribes the main
thread Isolate to message events posted by Workers. An isolate's event
loop will wait until all workers that it has subscribed to have
terminated (with terminate or close).

Also, onmessage events are supposed to have the message data in a .data
field on the callback parameter, rather than having the data as the
parameter itself. So, change the existing Worker onmessage (for posting
messages _to_ a Worker rather than from it) to send messages like this,
and update tests to read off the data field from the message they
receive.

As a cleanup, remove the unused streaming task counter that could also
make the event loop block.

Change-Id: I205b37131688a237b5bc229dbb2a856dd2390243
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5659938
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94704}
2024-06-28 10:41:28 +00:00
Marja Hölttä 9ebca66a57 [rab/gsab] Remove --harmony-rab-gsab (has been on by default for a while)
Bug: v8:11111
Change-Id: Ie74e7737f3e2e8730820cf00f1cbc7ae02b515af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5516580
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93848}
2024-05-13 09:19:01 +00:00
Seokho Song 8fcd3f809b Implement Float16Array, Math.f16round, and related DataView
The half-precision floating point after the machine representation
layer depends on the machine architecture.

Hence, represents the half-precision floating point as uint16
with software conversion from third_party/fp16.
Deoptimize Maglev and Turbofan until there is machine-level support.

Proposal: https://github.com/tc39/proposal-float16array

Bug: v8:14012
Change-Id: I10316cf8b67cd54a2cd7dedc6e3e368448be2559
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5082566
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Seokho Song <seokho@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92631}
2024-03-03 08:04:52 +00:00
Marja Hölttä ce18b115c2 [rab/gsab] Decommit the memory whenever possible
Bug: v8:11111
Change-Id: Ic07628bcf6018ea9814a38a0dab3667a7d8f0d69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3755145
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81697}
2022-07-13 16:14:44 +00:00
Marja Hölttä 8d0404d80b Reland [rab/gsab] Add RAB / GSAB support to DataViews
Previous version: https://chromium-review.googlesource.com/c/v8/v8/+/3259648

Fix 1: ValueSerializer <3 JSArrayBufferView
Fix 2: set flags correctly when creating DataViews via the API

Bug: v8:11111
Change-Id: I9cbfdaff29f97c7823eaa3d931689b363e1f4cf7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297708
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78046}
2021-11-23 16:48:54 +00:00
Marja Hölttä a68aa67276 Revert "[rab/gsab] Add RAB / GSAB support to DataViews"
This reverts commit 8f3e53b81d.

Reason for revert: Blink test failures

Original change's description:
> [rab/gsab] Add RAB / GSAB support to DataViews
>
> Bug: v8:11111
> Change-Id: Ice66accee734484302d499b8098056ae1c68faf3
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259648
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78028}

Bug: v8:11111
Change-Id: Icaae7276dfede8c021f3ce1a7e96ed3ec13fe4fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295577
Auto-Submit: Marja Hölttä <marja@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78039}
2021-11-23 09:55:35 +00:00
Marja Hölttä 8f3e53b81d [rab/gsab] Add RAB / GSAB support to DataViews
Bug: v8:11111
Change-Id: Ice66accee734484302d499b8098056ae1c68faf3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259648
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78028}
2021-11-22 19:04:58 +00:00
Marja Hölttä 431aa5e6aa [rab/gsab] TypedArray.prototype.slice: Support RAB / GSAB
Bug: v8:11111
Change-Id: I6a86dd1313a7bfb72024e9857a0c18dd6c83fe3c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160518
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76980}
2021-09-22 05:48:54 +00:00
Marja Hölttä 1e7effd113 [rab/gsab] Fix gsab maxByteLength after transferring to worker
Bug: v8:11111
Change-Id: I41a318d3858e48035ae67e937420e2963a13d871
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3035091
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75878}
2021-07-23 09:30:33 +00:00
Marja Hölttä 607f1fdb06 Reland "[rab/gsab] Update to the new spec"
- Remove ResizableArrayBuffer / GrowableSharedArrayBuffer constructors,
use options bags
- Add AB.prototype.resizable and SAB.prototype.growable
- Update receiver checks in (S?)AB.prototype methods

Previous try: https://chromium-review.googlesource.com/c/v8/v8/+/3021174

Bug: v8:11111
Change-Id: Ib4e98aa987826fd01bfdcf7688310ec0665f33ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3035770
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75803}
2021-07-20 08:02:29 +00:00
Marja Hölttä 00d556f026 Revert "[rab/gsab] Update to the new spec"
This reverts commit 6207d61ff8.

Reason for revert: Incorrect implementation of the flag-not-on case.

Original change's description:
> [rab/gsab] Update to the new spec
>
> - Remove ResizableArrayBuffer / GrowableSharedArrayBuffer constructors,
> use options bags
> - Add AB.prototype.resizable and SAB.prototype.growable
> - Update receiver checks in (S?)AB.prototype methods
>
> Bug: v8:11111
> Change-Id: I4f8cb71a4c8e07483a3ffad83d98129da162b839
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3021174
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75761}

Bug: v8:11111, chromium:1230129, chromium:1230408
No-Try: True
Tbr: mlippautz@chromium.org
Change-Id: I25aa10cb3dc20fdaeb45e6169fc01eec9a89f72c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3038061
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#75778}
2021-07-19 08:12:24 +00:00
Marja Hölttä 6207d61ff8 [rab/gsab] Update to the new spec
- Remove ResizableArrayBuffer / GrowableSharedArrayBuffer constructors,
use options bags
- Add AB.prototype.resizable and SAB.prototype.growable
- Update receiver checks in (S?)AB.prototype methods

Bug: v8:11111
Change-Id: I4f8cb71a4c8e07483a3ffad83d98129da162b839
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3021174
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75761}
2021-07-16 13:41:31 +00:00
Marja Hölttä 3160edf011 [rab/gsab] ResizableArrayBuffer / GrowableSharedArrayBuffer part 1
Detailed list of changes:
https://docs.google.com/document/d/15i4-SZDzFDW7FfclIYuZEhFn-q-KpobCBy23x9zZZLc/edit?usp=sharing

Bug: v8:11111
Change-Id: I931003bd4552cf91d57de95af04a427a9e6d6ac9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814259
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74459}
2021-05-10 08:29:41 +00:00