Commit graph

57080 commits

Author SHA1 Message Date
tetektoza
0be70ed97a GMLCompiler: Add enum initializer for opportunistic_resizee property
This patch adds a enum initializer for opportunistic_resizee and
makes the method that uses this property public so it's available for
GML compiler.
2023-12-08 01:06:09 +01:00
Tim Schumacher
35d4b36201 GMLCompiler: Fully qualify child class names
If we don't do this, and there a class in a namespace with the same
name, type resolution gets confused between `<namespace>::<class>` and
`<class>::<constructor>`.
2023-12-08 01:06:09 +01:00
tetektoza
9deaa74ad6 LibGUI: Split HorizontalSlider to separate header
This patch splits HorizontalSlider to separate header so it can be used
as a component in .gml files with new GML compiler.
2023-12-08 01:06:09 +01:00
Andreas Kling
f47a14b9d6 LibJS: Use a premade shape when creating iterator result objects
Instead of going through the steps of creating an empty new object,
and adding two properties ("value" and "done") to it, we can pre-bake
a shape object and cache the property offsets.

This makes creating iterator result objects in the runtime much faster.

47% speedup on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-08 00:54:05 +01:00
Jesús (gsus) Lapastora
706710fa13 LibJS/JIT: Make generating GDB images opt-in
Since generating GDB image can be expensive, it is disabled by default
and can be activated by setting the `LIBJS_JIT_GDB` environment
variable.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
f0b984567a LibJS/JIT: Produce & register an ELF image for GDB JIT Interface
Using the code that it has just produced, the JIT::Compiler can build an
ELF image so that we can attach meaningful symbols to JITted code, and
thus enable GDB to display more information about the code that we're
running.
2023-12-07 15:34:38 -07:00
Jesús "gsus" Lapastora
149e382735 LibJIT: Integrate GDB JIT Interface with ELF builders
Provide a function to create an ELF image in a format GDB expects.
Outside of ELF platforms this image doesn't make much sense, and in
MacOS a Mach-O memory image is required: see
https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/diagnostics/gdb-jit.cc#1802

Since GDB requires active runtime addresses for the code, copying the
generated code into the image will not help. Instead, `build_gdb_image`
writes the runtime addresses of the code into a NOBITS `.text` section.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
48a9d0ede8 LibELF: Add builders to help with creating ELF images
Introduces new builders, mainly `SectionTable` and `StringTable`, and a
final `build_elf_image` to merge everything into a single memory image.

Each of the builders are fully detached from one another, although
StringTable provides an extra API to remove steps when using it with a
SectionTable.

This automates the part of figuring out and properly writing offsets to
headers, and making sure all required data is properly copied and
referenced in the final image.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
bc70144df1 LibJIT: Enable registering JITted objects into GDB
The new JIT::GDB namespace enables registering JITted objects into GDB
dynamically.

Its clients just have to ensure the memory they give to
`register_into_gdb` is in a format that GDB can understand, either by
generating an object file in memory with debug info + symbols or by
registering a custom debug info parser.
None of these are implemented by this API; it only implements the
registering part and lets the client to choose the data format.

GDB JIT Interface:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/JIT-Interface.html#JIT-Interface
Things to take into account from v8's docs, some of which we may
improve: https://v8.dev/docs/gdb-jit#known-limitations
2023-12-07 15:34:38 -07:00
Timothy Flynn
7e974f530d Ladybird+LibWebView: Add an Inspector action to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
d5d6ff8bf1 Ladybird+LibWebView: Add an Inspector action to insert a child DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
c6a11a77b5 LibWebView+WebContent: Add a WebContent IPC to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
111e53a2f6 LibWebView+WebContent: Add WebContent IPC to create children DOM nodes
This adds IPC to create append a child <div> element or a text node to
a DOM node.
2023-12-07 23:16:34 +01:00
Andrew Kaster
bb217fb0d7 Meta: Add Bastiaan van der Plaat to the contributors list :^) 2023-12-07 14:56:19 -07:00
Bastiaan van der Plaat
3bfc2f5e95 LibWeb: Declare optional parse results inlined in if statements 2023-12-07 16:46:50 -05:00
Bastiaan van der Plaat
1b9a961fb0 LibWeb: Add input stepUp and stepDown functions 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
1a63639518 LibWeb: Move logic to check if valueAsNumber applies to its own function 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
c0751b2a49 LibWeb: Add basis of the convert number to string algorithm functions 2023-12-07 16:46:28 -05:00
Andrew Kaster
39c4a5e948 LibWeb: Add config file for LibWeb tests that skips Worker-echo.html 2023-12-07 16:46:20 -05:00
Andrew Kaster
4786d9e3e6 headless-browser: Add ability to skip tests 2023-12-07 16:46:20 -05:00
Reimar
4299fb604b LibWeb: Add window.status property 2023-12-07 11:02:50 -07:00
Kemal Zebari
3a820ddbdf LibWeb/MimeSniff: Add sniffing in an audio or video context 2023-12-07 10:31:54 -07:00
Kemal Zebari
02ea85da2c LibWeb/MimeSniff: Add sniffing in an image context 2023-12-07 10:31:54 -07:00
Kemal Zebari
ea15501f37 LibWeb/MimeSniff: Add sniffing in a browsing context 2023-12-07 10:31:54 -07:00
Kemal Zebari
f6d3ea33fa LibWeb/MimeSniff: Add match an archive type pattern algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
d5e5a1138f LibWeb/MimeSniff: Add match an audio or video type pattern algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
62ca3b518b LibWeb/MimeSniff: Add the image type pattern matching algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
2babc08c17 LibWeb/MimeSniff: Add rules for identifying an unknown mime type
This also implements the pattern matching algorithm since it's
needed.
2023-12-07 10:31:54 -07:00
Kemal Zebari
04e19df06a LibWeb/MimeSniff: Implement Resource
See https://mimesniff.spec.whatwg.org/#resource
2023-12-07 10:31:54 -07:00
Kemal Zebari
a2a61d6941 LibWeb/MimeSniff: Add move/copy construct and assignment to MimeType
This change exists to avoid having to reparse a MIME type when we
need to move/copy elsewhere.
2023-12-07 10:31:54 -07:00
Dan Klishch
96d44b1572 Userland: Make bit-fields compatible with MSVC C++ ABI 2023-12-07 10:28:19 -07:00
Dan Klishch
00928764e9 JSSpecCompiler: Add our first test :^) 2023-12-07 10:13:21 -07:00
Dan Klishch
107a3b44fa JSSpecCompiler: Add regression test runner 2023-12-07 10:13:21 -07:00
Dan Klishch
b7259ab38c LibCore: Support POSIX file actions in Core::Process::spawn 2023-12-07 10:13:21 -07:00
Dan Klishch
d317309d89 Everywhere: Unport Core::System::current_executable_path from new string
Storing paths in AK::String is never correct.
2023-12-07 10:13:21 -07:00
Dan Klishch
610fe28115 Meta: Add option to specify custom test names for Lagom 2023-12-07 10:13:21 -07:00
Dan Klishch
dbd624e875 JSSpecCompiler: Allow dumping AST after specified passes 2023-12-07 10:13:21 -07:00
Andreas Kling
350e6c54d7 LibJS: Remove dedicated iterator result instructions in favor of GetById
When iterating over an iterable, we get back a JS object with the fields
"value" and "done".

Before this change, we've had two dedicated instructions for retrieving
the two fields: IteratorResultValue and IteratorResultDone. These had no
fast path whatsoever and just did a generic [[Get]] access to fetch the
corresponding property values.

By replacing the instructions with GetById("value") and GetById("done"),
they instantly get caching and JIT fast paths for free, making iterating
over iterables much faster. :^)

26% speed-up on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-07 18:12:24 +01:00
Nicolas Ramz
8d68f94282 LibGfx/ILBMLoader: Add HAM6/HAM8 support 2023-12-07 10:08:29 -07:00
Andreas Kling
4699c81fc1 LibJS: Stop converting between Object <-> IteratorRecord all the time
This patch makes IteratorRecord an Object. Although it's not exposed to
author code, this does allow us to store it in a VM register.

Now that we can store it in a VM register, we don't need to convert it
back and forth between IteratorRecord and Object when accessing it from
bytecode.

The big win here is avoiding 3 [[Get]] accesses on every iteration step
of for..of loops. There are also a bunch of smaller efficiencies gained.

20% speed-up on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-07 14:06:34 +01:00
Bastiaan van der Plaat
4966c083df LibWeb: Remove progress element custom paintable use shadow dom instead 2023-12-07 11:37:01 +01:00
Bastiaan van der Plaat
ca94df3c88 LibWeb: Clean up shadow root of meter element 2023-12-07 11:37:01 +01:00
Kemal Zebari
34fa49c344 LibWeb/MimeSniff: Add missing spec comments 2023-12-07 11:11:07 +01:00
Lucas CHOLLET
965da551e3 LibGfx/TIFF: Print the corresponding enum value's name when possible
As an example, for the tag 262 if the value is 5, "LZW" will be
displayed instead of the numeric value.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
2691651abf LibGfx/TIFF: Generated the code to output debug prints
When the `TIFF_DEBUG` flag is set, the TIFF decoder logs every tag and
their values. This is already useful but require the developer to have
the spec handy in order to decrypt each value to its signification. None
of this information is available at runtime, but this is known by the
Python generator. So by generating these debug logs, we drastically
increase their value.

As a bonus point, most of these functions should be useful when we will
display image's metadata in Serenity.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
b82f5d7f3e LibGfx/TIFF: Add a C++ formatter for TIFF::Value 2023-12-07 11:10:55 +01:00
Lucas CHOLLET
6e282538cc LibGfx/TIFF: Generate a C++ helper function to print enums
For a given enum value, this function will return its corresponding name
as a `StringView`.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
f00e9540d5 LibGfx/TIFF: Add an intrinsic way to get the exportable name of Enums
The `TIFFType` enum is exported with a different name to C++. This
change of behavior was handled by manually setting the parameter of a
function. However, we will soon need the exported name in more places,
so let's make it a property of the Enum itself.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
1d345109c4 LibGfx/TIFF: Move Formatter<Rational>'s definition to TIFFMetadata.h
This will soon be used in TIFFTagHandler.cpp, so the definition needs to
be shared.
2023-12-07 11:10:55 +01:00
Timothy Flynn
71fdf0860e Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node 2023-12-07 10:53:12 +01:00