Commit graph

23758 commits

Author SHA1 Message Date
Ali Mohammad Pur
ad328f852b AK: Replace all explicit specialisations of Traits with a single one
This commit un-confuses the many specialisations of AK::Traits, and
makes it work correctly for all integral types.
Prior to this, `AK::Traits<size_t>` would've been instantiating the
base Traits implementation, not `Traits<u32>` or `Traits<u64>`.
2021-07-12 23:49:59 +04:30
Idan Horowitz
84b028bd71 LibJS: Add Temporal.Instant.prototype.round()
As well as the required Abstract Operations.
2021-07-12 19:05:17 +01:00
Idan Horowitz
75d1ffea00 LibCrypto: Add the >= operator to UnsignedBigInteger 2021-07-12 19:05:17 +01:00
Idan Horowitz
01c731aa59 LibJS: Add the GetOptionsObject & GetOption Temporal AbstractOperations
These are used by any Temporal method that accepts an options object.
2021-07-12 19:05:17 +01:00
Idan Horowitz
2382f67e0b LibJS: Add Temporal.Instant.prototype.equals() 2021-07-12 19:05:17 +01:00
Idan Horowitz
84403ab423 LibJS: Add Temporal.Instant.from() 2021-07-12 19:05:17 +01:00
Idan Horowitz
33cf6274e8 LibJS: Add Temporal.Instant.compare() 2021-07-12 19:05:17 +01:00
Idan Horowitz
b816037739 LibJS: Add the ToTemporalInstant Abstract Operation & its requirements
This is Abstract Operation is required for the majority of
InstantConstructor's and InstantPrototype's methods.

The implementation is not entirely complete, (specifically 2 of the
underlying required abstract operations, ParseTemporalTimeZoneString
and ParseISODateTime are missing the required lexing, and as such are
TODO()-ed) but the majority of it is done.
2021-07-12 19:05:17 +01:00
Idan Horowitz
141c46feda AK: Add a DateTimeLexer
This is an AK::GenericLexer that exposes helper methods for parsing
date and time related literals (years, months, days, hours, minutes,
seconds, fractional seconds & more)
2021-07-12 19:05:17 +01:00
Idan Horowitz
39a9cf4bb4 AK: Add a retreat(count) method to GenericLexer
This method can be used to rewind a constant amount backwards in the
source instead of one by one with retract()
2021-07-12 19:05:17 +01:00
Karol Kosek
b2daaca5ee HackStudio: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
d7f0472b25 SoundPlayer: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
e7fbd48ed9 ImageViewer: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
7f418a5c6a HexEditor: Accept file drops 2021-07-12 19:50:58 +02:00
Ariel Don
4eba921d48 ls: Add option to list subdirectories recursively
List subdirectories encountered using -R or --recursive flags with ls.
2021-07-12 19:15:19 +04:30
Ariel Don
3289b6a887 LibCore: Implement File::is_link()
It was already possible to check if a path was a directory or a device.
Now, it is possible to check if a path is a link in a similar manner.
2021-07-12 19:15:19 +04:30
Andrew Kaster
8823548a4e Meta: Skip WebAssembly loop test generation
This test hangs and times out.
2021-07-12 18:42:45 +04:30
Andrew Kaster
2af591267c LibWasm: Adjust signed integer operations to avoid UB
Perform signed integer shifts, addition, subtraction, and rotations
using their corresponding unsigned type. Additionally, mod the right
hand side of shifts and rotations by the bit width of the integer per
the spec. This seems strange, but the spec is clear on the desired
wrapping behavior of arithmetic operations.
2021-07-12 18:42:45 +04:30
Ali Mohammad Pur
d74eca78aa LibWasm: Skip initializing active empty data sections 2021-07-12 18:42:45 +04:30
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