Timothy Flynn
6b4b7a54de
LibJS: Revert ArrayIterator and RegExpStringIterator to manual iterators
...
This is a normative change in the ECMA-262 spec. See:
de62e8d
This did not actually seem to affect our implementation as we were not
using generators here to begin with. So this patch is basically just
adding spec comments.
2025-04-30 07:29:34 -04:00
Sam Atkins
107d0cafcf
Tests: Disable flaky APNG test
...
This frequently flakes on CI.
2025-04-30 11:34:19 +01:00
Gingeh
004d1305c8
LibWeb: Don't accidentally create a layout node for display: none
2025-04-30 11:26:18 +01:00
Andreas Kling
7a600e60bc
LibJS: Mark catch
parameter as initialized local when applicable
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Otherwise we'll emit a TDZ check for every `catch` parameter immediately
after initializing it. This check would never fail, so it's redundant.
2025-04-30 09:38:40 +02:00
Andreas Kling
00f7a6f9e0
LibJS: Remove unused bytecode VM register reservation
...
We were not actually using the "saved exception" register for anything,
but we were clearing it on every function entry.
2025-04-30 09:38:40 +02:00
Andrew Kaster
e5465ff8e5
LibWeb: Crash less when the main thread exits while trying to render
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Attach a 'job' to the main thread event loop, trusting that the event
loop implementation will cancel it when asked to quit. This is something
that our Unix implementation does, but isn't strictly part of the
contract of EventLoopImplementation.
2025-04-29 09:51:22 -06:00
Andrew Kaster
27db7ed11f
LibIPC: Guard better against closure in the TransportSocket send thread
...
And crash less when the socket is closed while there are still messages
in the queue.
2025-04-29 09:51:22 -06:00
rmg-x
d64e6abe08
CI+Toolchain: Remove unnecessary BuildVcpkg.sh
...
This script was rewritten in Python in commit:
c92d9cce42
Since it just executes the Python anyway, remove it and do that in CI
ourselves.
2025-04-29 16:34:24 +01:00
stelar7
dde80a434c
LibWeb/IDB: Disable test that now hits a timeout
2025-04-29 17:06:17 +02:00
stelar7
81d7f27c73
LibWeb/IDB: Fix record checking using the wrong key comparison
2025-04-29 17:06:17 +02:00
stelar7
c81c17c0fb
LibWeb/IDB: Implement IDBObjectStore::get
2025-04-29 17:06:17 +02:00
stelar7
18a008d073
LibWeb/IDB: Implement retrieve_a_value_from_an_object_store
2025-04-29 17:06:17 +02:00
stelar7
d5cf2cee41
LibWeb/IDB: Implement IDBObjectStore::count
2025-04-29 17:06:17 +02:00
stelar7
694375d3ac
LibWeb/IDB: Implement count_the_records_in_a_range
2025-04-29 17:06:17 +02:00
stelar7
64d251b36c
LibWeb/IDB: Implement convert_a_value_to_a_key_range
2025-04-29 17:06:17 +02:00
Andreas Kling
1f0c67cc12
Revert "LibJS: Add StackFrame to avoid indirection in VM register access"
...
This reverts commit 36bb2824a6
.
Although this was faster on my M3 MacBook Pro, other Apple machines
disagree, including our benchmark runner. So let's revert it.
2025-04-29 16:08:42 +02:00
Jelle Raaijmakers
6176b05ca5
LibWeb: Align editing whitespace canonicalization with other browsers
...
The spec calls for a couple of very specific whitespace padding
techniques whenever we canonicalize whitespace during the execution of
editing commands, but it seems that other browsers have a simpler
strategy - let's adopt theirs!
2025-04-29 15:30:34 +02:00
Andreas Kling
36bb2824a6
LibJS: Add StackFrame to avoid indirection in VM register access
...
This is a simple trick to generate better native code for access to
registers, locals, and constants. Before this change, each access had
to first dereference the member pointer in Interpreter, and then get to
the values. Now we always have a pointer directly to the values on hand.
Here's how it looks:
class StackFrame {
public:
Value get(Operand) const;
void set(Operand, Value);
private:
Value m_values[];
};
And we just place one of these as a window on top of the execution
context's array of values (registers, locals, and constants).
2025-04-29 14:23:03 +02:00
Jelle Raaijmakers
35efd4d14b
LibWeb+LibGfx: Support alpha
in CanvasRenderingContext2D
...
This is implemented by these related changes:
* The Skia alpha type 'Opaque' is selected for surfaces that were
created with the intention of not having an alpha channel.
Previously we were simply creating one with alpha.
* Clearing now happens through Skia's `clear()` which always uses the
source color's value for the result, instead of setting all values
to 0.
* CanvasRenderingContext2D selects a different clearing color based on
the `alpha` context attribute's value.
2025-04-29 13:51:23 +02:00
Jelle Raaijmakers
fac0f82031
LibWeb: Add CanvasRenderingContext2D context attribute parsing
...
Makes `context.getContextAttributes()` work.
2025-04-29 13:51:23 +02:00
Timothy Flynn
4d70f6ce1c
LibJS: Ensure iterator parameter validation closes underlying iterator
...
This is a normative change in the ECMA-262 spec. See:
9552f29
f2bad00
2025-04-29 07:33:08 -04:00
Timothy Flynn
908349f8fe
LibJS: Add a TRY_OR_CLOSE_ITERATOR macro for IfAbruptCloseIterator
...
Behaves just like TRY_OR_REJECT for promises.
2025-04-29 07:33:08 -04:00
Timothy Flynn
568524f8ba
LibJS: Close sync iterator when async wrapper yields rejection
...
This is a normative change in the ECMA-262 spec. See:
ff129b1
2025-04-29 07:33:08 -04:00
Timothy Flynn
15faaeb2bb
LibJS: Remove [[VarNames]] from GlobalEnvironment
...
This is a normative change in the ECMA-262 spec. See:
ed75310
2025-04-29 07:33:08 -04:00
Timothy Flynn
9c85a16aeb
LibJS: Standardize spec prose for Math.sumPrecise
2025-04-29 07:33:08 -04:00
Timothy Flynn
9674210ef8
LibJS: Update spec steps / links for the Float16Array proposal
...
This proposal has reached stage 4 and been merged into the main ECMA-262
spec. See:
d430ace
2025-04-29 07:33:08 -04:00
Timothy Flynn
adf6024805
LibJS: Update spec steps / links for the RegExp.escape proposal
...
This proposal has reached stage 4 and been merged into the main ECMA-262
spec. See:
e2da759
2025-04-29 07:33:08 -04:00
Timothy Flynn
2401764697
LibJS: Update spec steps / links for the JSON modules proposal
...
This proposal has reached stage 4 and been merged into the main ECMA-262
spec. See:
3feb1ba
2025-04-29 07:33:08 -04:00
Timothy Flynn
3867a192a1
LibJS: Update spec steps / links for the import-assertions proposal
...
This proposal has reached stage 4 and been merged into the main ECMA-262
spec. See:
4e3450e
2025-04-29 07:33:08 -04:00
Tim Ledbetter
c1a3b95176
LibWeb: Set transition property name when firing transition events
2025-04-29 12:23:31 +02:00
Gingeh
aa9f556500
LibWeb: Light dismiss dialogs on click
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-28 19:41:38 -06:00
Gingeh
1f1884da54
LibWeb: Light dismiss popovers on click
2025-04-28 19:41:38 -06:00
Andreas Kling
6061da3382
LibJS: Overload Instruction::length() on variable-length instructions
...
This allows the DISPATCH_NEXT() macro to do the math to find the next
instruction boundary point without performing a function call.
2025-04-29 02:09:35 +02:00
Andreas Kling
a2b7e04da3
LibJS: Defer looking up the realm in ordinary_call_evaluate_body()
...
We don't actually need the realm for normal function calls, so we
can avoid looking it up on the EC stack in that case.
2025-04-29 02:09:35 +02:00
Andreas Kling
0f1be720bb
LibJS: Mark exception path [[unlikely]] in ordinary_call_evaluate_body()
2025-04-29 02:09:35 +02:00
Andreas Kling
58925887ce
LibJS: Inline VM::bytecode_interpreter()
2025-04-29 02:09:35 +02:00
Andreas Kling
35275651e3
LibJS: Skip stack overflow check in ESFO::prepare_for_ordinary_call()
...
We already do a stack overflow check when entering run_bytecode(),
which is the first thing that happens when we actually invoke the ESFO
executable.
2025-04-29 02:09:35 +02:00
Andreas Kling
95ba74d934
LibJS: Remove redundant VERIFY in run_executable()
...
Getting the running_execution_context() already verifies that the
execution context stack is non-empty, we don't need to do it separately
here as well.
2025-04-29 02:09:35 +02:00
Andreas Kling
6de1a0aeaf
LibJS: Don't cache a pointer to accumulator register in run_bytecode()
...
The old accumulator register is really only used to pass the end
completion to the caller of run_bytecode() nowadays. As such, we don't
need to cache a pointer to it for fast access. One less thing to do
on run_bytecode() entry.
2025-04-29 02:09:35 +02:00
Andreas Kling
942ce2162d
LibJS: Mark stack overflow path in run_bytecode() [[unlikely]]
2025-04-29 02:09:35 +02:00
Hikmat Jafarli
bd9d489370
LibWeb: Re-evaluate the style block when the type attribute changes
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-29 01:01:02 +02:00
Andreas Kling
4d17707b26
LibJS: Store bytecode VM program counter in ExecutionContext
...
This way it's always automatically correct, and we don't have to
manually flush it in push_execution_context().
~7% speedup on the MicroBench/call* tests :^)
2025-04-28 21:12:48 +02:00
Tim Ledbetter
e7ae9c8ebf
LibWeb: Parse all
as keyword in transition
shorthand
...
This ensures that the parsing of the `transition` shorthand property
behaves in the same way as the `transition-property` longhand.4
2025-04-28 20:51:36 +02:00
teaalltr
a3e485e2d0
LibWeb: Add fast_is for span and div
2025-04-28 19:46:05 +01:00
Shannon Booth
23f3ecbe98
AK: Don't iterate through entire String for String::ends_with
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-28 10:50:31 -04:00
Andreas Kling
233097c250
LibJS: Inline part of VM::run_queued_promise_jobs()
...
Most of the time there are no queued promise jobs to run after exiting
a stack frame. By moving the check inline, leaving a function call gets
a measurable speedup in the common case.
2025-04-28 10:39:42 -04:00
Andreas Kling
b4554c01db
LibJS: Mark ESFO path for [[Call]] on a class constructor [[unlikely]]
...
This is an exception path that's not supposed to be called normally,
so let's mark it unlikely.
2025-04-28 10:39:42 -04:00
Andreas Kling
6ec4d0f5ba
LibJS: Mark stack overflow exception code path as [[unlikely]]
...
This is supposed to be exceedingly rare, so a great candidate for
[[unlikely]] annotation.
2025-04-28 10:39:42 -04:00
Andreas Kling
580b892b9e
AK: Demote VERIFY in NonnullRefPtr to ASSERT
...
NonnullRefPtr almost always has a non-null pointer internally, that's
what the class is for, after all! The one edge case where it has null
internally is after you move() it. But it's always a bug to use an
NNRP after moving from it, and we have clang-tidy yelling at us if
that ever happens.
Demoting this removes a gazillion overly paranoid null checks.
2025-04-28 10:39:42 -04:00
Andreas Kling
074ca5d5b4
LibJS: Make ESFO::ordinary_call_evaluate_body() return TCO<Value>
...
This matches what the caller wants to return and allows us to simplify
a bunch of logic around returning a value or throwing.
2025-04-28 12:44:49 +02:00