Commit graph

23948 commits

Author SHA1 Message Date
Gunnar Beutner
e4f05a9046 Kernel: Make new kernel build process work on macOS
Use objcopy from the toolchain so that the changes introduced in
7236584 will succeed on macOS.

Fixes #8768.
2021-07-15 11:04:30 +02:00
Matthew Hall
3b5b7c5e65 VimEditingEngine: Add support for repeats of J 2021-07-15 10:10:07 +02:00
Matthew Hall
2653ad36ee VimEditingEngine: Add support for repeats of p and P 2021-07-15 10:10:07 +02:00
Matthew Hall
7b7548ce9d VimEditingEngine: Allow repeats for dd, yy and x 2021-07-15 10:10:07 +02:00
Matthew Hall
c1e2710a0d VimEditingEngine: Add P command to put before cursor 2021-07-15 10:10:07 +02:00
Matthew Hall
180e2469af VimEditingEngine: Add J command to join two lines 2021-07-15 10:10:07 +02:00
Matthew Hall
a7e7f62d08 VimEditingEngine: Operate on real lines rather than wrapped ones
In the normal editing engine keys like Home, End etc work on visual
lines, but vim operates on real ones. Eg if you have a really long line
and wrapping is on then in normal editing Home would take you to the
beginning of the wrapped line, but 'I' would put you insert mode at the
beginning of the real line in vim.
2021-07-15 10:10:07 +02:00
Riyyi
5d1676b05a Meta: Do not warn user about too modern clang-format
To prevent warnings for users of varying distributions, do not warn the
user if the clang-version is higher than the expected version.
2021-07-15 09:27:44 +02:00
Daniel Bertalan
4566387ba5 AK: Add workaround for clang-format 12 problems with concepts 2021-07-15 09:26:19 +02:00
Andreas Kling
15ad4a8fd6 Kernel: Convert RangeAllocator to using a RedBlackTree internally
This data structure is a much better fit for what is essentially a
sorted list of non-overlapping ranges.

Not using Vector means we no longer have to worry about Vector buffers
getting huge. Only nice & small allocations from now on.
2021-07-15 02:03:57 +02:00
Andreas Kling
980f409003 AK: Allow getting the key from a RedBlackTree iterator 2021-07-15 01:48:10 +02:00
Andreas Kling
4ff35c23d3 AK: Make RedBlackTree non-copyable and non-movable 2021-07-15 01:48:09 +02:00
Andreas Kling
b0d9b88c49 Kernel: Hoist VERIFY from a loop in RangeAllocator::allocate_specific() 2021-07-15 01:48:09 +02:00
Andreas Kling
7ff14fecba Kernel: Remove unnecessary locking in RangeAllocator::contains()
The total range managed by a RangeAllocator doesn't change, so there's
no need to take a spinlock while comparing against it.
2021-07-15 01:48:09 +02:00
Andreas Kling
d4c73daacb Kernel: Convert RangeAllocator to east-const style 2021-07-15 01:48:09 +02:00
Kenneth Myhra
d60f617644 Ports: Add Launcher for Epsilon 2021-07-15 01:47:51 +02:00
Kenneth Myhra
6fa4eb7c8e Ports: Add missing dependency 'freetype' for Epsilon 2021-07-15 01:47:51 +02:00
Ali Mohammad Pur
5d170810db AK: Make JsonParser correctly parse unsigned values larger than u32
Prior to this, it'd try to stuff them into an i64, which could fail and
give us nothing.
Even though this is an extension we've made to JSON, the parser should
be able to correctly round-trip from whatever our serialiser has
generated.
2021-07-15 01:47:35 +02:00
Max Wipfli
2404ad6897 LibWeb: Fix assertion failure when tokenizing JS regex literals
This fixes parsing the following regular expression: /</g;

It also adds a simple script element to the HTMLTokenizer regression
test, which also contains that specific regex.
2021-07-15 01:47:22 +02:00
Linus Groh
c82c652ee4 js: Implement pretty-printing of Temporal.Calendar objects 2021-07-14 23:50:03 +01:00
Linus Groh
bb86d535a9 js: Tweak pretty-printing of Temporal.{Instant,TimeZone} objects
No need for the key/value style here, just put it right after the type.
2021-07-14 23:50:03 +01:00
Linus Groh
466c5bc96d LibJS: Implement Temporal.Calendar.prototype.id 2021-07-14 23:50:03 +01:00
Linus Groh
3ee169d8e7 LibJS: Implement Temporal.Calendar.prototype.toJSON() 2021-07-14 23:50:03 +01:00
Linus Groh
83bbbbe567 LibJS: Implement Temporal.Calendar.prototype.toString() 2021-07-14 23:50:03 +01:00
Linus Groh
e01c6adab4 LibJS: Implement Temporal.Calendar.prototype[@@toStringTag] 2021-07-14 23:50:03 +01:00
Linus Groh
a2f1d79765 LibJS: Start implementing Temporal.Calendar
Just like the previous Temporal.{Instant,TimeZone} commits, this patch
adds the Calendar object itself, its constructor and prototype
(currently empty), and two required abstract operations.
2021-07-14 23:50:03 +01:00
Linus Groh
48b66c7a68 LibJS: Put Temporal.Instant.prototype member definitions in spec order 2021-07-14 23:50:03 +01:00
Linus Groh
6c8f0fbb35 LibJS: Use more specific return types for some Temporal AOs
Instead of returning Object* we should be specific and return Instant*,
TimeZone* etc.
2021-07-14 23:50:03 +01:00
Idan Horowitz
be475cd6a8 Kernel: Handle OOM when adding memory regions to Spaces :^) 2021-07-15 00:49:41 +02:00
Idan Horowitz
e94dfb7355 AK: Expose RedBlackTree allocation failures via try_insert
This should help with using the RedBlackTree in a more OOM-safe way in
the kernel.
2021-07-15 00:49:41 +02:00
Max Wipfli
a9a54914bf Tests: Add comments to the HTMLTokenizer regression test file 2021-07-15 00:48:45 +02:00
Max Wipfli
bb2aed7d76 LibWeb: Correct behavior of Comment* states in HTMLTokenizer
Previously, this would lead to assertion failures when parsing HTML
comments. This fixes #8757.
2021-07-15 00:48:45 +02:00
Max Wipfli
af0b483123 LibWeb: VERIFY an empty builder when emitting tokens in HTMLTokenizer 2021-07-15 00:48:45 +02:00
Timothy Flynn
1a3e1bff7b LibJS: Implement Atomics.isLockFree 2021-07-14 22:13:15 +01:00
Timothy Flynn
d9c2447999 AK: Add free function to wrap around __atomic_is_lock_free built-in
Note: this exact implementation is needed for __atomic_is_lock_free to
link with both GCC (for the SerenityOS build) and Clang (for the Fuzzer
build). The size argument must be a compile-time constant, otherwise it
fails to link with both compilers. Alternatively, the following
definition links with GCC but fails with Clang:

    template<size_t S>
    static inline bool atomic_is_lock_free(volatile void* ptr = nullptr)
    {
        return __atomic_is_lock_free(S, ptr);
    }
2021-07-14 22:13:15 +01:00
Timothy Flynn
33eb830929 LibJS: Implement Atomics.compareExchange 2021-07-14 22:13:15 +01:00
Timothy Flynn
655ffce64d LibJS: Implement Atomics.exchange 2021-07-14 22:13:15 +01:00
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