Commit Graph

14 Commits

Author SHA1 Message Date
Andreas Kling
2ca7dfa649 LibJS: Move bytecode interpreter state to VM
The bytecode interpreter only needed the running execution context,
but still threaded a separate Interpreter object through both the C++
and asm entry points. Move that state and the bytecode execution
helpers onto VM instead, and teach the asm generator and slow paths to
use VM directly.
2026-04-13 18:29:43 +02:00
Ivan Krasilnikov
b2db3574c5 test262-runner: Support multi-line YAML flags
The metadata parser only handled inline flags (e.g. `flags: [noStrict]`)
but not the YAML block list format:

  flags:
    - noStrict

This caused ~130 test/staging/sm test262 tests failures from running
them in both strict and sloppy modes by test262-runner.
2026-03-29 13:21:17 +02:00
Andreas Kling
71713017c5 test262-runner: Remove parse-only fast path for negative tests
The Rust parse_program() does not validate regex patterns or catch
all early errors during the parse phase alone -- those are caught
during compilation. The old C++ Parser did catch them during parsing.

Remove the fast parse-only path for negative tests so they go through
the full VM + compilation path, which correctly surfaces all errors.

The parse-only mode (--parse-only flag) is kept for explicit use.
2026-03-19 21:55:10 -05:00
Andreas Kling
169452f41b LibJS: Remove C++ parser
Delete Parser.cpp/h and ScopeCollector.cpp/h, now that all parsing
goes through the Rust pipeline.

Port test262-runner to use RustIntegration::parse_program() for its
fast parse-only check instead of the C++ Parser.

Add parsed_program_has_errors() and free_parsed_program() to the
RustIntegration public API for parse-only use cases.
2026-03-19 21:55:10 -05:00
Timothy Flynn
7e4cfcfc71 test262-runner: Log the amount of time taken per-test
Finding this useful for finding long-running individual tests. This will
be shown automatically when libjs-test262/main.py is run with the -v.
2026-03-06 14:34:58 +01:00
Timothy Flynn
ac54cbbecf test262-runner: Extract run_test invocation to a lambda
This block of code is nearly identical between the two invocations. This
extracts them to a lambda so a subsequent update can be made just once.
2026-03-06 14:34:58 +01:00
Shannon Booth
1811679ceb test262-runner: Make more use of Value::as_if 2026-02-28 10:24:37 -05:00
Undefine
3c8546fbf2 test262-runner: Use the correct assertion failed signature on FreeBSD 2026-01-12 20:58:21 +01:00
Undefine
f6a2e84c33 test262-runner: Disable core dumps in a more cross platform way
Setting the maximum core dump file size to 0 disable the creation
of those and also fixes a compile bug on FreeBSD.
2026-01-12 20:58:21 +01:00
Andreas Kling
0dacc94edd LibJS: Have JS::Lexer take a JS::SourceCode as input
This moves the responsibility of setting up a SourceCode object to the
users of JS::Lexer.

This means Lexer and Parser are free to use string views into the
SourceCode internally while working.

It also means Lexer no longer has to think about anything other than
UTF-16 (or ASCII) inputs. So the unit test for parsing various invalid
UTF-8 sequences is deleted here.
2025-11-09 12:14:03 +01:00
Undefine
17d3b881d3 AK+Everywhere: Remove ifdefs for WASM and Emscripten
Building the Ladybird code for Emscripten doesn't really make sense
and I doubt it is even possible with all the dependencies now.
2025-11-07 11:27:51 +01:00
ayeteadoe
6dbb59da77 LibJS: Export symbols causing linker errors in various consumers
After LibJS had its symbol exports optimized the targets
js, test-js, test262-runner, test-wasm, and LibWeb began to get linker
errors after the work to add Windows support for test-web and ladybird
targets. These extra JS_API annotations fix all those linker errors.
2025-08-23 16:04:36 -06:00
Timothy Flynn
0efa98a57a LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16
This has quite a lot of fall out. But the majority of it is just type or
UDL substitution, where the changes just fall through to other function
calls.

By changing property key storage to UTF-16, the main affected areas are:
* NativeFunction names must now be UTF-16
* Bytecode identifiers must now be UTF-16
* Module/binding names must now be UTF-16
2025-08-05 07:07:15 -04:00
Andrew Kaster
94a20f6706 Tests+Utilities: Move test262-runner to Utilities
This is a utility more than it is a test in itself. We use it to run
test262 tests, which are external to this repo. The test-js runner is
still private test infrastructure though, so it stays where it is.
2025-05-19 18:37:15 -04:00