This gives us free devirtualization of some hot calls inside the
bytecode interpreter. Most notably the did_trap() checks.
Modest performance improvement on the https://figma.com/ landing page.
(cherry picked from commit 2f3128333dcd5a781f35272800631d6cf03803ad)
This brings back the old behaviour of Value::to<short>() (and other
similar calls), which WASI depends on.
To make sure all similar issues are caught in the future, this commit
also introduces an static assertion in Value::to().
(cherry picked from commit 0d05ab2ad0cc56cc6fe9ee647dfcfda44a92b4f2)
These have no declared constructor, so apple clang and clang clang seem
to disagree on some versions.
(cherry picked from commit d2ff92077b2a4ead0a1ef65e7131702e1152cbeb)
Gets fib(30) from 380ms to 340ms.
(cherry picked from commit a58704296cd36d3080dbf8f1be49300de2c25ea9;
amended to comment out two dbgln_if()s that no longer compile after
this change if WASM_TRACE_DEBUG is defined to 1 -- see comments on
LadybirdBrowser/ladybird#960. Likewise, one dbgln_if() in Wasi.cpp
got commented out as well)
Theoretically, the previous "pop, then push" method should be faster,
but it's actually faster to just remove from the stack directly.
(cherry picked from commit a2448308fd90ba0aafd42587a091c0da3c037ba9)
Instead of one stack to hold frames, labels, and values, there is now
three separate stacks. This speeds up fib(30) from 580ms to 480ms.
(cherry picked from commit a3b077c6415e0f4038b8c8da1e1e9c9cc2df5f0a)
When the cached value was not an accessor, it was simply ignored.
This is the value we really want, so we can just return it.
Shows up to 5x improvements on some benchmarks,
and 1.4x in general js-benchmarks.
(cherry picked from commit 77a46ab1b8d13f35b11a7bd08459752912dca1bf)
Async functions whose promise is never resolved were leaking, since they
had a strong root JS::Handle on themselves.
This doesn't appear to actually be necessary, since the wrapper will be
kept alive as long as it's reachable (and if it's not reachable, nobody
is going to resolve/reject the promise either).
This fixes the vast majority of leaks on Speedometer, bringing memory
usage at the end of a full run from ~12 GiB to ~3 GiB.
(cherry picked from commit b6a5b7e18626ce0dee11a25bb0d51d2e84d3c057)
This fixes an issue where a badly-timed garbage collection could swallow
a static field initializer.
Caught by running test262 in GC-on-every-allocation mode.
(cherry picked from commit 10724a7cb346e57b0b97e4bd54c13c5c604dbf9c)
We were miscalculating the length of the buffer in pointer-sized chunks,
which is what the conservative root scan cares about.
This could cause some values to be prematurely garbage-collected.
(cherry picked from commit 2fb3b6c542db3a86cbd1aa7e34d470e34c485372)
This should fix (at least) the last two remaining WPT test failures in
FileAPI/unicode.html.
(cherry picked from commit 55f0dc823ff266aeb29fd6f7d47d5e7f89a50ee6)
This was previously negated due to a misread of
https://url.spec.whatwg.org/#concept-url-equals. This change fixes a
bunch of WPT crashes such as
"/html/browsers/history/the-history-interface/001".
(cherry picked from commit f1cab5de7a071fe76eae10d36603f6cf34fa989e)
The 'x' unit is the same as 'dppx', but was previously not considered
when parsing resolutions.
(cherry picked from commit 7ed08a401f5d3242d8c0354467e0af827bb6b0ce)
The main culprit for the following WPT test failure is that we
weren't using the HTML namespace for XHTML docs unless one was
explicitly provided.
(cherry picked from commit 6a5bca1302161a84d95313bef1481d9a8a56702c)
The IPCs to request a page's text, layout tree, etc. are currently all
synchronous. This can result in a deadlock when WebContent also makes
a synchronous IPC call, as both ends will be waiting on each other.
This replaces the page info IPCs with a single, asynchronous IPC. This
new IPC is promise-based, much like our screenshot IPC.
(cherry picked from commit 3332230cef8091f94f5c30e1f1984c1038cd4a1d)
This was added in 9d03ea6f74 for LibWeb/DumpLayoutTree/main.cpp.
That utility was moved to LibViewView in #14018 and then deleted
in #18879 after #17836 moved that functionality to headless-browser.
No behavior change.
This change ensures that the value sanitization algorithm is run and
the text cursor is set to the correct position when the type attribute
of an input is changed.
(cherry picked from commit 1b74104c17726018788034f2ad66201889ce6225)
Previously, the value sanitization algorithm would not trim whitespace
for inputs of type URL or email, if they didn't also contain any
newlines.
(cherry picked from commit c4b82318f41ecc0a3e24fe5c8ca0a3f02816c3b1)
The `[[GetOwnProperty]]` internal method invocation in
`OrdinarySetWithOwnDescriptor` was being invocated again with the same
parameters in the `[[DefineOwnProperty]]` internal method that is also
later called in `OrdinarySetWithOwnDescriptor`.
The `PlatformObject.[[DefineOwnProperty]]` has similair logic.
This change adds an optional parameter to the `[[DefineOwnProperty]]`
internal method so the results of the previous `[[GetOwnProperty]]`
internal method invocation can be re-used.
(cherry picked from commit 69f96122b6150c22d1e8dc848c097cead2d2ae3f)
This corresponds to this spec change:
https://github.com/whatwg/html/pull/10705
(We don't implement showPopover() yet.)
(cherry picked from commit 00e613c7df7ac26ba28e11d172207c045d35a542)
The DOM spec gets overridden by both the SVG2 and MathML core specs in
that unknown elements should not inherit DOM::Element, but
SVG::SVGElement and MathML::MathMLElement respectively.
(cherry picked from commit 76e638b4ca10a91983877d6f6e7f037c1a720965)