Commit graph

51659 commits

Author SHA1 Message Date
Daniel Bertalan 9d4dfc1061 AK: Work around Apple Clang __builtin_subc codegen issue
Apple Clang 14.0.3 (Xcode 14.3) miscompiles this builtin on AArch64,
causing the borrow flag to be set incorrectly. I have added a detailed
writeup on Qemu's issue tracker, where the same issue led to a hang when
emulating x86:

https://gitlab.com/qemu-project/qemu/-/issues/1659#note_1408275831

I don't know of any specific issue caused by this on Lagom, but better
safe than sorry.
2023-06-24 18:31:14 +02:00
Daniel Bertalan 7dadc9ff33 AK: Prefer __builtin_{subc,addc} intrinsics to x86-specific ones
GCC 14 (https://gcc.gnu.org/g:2b4e0415ad664cdb3ce87d1f7eee5ca26911a05b)
has added support for the previously Clang-specific add/subtract with
borrow builtins. Let's use `__has_builtin` to detect them instead of
assuming that only Clang has them. We should prefer these to the
x86-specific ones as architecture-independent middle-end optimizations
might deal with them better.

As an added bonus, this significantly improves codegen on AArch64
compared to the fallback implementation that uses
`__builtin_{add,sub}_overflow`.

For now, the code path with the x86-specific intrinsics stays so as to
avoid regressing the performance of builds with GCC 12 and 13.
2023-06-24 18:31:14 +02:00
kleines Filmröllchen e7b7d1b347 Base: Add a new quote to the fortunes database 2023-06-24 19:13:42 +03:30
Andreas Kling 06ac768c8b LibJS/Bytecode: Add some basic codegen for ExportStatement
This is by no means complete, but at least a bunch of test-js and
test262 tests start working. :^)
2023-06-24 17:13:30 +02:00
Andreas Kling 5d79431859 LibJS/Bytecode: Actually generate & run bytecode for SourceTextModule 2023-06-24 17:13:30 +02:00
Andreas Kling 8a5e71256d LibJS/Bytecode: Add codegen for ImportCall
Also moved most of the AST ImportCall::execute() into a helper so we can
share the code.
2023-06-24 17:13:30 +02:00
Andreas Kling eb9298b54e LibJS/Bytecode: Support destructuring function parameters
To reduce code duplication, I've added new VM::execute_ast_node()
helper that handles bytecode compilation if needed.

918 new passes on test262. :^)
2023-06-24 08:38:54 +02:00
Andreas Kling b3a3c53007 LibJS: Fix bad indentation when dumping FunctionNode AST nodes 2023-06-24 08:38:54 +02:00
Zaggy1024 c760713650 LibWeb: Prioritize video duration when loading video element media
Previously, an audio loader could succeed for an HTMLVideoElement that
contains a video file, which caused the duration to be set to the bogus
duration of the audio loader instead of the correct duration from the
video container. Instead of setting the duration based on audio always,
set it to the video duration if we are creating a video element.
2023-06-24 06:20:06 +02:00
Xexxa e3a0f84ffb Browser: Change "Same Origin" to "Same-Origin" 2023-06-24 06:19:39 +02:00
Xexxa 84e7dd60ea Ladybird: Add missing shortcuts
Add the missing shortcuts from Ladybird SerenityOS to Ladybird QT
2023-06-24 06:19:39 +02:00
Luke Wilde 95d619943e LibJS/Bytecode: Support private identifiers in optional chaining
Fixes 4 test262 tests :^)
2023-06-23 21:05:18 +02:00
Andi Gallo fc45831fb3 LibWeb/Tests: Better trigger for table style update test 2023-06-23 20:23:00 +02:00
Timothy Flynn 8b668da9d5 LibRegex: Bail parsing class set characters upon early EOF
Otherwise, we reach a skip() invocation at the end of this function,
which crashes due to EOF. Caught by test262.
2023-06-23 20:22:45 +02:00
Timothy Flynn 32502fceed LibJS: Update spec numbers/steps for RegExp unicode sets flag proposal
This proposal has been merged into the main ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/26b2369
2023-06-23 20:22:45 +02:00
Timothy Flynn 9407e05a3c LibJS: Update RegExp spec numbers to match re-ordering within the spec
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/abee2e6
https://github.com/tc39/ecma262/commit/77256bf
2023-06-23 20:22:45 +02:00
Andreas Kling 99b23fe2ad LibJS/Bytecode: Emit GetPrivateById for private member expressions
This makes it possible to call private member functions.

347 new passes on test262. :^)
2023-06-23 17:51:04 +02:00
Timothy Flynn e7db199249 LibJS: Do not fail a test if the flags list is empty
There are hundreds of test262 tests with the following metadata line:

    flags: []

Other engine runners are apparently able to ignore those lines, so we
should as well.
2023-06-23 17:31:48 +02:00
René Hickersberger b0ef956fe0 Ports: Add lynx port 2023-06-23 17:25:37 +02:00
Aliaksandr Kalenik 934cb601c2 LibWeb: Implement "destroy the child navigable" on navigable containers
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-06-23 17:24:32 +02:00
Andi Gallo 55f1a70577 LibWeb: Fix style updates for table box nodes
On style update, we have to preserve the invariant established when we
built the layout tree - some properties are applied to the table wrapper
and the table box values are reset to their initial values.

This also ensures that the containing block of a table box is always a
table wrapper, which isn't the case if we set absolute position on the
box instead of the wrapper.

Fixes #19452.
2023-06-23 16:40:19 +02:00
Andi Gallo e28578363a LibWeb: Get initial values for table box from CSS::InitialValues 2023-06-23 16:40:19 +02:00
Andreas Kling 406e3ed849 LibWeb: Implement getting the container document of a navigable
Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-06-23 16:20:29 +02:00
Aliaksandr Kalenik d85bdd3ac5 LibWeb: Add API for finding NavigableContainer by content navigable
This is only needed because currently spec doesn't explicitly define
that navigable should have a pointer to associated container and when
this pointer should be set.
2023-06-23 16:20:29 +02:00
Andreas Kling 85a3a1c085 LibJS/Bytecode: Add codegen for "named evaluation if anonymous function"
This gives anonymous functions the name from the LHS they are being
assigned to.

171 new passes on test262. :^)
2023-06-23 16:09:33 +02:00
Shannon Booth a92d94f4e9 LibWeb/Tests: Add basic test for ByteLengthQueuingStrategy 2023-06-23 13:27:29 +02:00
Shannon Booth a975fca42e LibWeb: Implement size attribute of ByteLengthQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth b2a51e86e5 LibWeb/Tests: Add basic test for CountQueuingStrategy 2023-06-23 13:27:29 +02:00
Shannon Booth 49689e5d8e LibWeb: Implement size attribute of CountQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth 6d93692bc5 LibWeb: Add IDL definition for 'Function'
This is used in ByteLengthQueuingStrategy and CountQueuingStrategy
in the Streams spec.
2023-06-23 13:27:29 +02:00
Shannon Booth 4f217947b3 LibWeb: Implement QueuingStrategy for Web::Streams::ReadableStream 2023-06-23 13:27:29 +02:00
Andreas Kling e5c7d8407b LibJS/Bytecode: Support private class fields
This is accomplished with two new instructions:
- GetPrivateById
- PutPrivateById

Looks like 1616 new passes on test262. :^)
2023-06-23 08:53:10 +02:00
Andreas Kling 467ea86179 LibJS: Use bytecode for generator function default parameters
Otherwise there's a mismatch between which interpreter we use.
This fixes a regression in the AST interpreter score on test262.
2023-06-23 08:09:50 +02:00
Tim Ledbetter 702054dcbc wc: Add -L option to show the length of the longest line
If more than one file is specified on the command line and the `-L`
option is used, the totals field will show the longest line
encountered; it is not a sum like the other values.
2023-06-23 06:24:33 +02:00
Andi Gallo 8e52d1125d LibWeb: Take specified height into account for automatic table height
Track table grid height stretched to the specified height and use it to
set the final box height in TFC.

Fixes #19563.
2023-06-23 06:24:08 +02:00
Aliaksandr Kalenik 04a5196a5d LibWeb: Add fast_is<T>() for SVGUseElement
is<SVGUseElement> quite hot in profiles
2023-06-23 06:23:42 +02:00
kleines Filmröllchen 80a228383b AK: Simplify MaybeOwned constructor
The previous version had a sequence of calls that are likely not
optimized out, while this version is strictly a sequence of static type
conversion which are always fully optimized out.
2023-06-23 01:34:27 +02:00
kleines Filmröllchen 7a6b1f179b AK: Explicitly make MaybeOwned noncopyable
Copying an owning MaybeOwned is forbidden.
2023-06-23 01:34:27 +02:00
Tim Ledbetter 75c61172e3 Base: Add man page for dirname(1) 2023-06-22 17:26:51 -04:00
Tim Ledbetter e259c3b38a dirname: Add support for multiple paths 2023-06-22 17:26:51 -04:00
Tim Ledbetter 828caf12a6 dirname: Add -z option for null terminated output 2023-06-22 17:26:51 -04:00
Tim Ledbetter c1c35f4f59 mkdir: Add -v option to print a message for each created directory 2023-06-22 22:35:30 +02:00
Tim Ledbetter 925ea4e854 mkdir: Replace LibC function calls with LibCore equivalents 2023-06-22 22:35:30 +02:00
Jelle Raaijmakers f619b61b00 Lagom: Link aconv with LibFileSystem 2023-06-22 22:27:03 +02:00
Jelle Raaijmakers 56da2c5db6 aconv: Remove usage of ancient Core::DeprecatedFile
That'll teach me for merging without waiting for CI :^)
2023-06-22 21:53:00 +02:00
kleines Filmröllchen 0d65e5f518 Meta: Add aconv as a Lagom tool 2023-06-22 21:45:54 +02:00
kleines Filmröllchen 57b3858fbc Utilities: Add aconv for converting between audio formats
The intention for this utility is to eventually become a general-purpose
multimedia conversion tool like ffmpeg (except probably not with as many
supported formats, stream mappings and filters). For now, we can not
write any video format so the added complexity is not necessary at the
moment.
2023-06-22 21:45:54 +02:00
kleines Filmröllchen de17cd018e LibAudio: Add accessor to "real" PCM sample format of loader 2023-06-22 21:45:54 +02:00
kleines Filmröllchen cd2e890304 LibAudio: Handle all integer PCM sample formats "correctly" in WavWriter
WavWriter needs a TON of modernization work, but for now this commit
just tackles two FIXMEs by converting samples correctly into all
supported integer PCM formats. The supported formats are only signed
16-bit and unsigned 8-bit for now, but can be expanded later. At least
we don't produce horrible speaker-destroying noise when writing any
other format.
2023-06-22 21:45:54 +02:00
Lucas CHOLLET 102fdf6305 AK: Override read_until_filled in FixedMemoryStream
This specialized method allow significant performance improvements for
the user.
2023-06-22 21:32:45 +02:00