Commit graph

51796 commits

Author SHA1 Message Date
Pierre Delagrave 55faff80df Kernet/Net: Close a TCP connection using FIN|ACK instead of just FIN
When initiating a connection termination, the FIN should be sent with
a ACK from the last received segment even if that ACK already been sent.
2023-06-29 05:58:03 +02:00
Andi Gallo d33b99dd24 LibWeb: Check whether table box width is auto when resolving cell width
Computing the table width algorithm bifurcates based on whether
table-root width is auto. We only adjust the used table width based on
cell percentage widths on the auto branch, thus the same check is needed
when we initialize cell widths.
2023-06-29 05:37:34 +02:00
Hendiadyoin1 37067cf3ca LibJS: Use the IdentifierTable for NewFunction and NewClass lhs names
This makes them trivially copyable, which is an assumption multiple
optimizations use when rebuilding the instruction stream.

This fixes most optimized crashes in the test262 suite.
2023-06-29 05:32:08 +02:00
Daniel Bertalan c21255da7f LibJS: Align NewPromiseCapability with spec changes
See https://github.com/tc39/ecma262/commit/874ecf9

After this refactoring, we now correctly handle non-function /
non-undefined objects being passed multiple times: instead of skipping
assignment to promiseCapability altogether and failing with a
NotAFunction error in the end; on the second time the executor closure
is called, we return GetCapabilitiesExecutorCalledMultipleTimes.

This fixes the 7 `capability-executor-called-twice.js` test262 tests.
2023-06-28 23:36:15 +01:00
Shannon Booth 0748e755d8 LibJS: Implement SetValueInBuffer closer to spec
No functional changes intended, mostly just adding spec comments, along
with some asserts.
2023-06-28 23:18:39 +01:00
Shannon Booth fe479ffd66 LibJS: Add spec comment for [[ArrayBufferData]]
I have found myself needing to grep around for this one a bunch.
2023-06-28 23:18:39 +01:00
Shannon Booth 78d5c23c3a LibJS: Add spec comment for IsDetachedBuffer ( arrayBuffer ) 2023-06-28 23:18:39 +01:00
Linus Groh 8ac4a5315b Revert "Meta: Remove my CODEOWNERS entries"
This reverts commit 20f2389e2a.
2023-06-28 18:53:29 +01:00
PrestonLTaylor 0eac8bce6f LibWeb: Fix js execution for js urls in anchor tags href 2023-06-28 16:19:13 +02:00
Daniel Bertalan 1a10e904b5 AK: Use compiler builtins for MakeIntegerSequence/TypeListElement
These recursive templates have a measurable impact on the compile speed
of Variant-heavy code like LibWeb. Using these builtins leads to a 2.5%
speedup for the measured compilation units.
2023-06-28 16:18:32 +02:00
Andi Gallo 4596d41291 LibWeb: Make cell percentage widths relative to table
Cell percentage widths are relative to table width, not containing
block width. If the table width is auto, there isn't a normative
specification, only a brief mention that the user agent should try to
meet it.

As a starting point, we increase the width of the table such that it's
sufficient to cover min-width of cells with a percentage width. This
matches the behavior of other browsers, at least for simple cases.
2023-06-28 16:14:42 +02:00
Daniel Bertalan 50d6b1ba19 LibJS/Bytecode: Keep completion value of switch case if falling through
We do this by moving the `LoadImmediate undefined` instruction to a
separate basic block which jumps to the case's block unconditionally.
We enter a case initially using this wrapper, but when falling through,
we directly jump to the next case's block.
2023-06-28 12:30:23 +02:00
Andrew Kaster 02b74e5a70 AK: Re-enable consteval StringView literal workaround for oss-fuzz
oss-fuzz ships a pre-release commit of clang-15 for all of their build
bots. Until they update to a release of clang-15 that includes the fix
for this bug, or a later release, we need to keep the workaround in
place.
2023-06-28 12:18:06 +02:00
Andi Gallo 9cb4fe6a6f LibWeb: Don't distribute excess width to constrained columns
Bring our implementation closer to the specification, which distributes
excess width to unconstrained columns first.
2023-06-28 12:17:55 +02:00
zhiyuang 6bd4d44f73 LibWeb: Make two borders joints part painting work
Unify using device pixel to compute step
2023-06-28 10:08:09 +01:00
Shannon Booth be280ff3e4 LibJS/Tests: Enable some now passing Array length tests
Now that serenity is 64 bit only these tests no longer need to be
skipped :^)
2023-06-28 10:48:15 +02:00
Daniel Bertalan fda619c7c2 LibJS/Bytecode: Implement Annex B Initializers in ForIn Statement Heads 2023-06-28 10:42:32 +02:00
Lucas CHOLLET 4e0b52d009 Meta: Add a gdb pretty-printer for FixedArray 2023-06-28 08:01:01 +01:00
Daniel Adams 49e6414c58 LibWeb: Start filling out BaseAudioContext/AudioContext interfaces
- Fills out both IDLs and implements some basic attributes/methods.
- No actual audio processing yet though :^)
2023-06-28 05:22:51 +02:00
Daniel 30e67721ae Meta: Fix IDL binding generation for dictionary members
- Previously was generating bad syntax and missed a snakecase conversion
2023-06-28 05:22:51 +02:00
Daniel Bertalan fc7de74b12 LibJS/Bytecode: Improve export statement handling
This adds support for exporting class expressions, which was previously
TODO'd.

We now correctly set the binding name of exports to `"*default*"` if
they are unnamed. I'm not sure what the difference between the
`InitializationMode` kinds is, but using `Initialize` fixes a bunch of
tests.

Note that some export tests (e.g. `eval-export-dflt-expr-cls-named.js`)
still fail, as we don't set the "name" property of exported classes
correctly.

176 new passes on test262
2023-06-28 05:13:52 +02:00
Daniel Bertalan 11a7014b4e LibJS/Bytecode: Handle ImportStatement in codegen
There is nothing to do here at runtime as imports are handled in
`Interpreter::run`.
2023-06-27 21:10:08 +02:00
Luke Wilde 363bf114c0 LibJS/Bytecode: Implement for await of
Summary:
    Diff Tests:
        +391    +15    +2 💥️    -408 📝
2023-06-27 21:04:22 +02:00
Liav A 9b8b8c0e04 Kernel: Simplify reboot & poweroff code flow a bit
Instead of using ifdefs to use the correct platform-specific methods, we
can just use the same pattern we use for the microseconds_delay function
which has specific implementations for each Arch CPU subdirectory.

When linking a kernel image, the actual correct and platform-specific
power-state changing methods will be called in Firmware/PowerState.cpp
file.
2023-06-27 20:04:42 +02:00
kleines Filmröllchen 5c8405c455 ClipboardHistory: Use i32 config change listener
Fixes a FIXME.
2023-06-27 15:37:00 +01:00
kleines Filmröllchen 33829f05fe Userland: Convert config listener callbacks to use StringView
The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
2023-06-27 15:37:00 +01:00
kleines Filmröllchen 5f1dbbaaa6 LibAudio: Extract loader stream creation from the plugins
This removes a lot of duplicated stream creation code from the plugins,
and also simplifies the way that the appropriate plugin is found. This
mirrors the ImageDecoderPlugin design and necessitates new sniffing
methods on the loaders.
2023-06-27 15:28:22 +01:00
kleines Filmröllchen dfd48ab643 LibAudio: Extract MP3 synchronize to static helper function
This comes in handy when we want to sniff an MP3 file with a stream
outside of the loader.
2023-06-27 15:28:22 +01:00
Andreas Kling aec3d9d84e LibJS/Bytecode: Prefer alias over name in object pattern bindings
10 new passes on test262. :^)
2023-06-27 15:08:14 +02:00
Andreas Kling 1dc7f03137 LibJS: Have AsyncFunctionDriverWrapper unwrap promises before returning
24 new passes on test262. :^)
2023-06-27 13:48:27 +02:00
Daniel Bertalan cc9ec6693b LibJS: Remove the concept of bytecode optimization levels
While this would be useful in the future for implementing a multi-tiered
optimization strategy, currently a binary on/off is enough for us. This
removes the confusingly on-by-default `OptimizationLevel::None` option
which made the optimization pipeline a no-op even if
`Bytecode::Interpreter::set_optimizations_enabled` had been called.

Fixes #15982
2023-06-27 14:35:23 +03:30
Daniel Bertalan e012565898 test262-runner+js: Respect the bytecode optimizations enabled flag 2023-06-27 14:35:23 +03:30
Andrew Kaster aa0ed4ab4e LibDebug: Keep track of the SetEpilogueBegin LineProgram OpCode
This prevents a crash with clang 16.
2023-06-27 12:40:38 +02:00
implicitfield 1e1fcb2ae7 Meta: Remove unused LLVM_VERSION declaration
All uses of this were removed in c4707ed.
2023-06-27 12:40:38 +02:00
implicitfield 941d68ac2d Toolchain+Ports: Update LLVM to 16.0.6 2023-06-27 12:40:38 +02:00
implicitfield 5dfe2eb389 Everywhere: Resolve conflicts with LibC and libc++
Since https://reviews.llvm.org/D131441, libc++ must be included before
LibC. As clang includes libc++ as one of the system includes, LibC
must be included after those, and the only correct way to do that is
to install LibC's headers into the sysroot.

Targets that don't link with LibC yet require its headers for one
reason or another must add install_libc_headers as a dependency to
ensure that the correct headers have been (re)installed into the
sysroot.

LibC/stddef.h has been dropped since the built-in stddef.h receives
a higher include priority.

In addition, string.h and wchar.h must
define __CORRECT_ISO_CPP_STRING_H_PROTO and
_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS respectively in order to tell
libc++ to not try to define methods implemented by LibC.
2023-06-27 12:40:38 +02:00
implicitfield 58c4e266e9 LibWeb: Prevent double promotion in paint_background 2023-06-27 12:40:38 +02:00
implicitfield 007f3cdb00 Everywhere: Remove exceptions for using #include <LibC/...>
Once LibC is installed to the sysroot and its conflicts with libc++
are resolved, including LibC headers in such a way will cause errors
with a modern LLVM-based toolchain.
2023-06-27 12:40:38 +02:00
implicitfield 79adeb626b LibC+LibELF: Move ELF definitions from LibC to LibELF
This is needed to avoid including LibC headers in Lagom builds.
Unfortunately, we cannot rely on the build machine to provide a
fully POSIX-compatible ELF header for Lagom builds, so we have to
use our own.
2023-06-27 12:40:38 +02:00
implicitfield 7d19abda7a LibC+LibRegex: Move regex_defs.h from LibC to LibRegex
This is needed to avoid including LibC headers in Lagom builds.
2023-06-27 12:40:38 +02:00
implicitfield ec636a404b Meta: Make check-style.py complain if a non-AK complex header is used
LibC's complex.h should not be used in C++ code, and libc++'s version
implementation does not follow the Serenity C++ style.
2023-06-27 12:40:38 +02:00
implicitfield cccb6c7287 LibC: Drop complex.cpp and move its definitions to complex.h
libc++ disallows including LibC's complex.h in C++ mode. This means that
a C++ file cannot expect LibC's complex.h to be included, and thus
cannot use c-prefixed complex number functions. As a result,
complex.cpp is broken when libc++ has a higher include priority
than LibC.

A check for __cplusplus has been added to complex.h to warn users of
toolchains that don't use libc++.
2023-06-27 12:40:38 +02:00
MacDue 1cc199d365 LibWeb: Prevent crash when inspecting SVG documents
(Or any document with aria-hidden=true on the root)
2023-06-27 09:20:06 +01:00
Andreas Kling 9430bbcc62 LibJS/Bytecode: Propagate FunctionDeclarationInstantiation exceptions
If an exception is thrown by FunctionDeclarationInstantiation for an
async or async-generator function, we still need to return a promise.
We can't just throw the exception.

81 new passes on test262. :^)
2023-06-27 00:21:52 +02:00
Andreas Kling 57404bae1f LibGfx: Return early from Painter::draw_line() if clip rect is empty 2023-06-26 20:28:42 +02:00
Nico Weber 3dd6638177 ICC: Strip trailing nul characters from MultiLocalizedUnicodeTagData
Having those trailing nuls is invalid per spec, but it happens in
practice (in already checked-in test files, no less).
2023-06-26 19:24:34 +01:00
Tim Ledbetter dedbc17160 cut: Add -s option to suppress lines without field delimiters
If this option is not specified, lines that contain to field
delimiters will be printed unmodified.
2023-06-26 19:49:34 +02:00
Tim Ledbetter e740489abd cut: Ignore trailing newline if present 2023-06-26 19:49:34 +02:00
Tim Ledbetter da67d593d8 cut: Treat a range containing consecutive commas or dashes as invalid 2023-06-26 19:49:34 +02:00
Tim Ledbetter bc56d71252 cut: Print the entire line if it contains no field delimiters 2023-06-26 19:49:34 +02:00