This opens up the code path for the `ArrayBuffer` type, which can now be
used as a method argument.
(cherry picked from commit 0b9d55b6761b85b3b80a459d6231841e72a26c51)
Prior to funcref, a partial chunk of an invalid module was never needed,
but funcref allows a partially instantiated module to modify imported
tables with references to its own functions, which means we need to keep
the second module alive while that function reference is present within
the imported table.
This was tested by the spectests, but very rarely caught as our GC does
not behave particularly predictably, making it so the offending module
remains in memory just long enough to let the tests pass.
This commit makes it so all function references keep their respective
modules alive.
(cherry picked from commit a60ecea16abe62aae988ba877fdb98466d2919d3)
This would previously crash because it depended on a specific order for
evaluating function arguments, which is undefined.
(cherry picked from commit 27b1d94e04386fd46c2c9148b9555c841595e2d3)
We were generating click events always using the primary mouse button
instead of the provided button, and with the buttons field set to that
provided button.
(cherry picked from commit dd5a0361f2307b280a910d219fbc2dfd0072409f)
This allows you to select text at the end of fragments, just like in
non-inline elements.
(cherry picked from commit 813612096c6135357c9a0e079db67e52900ebd5f)
When performing a hit test of type TextCursor, it would check if the
position is around each fragment and not just inside it. This resulted
in always selecting the first fragment checked.
This commit computes the distance of each hit test result, and picks the
closest one.
(cherry picked from commit 8c465c95aa7acde2355b0ce0762987724f5f6811)
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)