Commit graph

61584 commits

Author SHA1 Message Date
Aliaksandr Kalenik f29ac8517e LibJS: Skip ordinary_call_bind_this() when possible
If during parsing it was found that function won't use `this` then
there is no need to initialise `this_value` during call.
2024-05-23 09:53:31 +02:00
Aliaksandr Kalenik e934132442 LibJS+LibWeb: Pass function metadata collected in parsing using a struct
By using separate struct we can avoid updating AST node and
ECMAScriptFunctionObject constructors every time there is a need to
add or remove some additional information colllected during parsing.
2024-05-23 09:53:31 +02:00
Kirill Nikolaev 99f6528009 Kernel: Implement virtio-blk driver 2024-05-23 00:59:39 -06:00
Daniel Bertalan 060e6f4d21 Meta: Fix detection of default compiler versions
The logic in this script was *intended* to use the system's default
compiler if it was sufficiently new, and only start searching for the
latest installed if the default was not suitable.

However, the `cxx` program does not exist on Unixes, so the version
check always failed. We should be using the standard `c++` program name
instead.

After this change, the `CC` and `CXX` environment variables will have to
be used if someone wants to force a newer compiler version.
2024-05-23 00:56:37 -06:00
Ali Mohammad Pur 8b1341c77e LibWeb: Make exported Wasm functions keep the module instance alive
As it's not uncommon for users to drop the module instance on the floor
after having grabbed the few exports they need to hold on to.
Fixes a few UAFs that show up as "invalid" accesses to
memory/tables/etc.
2024-05-23 00:55:56 -06:00
dependabot[bot] 6d0aa7e64e CI: Bump JamesIves/github-pages-deploy-action from 4.6.0 to 4.6.1
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 00:54:43 -06:00
Gurkirat Singh e444b0aace Toolchain+Docs: Improve the way to enable clangd
Allowing an environment variable to enable/disable the build for clangd
and other toolchains will improve the developer-experience than
reconfiguring and building the toolchain manually.

Now you will have to call the command as following
	$ CLANG_ENABLE_CLANGD=ON Toolchain/BuildClang.sh
2024-05-23 00:54:20 -06:00
dgaston 2d5cb1e02d Chess: Add display widget for moves
Adds a TextEditor widget to the chess application to display move
history. It is updated whenever Board::apply_move is called to reflect
the current board state.
2024-05-22 23:24:45 -06:00
Matthew Olsson 6a4938a524 ClangPlugins: Convert all warnings to errors
Now that the lambda capture plugin isn't full of false-positives, we can
make the jump and start halting builds for these errors. It also allows
these plugins to be useful in CI.
2024-05-22 21:55:34 -06:00
Matthew Olsson 573bbd47ee Tests: Update ClangPlugins to use C++23 when running Clang 2024-05-22 21:55:34 -06:00
Matthew Olsson a98ad191c7 Userland: Add ESCAPING annotations to a bunch of places
This isn't comprehensive; just a result of a simple grep search.
2024-05-22 21:55:34 -06:00
Matthew Olsson e0d6afbabe ClangPlugins: Invert the lambda detection escape mechanism
Instead of being opt-out with NOESCAPE, it is now opt-in with ESCAPING.
Opt-out is ideal, but unfortunately this was extremely noisy when
compiling the entire codebase. Escaping functions are rarer than non-
escaping ones, so let's just go with that for now.

This also allows us to gradually add heuristics for detecting missing
ESCAPING annotations and emitting them as errors. It also nicely matches
the spelling that Swift uses (@escaping), which is where this idea
originally came from.
2024-05-22 21:55:34 -06:00
Matthew Olsson a5f4c9a632 AK+Userland: Remove NOESCAPE
See the next commit for an explanation
2024-05-22 21:55:34 -06:00
Tim Ledbetter d2b3007248 IDLGenerators: Use spec-compliant algorithm to parse integer values 2024-05-23 04:15:46 +02:00
Liav A 5b17091a4b Ports/file: Build host version to ensure we can properly cross compile
We should build file natively as well so it can be used to compile the
target build (for serenity). The Makefile doesn't do this automatically
so to ensure it will not fail due to version mismatch between the host
version and target version, we ensure we always have a native binary at
hand.
2024-05-23 01:00:39 +02:00
Liav A. 3ba5daeca9 Kernel: Actually set physical base pointer correctly in prekernel stage
I did a mistake and set the kernel_physical_base value to be just on
the actual linked kernel ELF start offset, while this value should
represent together with KERNEL_MAPPING_BASE the actual higher-half load
address.

By changing this value, we resolve a bug in which disabling KASLR
doesn't work and will cause the prekernel to hang on this statement:
```c++
VERIFY(kernel_load_base >= kernel_mapping_base + 0x200000);
```
2024-05-22 23:25:51 +02:00
Andreas Kling 899c38d342 LibWeb: Mark IDBFactory.open() with FIXME extended attribute in IDL
The stub implementation broke x.com and probably other sites as well,
but let's at least mark it FIXME so we get some debug logging about it.
2024-05-22 21:46:08 +02:00
Andreas Kling 79870bc603 Revert "LibWeb: Add stub for IDBFactory.open"
This reverts commit f7beea1397.

This broke loading https://x.com/
2024-05-22 21:40:52 +02:00
Lucas CHOLLET c83fc59534 Tests/LibGfx: Also test animated GIFs 2024-05-22 13:29:05 -04:00
Lucas CHOLLET 07446bbea1 LibGfx/GIF: Use the correct reference to seek before the trailer
This was working with files, but with pre-allocated buffers, the end
is not the same position as last written byte.
2024-05-22 13:29:05 -04:00
Lucas CHOLLET 3c4b8749f0 LibGfx/GIF: Write a Graphic Control Extension block
This allows us to write the duration of each frame.
2024-05-22 13:29:05 -04:00
Lucas CHOLLET bee8dd76ee LibGfx/GIF: Write the netscape extension block
This allows us to encode the required number of loops in the file.
2024-05-22 13:29:05 -04:00
Aliaksandr Kalenik ebb3d8025c LibJS: Get this from execution context for non-arrow functions
Allows to skip function environment allocation for non-arrow functions
if the only reason it is needed is to hold `this` binding.

The parser is changed to do following:
- If a function is an arrow function and uses `this` then all functions
  in a scope chain are marked to allocate function environment for
  `this` binding.
- If a function uses `new.target` then all functions in a scope chain
  are marked to allocate function environment.

`ordinary_call_bind_this()` is changed to put `this` value in execution
context when function environment allocation is skipped.

35% improvement in Octane/typescript.js
50% improvement in Octane/deltablue.js
19% improvement in Octane/raytrace.js
2024-05-22 18:30:13 +02:00
Dan Klishch 7ae990d2e5 LibCrypto: Don't compute 2*N remainders in Adler32
Otherwise Zlib decompression spends half of the time computing the
checksum.
2024-05-22 14:25:21 +02:00
Nico Weber b7b51d01c3 LibGfx/AnimationWriter: Survive animations with two identical frames
Creating a completely empty bitmap fails. Just write a 1x1 bitmap
if the bitmap ends up empty for now.
2024-05-22 06:41:47 -04:00
Nico Weber 51617929dc LibGfx/GIFLoader: Add more debug logging output 2024-05-22 06:41:47 -04:00
Dan Klishch 5a85067b49 Revert "LibCore: Add Core::deferred_invoke_if(F, Condition)"
This reverts commit a362c37c8b.

The commit tried to add an unused function that continued our tradition
of not properly waiting for things but instead flooding event loop with
condition checks that delay firing of the event. I think this is a
fundamentally flawed approach. See also checks for
`fire_when_not_visible` in LibCore/EventLoopImplementationUnix.cpp.
2024-05-21 23:32:54 +02:00
Tim Ledbetter c0e504fbdd LibWeb: Add some missing [FIXME] IDL attributes 2024-05-21 19:29:04 +02:00
Tim Ledbetter 58bb5e1f7a LibWeb: Use [Reflect] to implement HTMLPreElement.width 2024-05-21 19:28:43 +02:00
Tim Ledbetter 2a7cf1c588 LibWeb: Implement the width and height attributes where missing
This change adds the `width` and `height` properties to
`HTMLVideoElement` and `HTMLSourceElement`. These properties reflect
their respective content attribute values.
2024-05-21 19:28:43 +02:00
Tim Ledbetter 9f9aa62128 LibWeb: Implement the hspace and vspace attributes
These properties reflect their respective content attributes.
2024-05-21 19:28:43 +02:00
Tim Ledbetter 1bc0fcca8d IDLGenerators: Support [Reflect] on long and unsigned long attributes 2024-05-21 19:28:43 +02:00
Aliaksandr Kalenik 4d37b9e715 LibJS: Do not count arguments as env binding when local variable is used
This is a follow up for 210a5d77dc that
actually allows to skip function environment allocation.
2024-05-21 15:49:29 +00:00
Dan Klishch 38b51b791e AK+Kernel+LibVideo: Include workarounds for missing P0960 only in Xcode
With this change, ".*make.*" function family now does error checking
earlier, which improves experience while using clangd. Note that the
change also make them instantiate classes a bit more eagerly, so in
LibVideo/PlaybackManager, we have to first define SeekingStateHandler
and only then make() it.

Co-Authored-By: stelar7 <dudedbz@gmail.com>
2024-05-21 14:24:59 +02:00
Ali Mohammad Pur 960a4b636c RequestServer: Account for null sockets in recreate_socket_if_needed()
A connection's socket is allowed to be null if it's being recreated
after a failed connect(), this was handled correctly in
request_did_finish but not in recreate_socket_if_needed; this commit
fixes this oversight.
2024-05-21 11:25:08 +02:00
Aliaksandr Kalenik 210a5d77dc LibJS: Use a local variable for arguments object when possible
This allows us to skip allocating a function environment in cases where
it was previously impossible because the arguments object needed a
binding.

This change does not bring visible improvement in Kraken or Octane
benchmarks but seems useful to have anyway.
2024-05-21 11:24:50 +02:00
Lucas CHOLLET 777e84b09b LibGfx+animation: Support writing animated GIF files 2024-05-21 09:47:46 +02:00
Lucas CHOLLET 6a5f8b5163 LibGfx/GIF: Make write_logical_descriptor() take an IntSize
The bitmap was only needed for its size.
2024-05-21 09:47:46 +02:00
Tim Ledbetter 817bfef3aa Tests/AK: Add tests for integral log2 2024-05-21 09:31:17 +02:00
Tim Ledbetter d0d81e470e AK: Fix off by one error in integral ceil_log2()
Previously, certain values of `ceil_log2(x)` would be 1 smaller than
`ceil(log2(x))`.
2024-05-21 09:31:17 +02:00
Kenneth Myhra 29112f7365 LibWeb: Integrate Streams in XHR::send() 2024-05-20 16:57:52 -04:00
Kenneth Myhra 76418f3ffa LibWeb: Implement the concept incrementally read a body 2024-05-20 16:57:52 -04:00
Kenneth Myhra 34ecc59508 LibWeb: Implement read a chunk concept for ReadableStreamDefaultReader 2024-05-20 16:57:52 -04:00
Kenneth Myhra 50f454fdd5 LibWeb: Enqueue body chunks in Fetch::extract_body()
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2024-05-20 16:57:52 -04:00
Kenneth Myhra f119ac1a9d LibWeb: Integrate TransformStream into fetch_response_handover() 2024-05-20 16:57:52 -04:00
Kenneth Myhra 5a3e603b3d LibWeb: Implement AO transform_stream_set_up() 2024-05-20 16:57:52 -04:00
Kenneth Myhra f3ecdb22d5 LibWeb: Implement ReadableStream::close() 2024-05-20 16:57:52 -04:00
Kenneth Myhra e2c4019bfc LibWeb: Close acquired writer in AO readable_stream_pipe_to()
Also adds a test to prove that the WritableStream's close callback is
called.
2024-05-20 16:57:52 -04:00
Kenneth Myhra 15b677385c LibWeb: Provide an UInt8Array to AO writable_stream_default_writer_write
ReadLoopReadRequest::on_chunk expects an UInt8Array, so make sure we
convert the passed in ByteBuffer to an UInt8Array before passing it to
the AO writable_stream_default_writer_write.

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2024-05-20 16:57:52 -04:00
Timothy Flynn b5ba60f1d1 LibWeb: Change Fetch's ProcessBodyError to accept a plain JS value
This callback is meant to be triggered by streams, which does not always
provide a WebIDL::DOMException. Pass a plain value instead. Of all the
users of this callback, only one actually uses the value, and already
converts the DOMException to a plain value.
2024-05-20 16:57:52 -04:00