This changes all 3 of SM's uses of js/src/ds/SplayTree.h to use
js/src/ds/AvlTree.h. The new interface is almost identical to the old one, so
the changes are mostly trivial:
(0) js/src/jit/JitcodeMap.h: two comments referencing unknown "trees" have
been amended.
(1) js/src/ds/MemoryProtectionExceptionHandler.cpp: this uses a tree to record
memory ranges that are protected (?). The only change is of the type of the
tree.
(2) BacktrackingAllocator.h: a minor use, to record ranges containing calls
(`BacktrackingAllocator::callRanges`). Also just a change of type. It would
be possible to use the AVL trees to merge the partially-redundant fields
`::callRanges` and `::callRangesList`, but that is beyond the scope of this
patch.
(3) BacktrackingAllocator.h: the main use: changing `LiveRangeSet` to use an
AvlTree. This is also just a renaming of the type.
(3, more) struct `PrintLiveRange` has been removed. It was a workaround for
the fact that the splay trees had no iteration facility. Its use, in
BacktrackingAllocator::dumpAllocations, has been replaced by an AVL iterator.
(3, more) Note that this change causes the allocator to produce different
allocations. This is because the allocator depends on the actual tree layout,
specifically which node is closest to the root when more than one node matches
a query, and that's different for the two tree implementations.
This behaviour manifests in BacktrackingAllocator::tryAllocateRegister, where
register-use trees are queried:
if (!rAlias.allocations.contains(range, &existing)) {
continue;
}
This asks "does the tree contain a range that overlaps `range`?; if yes,
return it in `existing`". If more than one range in the tree overlaps `range`,
which one is written to `existing` is arbitrary. The code goes on to decide
whether it's OK to evict the bundle containing existing based (in part) on
`existing`s spill weight.
This could be seen as a bug in the logic in that if `existing` has a low spill
weight then it may choose to evict `existing`s bundle, even though some other
range -- that wasn't returned -- has a higher spill weight. Hence it could
incorrectly decide to evict a bundle that has a higher spill weight than the
bundle for which allocation is attempted.
The above analysis may be a misinterpretation of the logic. Multiple attempts
to "fix" it were made, without success. In any case the resulting
allocations are marginally better. See
https://bugzilla.mozilla.org/show_bug.cgi?id=1772282#c2
Differential Revision: https://phabricator.services.mozilla.com/D148247
This patch adds js/src/ds/AvlTree.h, which provides facilities similar to
js/src/ds/SplayTree.h, but with reduced lookup costs. The patch merely adds
the code and test cases but does not make any use of it.
To make it easy to change use points, the public interface is identical in
naming and semantics to that of SplayTree.h, to the extent it can be. See
comments on AvlTree::contains and AvlTree::maybeLookup. The memory allocation
strategy is also the same.
There are new facilities for iterating over a tree, either completely or from
an arbitrary start point.
AvlTree.h is structured so as to hide the implementation from users as much as
possible. Most of the file is an implementation class `AvlTreeImpl`, which
contains all the difficult stuff -- AVL insertion, deletion, rebalancing,
search and iteration. The end-user interface, plus documentation, is in a
small class `AvlTree` at the bottom of the file.
The patch also contains self-test code, testAvlTree.cpp. The public interface
class `AvlTree` is (intentionally) too restrictive for proper testing. So
this file defines its own testing interface class, `AvlTreeTestIF`. It then
uses that to test that insertion, deletion and iteration work correctly, and
that the tree remains balanced.
Differential Revision: https://phabricator.services.mozilla.com/D148246
The frame pointer is now pushed immediately after the return address, to help
native stack unwinders.
The main problem here was that `STUB_FRAME_SIZE` now has to be split in `StubFrameSize` and
`StubFrameSizeFromFP` because the latter now doesn't have to skip the stub pointer.
Differential Revision: https://phabricator.services.mozilla.com/D148779
We were generating:
```
stp x30, x29, [sp, #-16]!
mov x29, sp
```
The standard frame prologue has `x29` and `x30` reversed.
This also removes an unnecessary `moveStackPtrTo(FramePointer)`.
Differential Revision: https://phabricator.services.mozilla.com/D148780
Automatic update from web-platform-tests
[Sub Apps] Change add() to take list and add SubAppInstallCommand
Bug: 1313108, 1171317
Change-Id: Ib0e4d54982a30b5a4d2c7406f113bd7da8fb7abc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3582589
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Sam Thiesen <samicolon@google.com>
Cr-Commit-Position: refs/heads/main@{#1011466}
--
wpt-commits: 1df9d512650d18e9d07c04e529404cbe4ff136ff
wpt-pr: 33754
Automatic update from web-platform-tests
Convert COOP+COEP tests to dispatcher.js
popup-test.js cannot be directly adapted for COOP+COEP tests. To solve
the issue we pass in a list of headers instead of simply the COOP
headers. This requires some rewriting but allows to convert these tests
to popup-test.js as well.
This enables the removal of several common.js functions in a followup:
https://chromium-review.googlesource.com/c/chromium/src/+/3679738
Bug: 1318373
Change-Id: I2dcb56c0e0080f0d3446fe66ce36a38d88380034
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3679539
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011401}
--
wpt-commits: ccfc0c2e0a7268a57d09ea554ed2572f1fa53034
wpt-pr: 34264
Automatic update from web-platform-tests
Prerender: Notification API no longer cancels prerender
Previously, Notification API's behavior varied from the specification.
https://wicg.github.io/nav-speculation/prerendering.html#patch-notifications
This CL partially fixes this problem, by making notification API return
"default" during prerendering, and defer the corresponding Mojo
interface.
The remaining issue is that the Notification ctor is not deferred yet.
After this CL, the new workflow be like:
1. Web developers call Notification.permission => we return "default" in
the prerendering pages. [Without asking the browser process for the
permission status, as renderer can always return "default" in this case.
So no IPC would be made.
2. Finding Notification.permission returning "default", web pages have
to request permission before making notification.
3. They have to call Notification. requestPermission => this API is
deferred until prerender activation.
4. After prerendering activation, Notification.requestPermission
returns "real value" based on users' decisions. And then, developers
would call Notification() to display notifications.
Tests are updated as well.
Bug: 1280155
Change-Id: Ide70ac5d8a6bb017ba0bb8747a745fcb07145b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3672395
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011325}
--
wpt-commits: 7e9df8dcf9218d3ed856aec6fc154b463c7666d1
wpt-pr: 34230
Automatic update from web-platform-tests
HTML: assert ErrorEventInit defaults
This accounts for the change in https://github.com/whatwg/html/pull/7983 as well.
--
wpt-commits: c297f88500de105a82118d1a5527d52e63c7ba47
wpt-pr: 34297
Automatic update from web-platform-tests
[Region Capture] Stop exposing mediaDevices.produceCropId()
The functionality once exposed through mediaDevices.produceCropId(),
is now exposed through CropTarget.fromElement().
The logic still resides in MediaDevices, but that is now
an implementation detail that the web app cannot detect.
Bug: 1291140
Change-Id: I03b6967b8feb0d2289062923c16070cd42c5abca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3689672
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Commit-Queue: Elad Alon <eladalon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011218}
--
wpt-commits: 111eba429c4f141f4f63bcedf4c395e39c22b283
wpt-pr: 34314
Automatic update from web-platform-tests
[Clipboard API] Clipboard Web Custom Formats implementation.
This patch addresses the changes proposed by the EditingWG[1] and
agreed upon by all browser vendors. We are removing the `unsanitized`
option, and instead, adding custom format support for MIME types that
have "web " prefix in them.
Added few wpt tests to test these changes.
Below is a summary of the changes in this CL:
1. Removed `unsanitized` option from read/write methods.
2. If the custom format doesn't have a "web " prefix, then clipboard
read/write fails.
3. Transient user activation is applicable to all supported formats -
text/html, text/plain, image/png and web custom formats.
4. There are two "buckets" of clipboard formats. One for the
well-known formats and the other for the web custom format. If the
author doesn't specify the web format explicitly, then they don't
get access to it. This means, we won't write web custom formats
for well-known types implicitly if authors have not indicated that
during the write call via a "web " prefix (e.g. "web text/html").
Same applies for reading web custom formats for well-known types-
if there aren't any formats in the web custom format map, then we
won't return any web custom formats i.e. text/html won't be
automatically converted into "web text/html".
Spec: https://github.com/w3c/clipboard-apis/pull/175
Explainer: https://github.com/w3c/editing/blob/gh-pages/docs/clipboard-pickling/explainer.md
i2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/Lo7WBM_v_LY/m/LncCKkXeAwAJ
i2s: https://groups.google.com/a/chromium.org/g/blink-dev/c/k2rgX-4Cigc/m/P0RijrpzBAAJ?utm_medium=email&utm_source=footer&pli=1
1. Github issue: https://github.com/w3c/clipboard-apis/issues/165
Bug: 106449
Change-Id: I86aae6a662089efeede2a01ac87cb698e9646df5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650952
Commit-Queue: Anupam Snigdha <snianu@microsoft.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011078}
--
wpt-commits: b8ebea7f172334f5a5d9ac87860aec5f55becd26
wpt-pr: 34117
Automatic update from web-platform-tests
Fix wpt/html/.../window-domain-failure.https.sub.html
self.SharedArrayBuffer is defined if and only if the environment is
crossOriginIsolated. Fix the WPT accordingly.
Bug: 1088220
Change-Id: If5ca273a9e513087b8fb192a18237d36ce54f2c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3689131
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011058}
--
wpt-commits: 2d6272bb86fc2c9692cc31a62b93e1e620ddc624
wpt-pr: 34317
Automatic update from web-platform-tests
Revert "Revamp object-not-found redirect resource timing tests" (#34301)
This reverts commit f1fda133e0491f023d674167e36e04bd1da4061b.
Reason for revert: likely caused linux-bfcache-rel CI failures.
Example failure:
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/33293/overview
Original change's description:
> Revamp object-not-found redirect resource timing tests
>
> I suspect that the object resource timing tests are flakily timing out
> due to flakiness in <object>'s events themselves.
>
> This CL moves these tests to the more recent resource timing testing
> infrastructure, and also ends the test once a PerformanceObserver runs
> its callback.
>
> Bug: 1318592
> Change-Id: I2b01188756b212b51b8c8d095a2257d4a0e54e91
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3682424
> Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
> Reviewed-by: Ian Clelland <iclelland@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1010553}
Bug: 1332556, 1318592
Change-Id: I99dc11ffa01158bcd2c0e1814ff5df4c3a158d7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688576
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Igor Ruvinov <igorruvinov@chromium.org>
Commit-Queue: Igor Ruvinov <igorruvinov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010593}
Co-authored-by: Igor Ruvinov <igorruvinov@chromium.org>
--
wpt-commits: 4229253c55247610c2e7a68f9456ccb4bf51abc2
wpt-pr: 34301
Automatic update from web-platform-tests
[mathml] Wrap <mtd> children in an anonymous <mrow>
This CL wraps the children of an <mtd> cell within an anonymous <mrow>.
That way, such children are laid out as if they were in an explicit
<mrow>, in particular avoiding line breaks, performing operator
stretching and adding proper operator spacing [1]. In particular, this
fixes the second use case demonstrated at BlinkOn 16 [2].
[1] https://w3c.github.io/mathml-core/#layout-of-mrow
[2] https://people.igalia.com/fwang/2022-blinkon-16-remainder-estimate-for-mathml-integration/?showNotes=true#/19
Bug: 6606, 1125111, 1237043
Change-Id: Icd330b523df4548bf7065eed986bd3698514f50b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3657309
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1010954}
--
wpt-commits: 47f4e9d2b69bd4c6335e42fef123898d9e28fab4
wpt-pr: 34144
Automatic update from web-platform-tests
[Region Capture] Expand produceCropId() to receive any Element
As per the new spec, produceCropId() now receives any type
of Element. It raises an error if the type is not yet
verified as supported. At the moment, only divs and
iframes are supported, but this will be extended.
Note: The spec actually speaks of CropTarget.fromElement().
That transition will be done in upcoming CLs.
Bug: 1332641
Change-Id: I53e880c5afc2d4bfa6ac520ed054b1f60373c392
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3689554
Reviewed-by: Simon Hangl <simonha@google.com>
Commit-Queue: Elad Alon <eladalon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010890}
--
wpt-commits: e9d70537218bd480a4e9815e03b4994821e99fd7
wpt-pr: 34310