Commit graph

23911 commits

Author SHA1 Message Date
Gunnar Beutner
7236584132 Kernel: Make kernel symbols available much earlier in the boot process
This adds a new section .ksyms at the end of the linker map, reserves
5MiB for it (which are after end_of_kernel_image so they get re-used
once MemoryManager is initialized) and then embeds the symbol map into
the kernel binary with objcopy. This also shrinks the .ksyms section to
the real size of the symbol file (around 900KiB at the moment).

By doing this we can make the symbol map available much earlier in the
boot process, i.e. even before VFS is available.
2021-07-14 23:04:34 +02:00
Max Wipfli
5a44a0b9f4 Tests: Add a basic test suite for HTMLTokenizer
The test suite includes a few basic tests and a very crude regression
test, which just concatenates the to_string() of all tokens and checks
the String's hash to be equal. This relies on the format of
HTMLToken::to_string() to stay the same, which is not ideal.
2021-07-14 23:03:36 +02:00
Max Wipfli
045a6a566b LibWeb: Remove unused HTMLTokenizer::m_input member variable 2021-07-14 23:03:36 +02:00
Max Wipfli
35f32ac170 LibWeb: Change HTMLToken.h to east const style 2021-07-14 23:03:36 +02:00
Max Wipfli
125982943a LibWeb: Change HTMLTokenizer.{cpp,h} to east const style 2021-07-14 23:03:36 +02:00
Gunnar Beutner
300823c314 LibWeb: Use move() when enqueuing tokens in HTMLTokenizer
We're not using the current token anymore once it's enqueued so let's
use move() when enqueuing the tokens.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
c3ad8e9a52 LibWeb: Remove StringBuilder from HTMLToken::m_comment_or_character 2021-07-14 23:03:36 +02:00
Gunnar Beutner
3aa202c432 LibWeb: Remove StringBuilder from HTMLToken::m_tag 2021-07-14 23:03:36 +02:00
Gunnar Beutner
901d71148b LibWeb: Remove StringBuilders from HTMLToken::AttributeBuilder 2021-07-14 23:03:36 +02:00
Gunnar Beutner
992964aa7d LibWeb: Remove StringBuilders from HTMLToken::m_doctype 2021-07-14 23:03:36 +02:00
Gunnar Beutner
2150609590 LibWeb: Remove more unused StringBuilders in HTMLToken
These fields aren't read anywhere but I didn't feel like removing
them outright.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
d9e52997e2 LibWeb: Use an Optional<String> to track the last HTML start tag
Using an HTMLToken object here is unnecessary because the only
attribute we're interested in is the tag_name.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
d92548c5b0 AK: Avoid pagefaults when repeatedly enqueing/dequeing items in a Queue
When repeatedly enqueing and dequeing a single item in a Queue we end
up faulting in all the pages for the underlying Vector. This is a
performance issue - especially where the element type is large.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
3ff0a3aa4b AK: Avoid allocations for the Queue class
Previously the Queue class used a SinglyLinkedList to manage its queue
segments. This changes the Queue class to use the IntrusiveList class
instead which saves us one allocation per segment.
2021-07-14 23:03:36 +02:00
Andreas Kling
859e5741ff Kernel: Fix Process use-after-free in Thread finalization
We leak a ref() onto every user process when constructing them,
either via Process::create_user_process(), or via Process::sys$fork().

This ref() is balanced by a corresponding unref() in
Thread::WaitBlockCondition::finalize().

Since kernel processes don't have a leaked ref() on them, this led to
an extra Process::unref() on kernel processes during finalization.
This happened during every boot, with the `init_stage2` process.

Found by turning off kfree() scrubbing. :^)
2021-07-14 22:36:29 +02:00
Timothy Flynn
6211eb0f9a LibJS: Implement Atomics.store 2021-07-14 20:44:42 +01:00
Timothy Flynn
b6364ec899 LibJS: Implement Atomics.xor 2021-07-14 20:44:42 +01:00
Timothy Flynn
d2f6255b91 LibJS: Implement Atomics.sub 2021-07-14 20:44:42 +01:00
Timothy Flynn
f9d8e234b2 LibJS: Implement Atomics.or 2021-07-14 20:44:42 +01:00
Timothy Flynn
2d3af5c1b4 LibJS: Implement Atomics.and 2021-07-14 20:44:42 +01:00
Timothy Flynn
940875c9fd LibJS: Implement Atomics.load 2021-07-14 20:44:42 +01:00
Timothy Flynn
cc3b96743a LibJS: Implement Atomics.add 2021-07-14 20:44:42 +01:00
Timothy Flynn
ba2c3731e9 LibJS: Make ValidateTypeArray abstraction public
Also adds a typed_array_from helper for casting a known value to a
TypedArray.
2021-07-14 20:44:42 +01:00
Timothy Flynn
4f8f79c5ca LibJS: Add some TypedArray abstractions for querying underlying type
IsUnclampedIntegerElementType and IsBigIntElementType.
2021-07-14 20:44:42 +01:00
Timothy Flynn
f4ea6b1824 LibJS: Implement TypedArray GetModifySetValueInBuffer abstract operation 2021-07-14 20:44:42 +01:00
Timothy Flynn
a61723ec59 LibJS: Begin implementing Atomics
This adds the Atomics object to the global object and sets up only its
@@toStringTag property.
2021-07-14 20:44:42 +01:00
Timothy Flynn
df75c35d5b LibJS: Alphabetically sort LibJS's CMakeLists.txt 2021-07-14 20:44:42 +01:00
Sam Atkins
fa7a6fbedd Meta: Fix SPICE detection in run.sh
The previous fix did not work for me, but this does. :^)

Credit goes to @X-yl for actually figuring it out.
2021-07-14 21:17:56 +02:00
Kenneth Myhra
7fa71fb7eb Documentation: Remove '$' character from build instruction commands
This removes the '$' character so that it is easier to copy commands
directly from the build instructions and then executing them without
first having to remove the '$' character.
2021-07-14 19:51:23 +02:00
Karol Kosek
1c30f0a154 Browser: Escape an ampersand in the menu to avoid making a shortcut 2021-07-14 18:25:36 +02:00
Karol Kosek
871c51dfd3 LibGfx: Don't underline escaped ampersand in menus
Double ampersands (&&) marking in menus is meant to provide a way
to show the ampersand, since using just one would turn it
into a modifier that sets the shortcut for the next character.

Unfortunately, while the first character had a special case to avoid
marking this set, the marking was still calculated
for the second character.

The fix is rather simple: just skip then the following character!

This issue applied only to the visual part of the Menu.
The WindowServer calculation for the shortcut character is working
properly, i.e. ignores escaped ampersands.
2021-07-14 18:25:36 +02:00
Tom
c144d358ae ResourceGraph: Handle more than 4 GiB of memory 2021-07-14 18:24:55 +02:00
x-yl
410eb9e9ff Meta: Don't use SPICE if QEMU doesn't support it
I do seem to have a tendency for breaking everyone's builds :/
2021-07-14 17:17:06 +02:00
Timothy Flynn
f7acd6aca5 LibWeb: Handle when the last selected node does not contain text
If the text-for-rendering of the last selected node is empty, the select
all implementation would end up setting the index to -1. This value is
used directly for a substring length in the copy text implementation,
thus would cause a failed assertion.
2021-07-14 17:16:39 +02:00
Timothy Flynn
22ab512f39 LibWeb: Remove now-duplicated actions from IPWV regarding text selection 2021-07-14 17:16:39 +02:00
Timothy Flynn
615a1c7210 Browser: Add context menu item for selecting all text 2021-07-14 17:16:39 +02:00
Timothy Flynn
ae910e4370 LibWeb: Add OOPWV IPC for selecting all text 2021-07-14 17:16:39 +02:00
Timothy Flynn
fea7e84b26 LibWeb: Move select-all implementation to BrowsingContext 2021-07-14 17:16:39 +02:00
Timothy Flynn
58cb37f986 Browser: Add context menu item for copying selected text 2021-07-14 17:16:39 +02:00
Timothy Flynn
2fda6ce159 LibWeb: Add OOPWV IPC for retrieving selected text 2021-07-14 17:16:39 +02:00
Jean-Baptiste Boric
528574d958 Kernel: Detect and display CPUID Hyper-V data 2021-07-14 13:52:34 +02:00
Jean-Baptiste Boric
b22357b17b Kernel: Detect and display CPUID hypervisor signature 2021-07-14 13:52:34 +02:00
Jean-Baptiste Boric
4cc346fb19 Kernel: Add support for hypervisor CPUID feature 2021-07-14 13:52:34 +02:00
Liav A
bee75c1f24 Kernel/ProcFS: Allow a process directory to have a null Process pointer
In case we are about to delete the PID directory, we clear the Process
pointer. If someone still holds a reference to the PID directory (by
opening it), we still need to delete the process, but we can't delete
the directory, so we will keep it alive, but any operation on it will
fail by propogating the error to userspace about that the Process was
deleted and therefore there's no meaning to trying to do operations on
the directory.

Fixes #8576.
2021-07-14 13:40:01 +02:00
Aziz Berkay Yesilyurt
d1028f8aed LibGfx: Use clear_with capacity instead of clear in PNGWriter
Same vector was cleared up and filled in continuously.
2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
b70f2b00a3 LibGfx: Store the size of the chunk from start in PNGWriter
Before this change PNGWriter::add_chunk used to make a copy of
PNGChunk's ByteBuffer to prepend the size of the data.
With this change, 4-byte space is saved from the beginning and written
at the end of the operation. Avoiding this copy yields significant
speed up.
2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
db36ddc763 LibGfx: Prevent a copy in PNGWriter by storing type data at start 2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
d84c4b94da LibGfx: Prevent frequent memory allocations in PNGWriter 2021-07-14 13:37:18 +02:00
Aziz Berkay Yesilyurt
97859aaff1 LibGfx: Use ByteBuffer instead of Vector<u8> in PNGWriter
This is the first step towards reducing the number of copies in
PNGWriter by switching to ByteBuffer as underlying storage.
2021-07-14 13:37:18 +02:00
Andreas Kling
d78a007b5d LibWeb: Use split_view() in attribute selector matching
Using split() creates a new String object for each of the split tokens.
Use split_view() instead to avoid these unnecessary heap allocations.
2021-07-14 13:31:49 +02:00