Commit graph

23889 commits

Author SHA1 Message Date
Ali Mohammad Pur
65355c388b LibWasm: Use AK::StackInfo to track stack size
This way, we can make sure that it doesn't overflow when ASAN is
enabled.
2021-07-12 18:42:45 +04:30
Andrew Kaster
8ae425cec8 Meta+CI: Use wabt version 1.0.23 for all CI jobs
The WASM spec tests caused a stack overflow when generated with wat2wasm
version 1.0.23, which ships with homebrew. To give feature parity,
manually download the same version from GitHub packages for Ubuntu.

Document the dependencies of the WASM spec tests option, as well.
2021-07-12 18:42:45 +04:30
Andrew Kaster
f7c7954314 LibCore: Tolerate misaligned addresses in struct hostent
macOS's C library is not a good neighbor and doesn't ensure that
the entry in struct hostent's h_addr_list are aligned properly for
a char const*. In Socket::connect, use ByteReader instead of a c-style
cast to work around this possible misalignment.
2021-07-12 18:42:45 +04:30
Andrew Kaster
fac4eab415 AK: Add load64 and load_pointer to AK::ByteReader
This lets us load misaligned 64 bit integers, and misaligned pointers
in a platform agnostic way.
2021-07-12 18:42:45 +04:30
Brandon van Houten
19d34414bc Utilities: Make less accept 'page up' and 'page down' keys 2021-07-12 16:10:01 +02:00
Karol Kosek
f99507bf02 LibGUI: Ignore drop events by default
Before this change, parent widgets such as Buttons or Labels
were stealing drop events their parents.

I noticed it during drag-n-dropping files into visualization widgets
in Sound Player (which takes practically the entire application size
and gave impression that drop events weren't supported in the app
at all).
2021-07-12 15:59:33 +02:00
LuK1337
d940f7ba4f LibGUI: Use wrapped text rect for paint invalidation
This fixes an issue where after anything past first line would not get
invalidated after unhovering an icon.
2021-07-12 15:59:16 +02:00
Gunnar Beutner
4db286e63f Documentation: Condense the Windows build instructions some more 2021-07-12 12:28:01 +02:00
Gunnar Beutner
0da89376b7 Documentation: Remove obsolete CMake option 2021-07-12 12:28:01 +02:00
Gunnar Beutner
1f229b45a9 Documentation: Show users how to build specific ninja targets directly 2021-07-12 12:28:01 +02:00
Gunnar Beutner
7f6e148e17 Documentation: Shuffle around systems in the build instruction docs
The crowd has spoken and it's clear they want... Windows and Arch Linux.
2021-07-12 12:28:01 +02:00
Gunnar Beutner
cbdc7f9e41 UserspaceEmulator: Fix stack for new processes
Fixes #8646.
2021-07-12 12:27:13 +02:00
Andrew Kaster
1455604b13 AK+Meta: Remove unused AUTOCOMPLETE_DEBUG flag 2021-07-12 12:26:52 +02:00
Andrew Kaster
ca920ba082 Meta+Documentation: Remove unused -DDEBUG from build 2021-07-12 12:26:52 +02:00
Andrew Kaster
f26d4e1d90 IPCCompiler: Use GENERATE_DEBUG from AK/Debug instead of custom defines
The IPCCompiler was using GENERATE_DEBUG_CODE, which was missing from
AK/Debug.h.in, and plain old DEBUG. Let's just use the one that
was already in the debug header, but unused.
2021-07-12 12:26:52 +02:00
Andrew Kaster
6ba87a6b5e LibC: Use correct macro to disable assert()
The C standard doesn't say anything about DEBUG, just NDEBUG :^)
2021-07-12 12:26:52 +02:00
Karol Kosek
67e3daa679 Breakout: Only paint areas that needs to be updated 2021-07-12 12:26:15 +02:00
Andreas Kling
2e3df52862 Revert "LibThreading: Fix BackgroundAction result use-after-free"
This reverts commit b2e6088bff.

This was a speculative fix that ended up not fixing the issue.
2021-07-12 11:29:37 +02:00
Tom
026ffa343d Kernel: Allow Lock to block from BlockCondition
This enables the Lock class to block a thread even while the thread is
working on a BlockCondition. A thread can still only be either blocked
by a Lock or a BlockCondition.

This also establishes a linked list of threads that are blocked by a
Lock and unblocking directly unlocks threads and wakes them directly.
2021-07-12 11:27:18 +02:00
Tom
d9fb93c5ce Kernel: Fix deadlock cancelling timer
It's possible that a timer may have been queued to be executed by
the timer irq handler, but if we're in a critical section on the
same processor and are trying to cancel that timer, we would spin
forever waiting for it to be executed.
2021-07-12 11:27:18 +02:00
Tom
6938be00f1 Kernel: Initialize threading and process management earlier
This re-arranges the order of how things are initialized so that we
try to initialize process and thread management earlier. This is
neccessary because a lot of the code uses the Lock class, which really
needs to have a running scheduler in place so that we can properly
preempt.

This also enables us to potentially initialize some things in parallel.
2021-07-12 11:27:18 +02:00
Andreas Kling
c2792212f4 Kernel: Remove "supervisor" bit from PhysicalPage
Instead of each PhysicalPage knowing whether it comes from the
supervisor pages or from the user pages, we can just check in both
sets when freeing a page.

It's just a handful of pointer range checks, nothing expensive.
2021-07-12 11:09:42 +02:00
LuK1337
ac78f1e812 TaskbarWindow: Redraw start button when default font changes 2021-07-12 11:08:09 +02:00
LuK1337
8992271c5c LibGUI: Redraw widgets when default font changes 2021-07-12 11:08:09 +02:00
LuK1337
b40d771512 LibGUI: Add FontsChanged event and deliver it to windows and widgets 2021-07-12 11:08:09 +02:00
Tom
9318d9f284 Kernel: Fix allocating VMObject from page array
The VMObject constructor takes the size in bytes.

Fixes #8670
2021-07-12 10:45:53 +02:00
Brian Gianforcaro
84b4b9447d Kernel: Move new process registration out of Space spinlock scope
There appears to be no reason why the process registration needs
to happen under the space spin lock. As the first thread is not started
yet it should be completely uncontested, but it's still bad practice.
2021-07-12 10:20:21 +02:00
Tom
60a559af7e Kernel: Avoid unnecessary context switch when no other thread is ready
If no other thread is ready to be run we don't need to switch to the
idle thread and wait for the next timer interrupt. We can just give
the thread another timeslice and keep it running.
2021-07-12 10:19:31 +02:00
Maurice Hieronymus
dfc33cd412 HackStudio: Disable debug specific context entries
Context menu entries like evaluate expression and
move execution to line action should only be enabled
when a debug session is running. Otherwise they should
be disabled.
2021-07-12 00:47:04 +02:00
Maurice Hieronymus
488d0722bd HackStudio: Disable run button while debugging
This commit disables the run button while we
are in debug mode. Otherwise the stop button
gets disabled when we run the program while
we are in debug mode. This would prevent us
from exiting the debug mode.
2021-07-12 00:47:04 +02:00
Gunnar Beutner
7d38057705 Meta: Only use -display sdl for multiple screens when it's available 2021-07-11 23:27:43 +02:00
Sam Atkins
86994336a7 LibWeb: Correct parsing invalid list of declarations
We were only discarding at most one token when a declaration is
invalid, when we should discard all until we see a ; or EOF.
2021-07-11 23:19:56 +02:00
Sam Atkins
c249fbd17c LibWeb: Correct escape handling in CSS Tokenizer
Calling is_valid_escape_sequence() with no arguments hides what it
is operating on, so I have removed that, so that you must explicitly
tell it what you are testing.

The call from consume_a_token() was using the wrong tokens, so it
returned false incorrectly. This was resulting in corrupted output
when faced with this code from Acid2. (Abbreviated)

```css
.parser { error: \}; }
.parser { }
```
2021-07-11 23:19:56 +02:00
Sam Atkins
e381ca258f LibWeb: Add more logging to CSS parser 2021-07-11 23:19:56 +02:00
Sam Atkins
9cfbc07c24 LibWeb: Implement CSS::Parse::parse_nth_child_pattern()
This is a modified copy of the code from Selector.cpp, to work on a
TokenStream instead of a String.
2021-07-11 23:19:56 +02:00
Sam Atkins
cf333574ac LibWeb: Convert StyleFunctionRule.m_values to ComponentValues
The input is ComponentValues, and the output is too, so storing as
a String in the middle was inefficient and unnecessary.
2021-07-11 23:19:56 +02:00
Sam Atkins
fabc09a593 LibWeb: Increase clarity with CSS token debug logging
Had to adjust some places that were using Token.to_string() for
non-debug-logging purposes. Changed its name to to_debug_string()
to make the usage clearer.
2021-07-11 23:19:56 +02:00
Sam Atkins
e5ac5e1fab LibWeb: Fix CSS attribute and ID selector parsing
There were several crashes here from out-of-bounds memory access.
2021-07-11 23:19:56 +02:00
Sam Atkins
78d191554a LibWeb: Remove non-compliant whitespace stripping in CSS Parser 2021-07-11 23:19:56 +02:00
Sam Atkins
7e4f75c78c LibWeb: Fix whitespace handling in CSS selectors
Whitespace marks the end of a compound-selector, no matter where
it occurs. `check_for_eof_or_whitespace()` reconsumes the whitespace
token for convenience.
2021-07-11 23:19:56 +02:00
Sam Atkins
57f6d86996 LibWeb: Implement remaining CSS parse_as...() entry points 2021-07-11 23:19:56 +02:00
Sam Atkins
65fe3895e6 LibWeb: Enabling @import in new CSS parser 2021-07-11 23:19:56 +02:00
Sam Atkins
6b6bf4a0aa LibWeb: Implement CSS::parse_css_value()
A lot of this is not spec-compliant and copied from the old parser.
In future PRs, we can revise it.
2021-07-11 23:19:56 +02:00
Sam Atkins
c91c00f587 LibWeb: Remove unnecessary CSS:: namespace from CSS Parser code
It's feeling unwieldy having it everywhere.
2021-07-11 23:19:56 +02:00
Sam Atkins
28e8bb9b1d LibWeb: Convert style declarations and at rules into CSSRules 2021-07-11 23:19:56 +02:00
Sam Atkins
2c84379846 LibWeb: Add accessors to CSS::DeclarationOrAtRule 2021-07-11 23:19:56 +02:00
Sam Atkins
6d14791c40 LibWeb: Use TokenStream in CSS Parser
Each method can either be called with a TokenStream, or with no
arguments to replicate the previous behaviour.
2021-07-11 23:19:56 +02:00
Sam Atkins
b7116711bf LibWeb: Add TokenStream class to CSS Parser
The entry points for CSS parsing in the spec are defined as accepting
any of a stream of Tokens, or a stream of ComponentValues, or a String.
TokenStream is an attempt to reduce the duplication of code for that.
2021-07-11 23:19:56 +02:00
Sam Atkins
6c03123b2d LibWeb: Give CSS Token and StyleComponentValueRule matching is() funcs
The end goal here is to make the two classes mostly interchangeable, as
the CSS spec requires that the various parser algorithms can take a
stream of either class, and we want to have that functionality without
needing to duplicate all of the code.
2021-07-11 23:19:56 +02:00
Sam Atkins
9c14504bbb LibWeb: Rename CSS::Token::TokenType -> Type 2021-07-11 23:19:56 +02:00