Commit graph

33769 commits

Author SHA1 Message Date
Linus Groh
ab976667c4 Ports: Update Python to 3.10.2
Released on 2022-01-14.
https://www.python.org/downloads/release/python-3102/
2022-01-30 17:40:39 +00:00
davidot
6b5c882af3 LibJS: Add support for JSON modules
We now have one supported assertion: 'type' if that is 'json' we attempt
to parse the module as JSON.
2022-01-30 17:40:20 +00:00
davidot
202de6ed25 LibJS: Expose JSON.parse as an intrinsic value of the global object
This will allow us to safely call it if we need to parse JSON within
LibJS.
2022-01-30 17:40:20 +00:00
davidot
f568939568 LibJS: Implement the import assertions proposal
The hard part of parsing them in import statements and calls was already
done so this is just removing some check which threw before on
assertions. And filtering the assertions based on the result of a new
host hook.
2022-01-30 17:40:20 +00:00
davidot
e0e4ead2c8 LibJS: Follow the spec with storing im- and export entries
Because we can have arbitrary in- and export names with strings we can
have '*' and '' which means using '*' as an indicating namespace imports
failed / behaved incorrectly for string imports '*'.
We now use more specific types to indicate these special states instead
of these 'magic' string values.

Do note that 'default' is not actually a magic string value but one
specified by the spec. And you can in fact export the default value by
doing: `export { 1 as default }`.
2022-01-30 17:40:20 +00:00
Daniel Bertalan
8473f6caee AK+Tests: Make null strings compare less than non-null strings
This behavior regressed in ca58c71faa.

Fixes #12213
2022-01-30 17:23:02 +00:00
Tobias Christiansen
3bb580ba1d Base: Add hieroglyph characters that have transliterations to Pebbleton
All the glyphs that have a 'transliterated as' comment in the unicode
document at https://unicode.org/charts/PDF/U13000.pdf have been added.

The following codepoints now have glyphs in the font:
U+1308B: EGYPTIAN HIEROGLYPH D021
U+1309D: EGYPTIAN HIEROGLYPH D036
U+130A7: EGYPTIAN HIEROGLYPH D046
U+130C0: EGYPTIAN HIEROGLYPH D058
U+13121: EGYPTIAN HIEROGLYPH F032
U+1313F: EGYPTIAN HIEROGLYPH G001
U+13153: EGYPTIAN HIEROGLYPH G017
U+13171: EGYPTIAN HIEROGLYPH G034
U+13191: EGYPTIAN HIEROGLYPH I009
U+13193: EGYPTIAN HIEROGLYPH I010
U+131CB: EGYPTIAN HIEROGLYPH M017
U+1320E: EGYPTIAN HIEROGLYPH N029
U+13216: EGYPTIAN HIEROGLYPH N035
U+13219: EGYPTIAN HIEROGLYPH N037
U+13254: EGYPTIAN HIEROGLYPH O004
U+13283: EGYPTIAN HIEROGLYPH O034
U+132AA: EGYPTIAN HIEROGLYPH Q003
U+132F4: EGYPTIAN HIEROGLYPH S029
U+1337F: EGYPTIAN HIEROGLYPH V013
U+1339B: EGYPTIAN HIEROGLYPH V028
U+133A1: EGYPTIAN HIEROGLYPH V031
U+133BC: EGYPTIAN HIEROGLYPH W011
U+133CF: EGYPTIAN HIEROGLYPH X001
U+133ED: EGYPTIAN HIEROGLYPH Z004
U+133EE: EGYPTIAN HIEROGLYPH Z004A
U+1340D: EGYPTIAN HIEROGLYPH AA001
2022-01-30 15:30:53 +00:00
Andreas Kling
cc9ed31c37 Kernel: Don't mark current thread as inactive after successful exec()
At the end of sys$execve(), we perform a context switch from the old
executable into the new executable.

However, the Kernel::Thread object we are switching to is the *same*
thread as the one we are switching from. So we must not assume the
from_thread and to_thread are different threads.

We had a bug caused by this misconception, where the "from" thread would
always get marked as "inactive" when switching to a new thread.
This meant that threads would always get switched into "inactive" mode
on first context switch into them.

If a thread then tried blocking on a kernel mutex within its first time
slice, we'd end up in Thread::block(Mutex&) with an inactive thread.

Once a thread is inactive, the scheduler believes it's okay to
reactivate the thread (by scheduling it.) If a thread got re-scheduled
prematurely while setting up a mutex block, things would fall apart and
we'd crash in Thread::block() due to the thread state being "Runnable"
instead of the expected "Running".
2022-01-30 16:21:59 +01:00
Andreas Kling
a44316fa8b Kernel: Release page directory and MM locks sooner in space finalization
We don't need to hold these locks when tearing down the region tree.
Release them as soon as unmapping is finished.
2022-01-30 16:21:59 +01:00
Andreas Kling
fcd3844da6 Kernel: Take scheduler lock before block lock in unblock_from_mutex()
This matches the acquisition order used elsewhere.
2022-01-30 16:21:59 +01:00
Andreas Kling
cffcfca80a Kernel: Remove unused bool return values from scheduler functions
Turns out nobody actually cared whether the scheduler switched to a new
thread or not (which is what we were returning.)
2022-01-30 16:21:59 +01:00
Andreas Kling
a6b5065d94 Kernel: Simplify x86 IOPL sanity check
Move this architecture-specific sanity check (IOPL must be 0) out of
Scheduler and into the x86 enter_thread_context(). Also do this for
every thread and not just userspace ones.
2022-01-30 16:21:59 +01:00
Andreas Kling
684d5eed19 Kernel: VERIFY that Scheduler::context_switch() always has a from-thread
We always context_switch() from somewhere, so there's no need to handle
the case where from_thread is null.
2022-01-30 16:21:59 +01:00
Andreas Kling
09f0843716 Kernel: Enforce that Thread::unblock_from_mutex() doesn't happen in IRQ
Mutexes are not usable from IRQ handlers, so unblock_from_mutex()
can simply VERIFY() that the current processor is not in an IRQ.
2022-01-30 16:21:59 +01:00
Andreas Kling
b0e5406ae2 Kernel: Update terminology around Thread's "blocking mutex"
It's more accurate to say that we're blocking on a mutex, rather than
blocking on a lock. The previous terminology made sense when this code
was using something called Kernel::Lock, but since it was renamed to
Kernel::Mutex, this updates brings the language back in sync.
2022-01-30 16:21:59 +01:00
Andreas Kling
dca5fe69eb Kernel: Make Thread::State an enum class and use it consistently
It was annoyingly hard to spot these when we were using them with
different amounts of qualification everywhere.

This patch uses Thread::State::Foo everywhere instead of Thread::Foo
or just Foo.
2022-01-30 16:21:59 +01:00
Andreas Kling
7d89409618 Kernel: Don't dispatch signals in Thread::block_impl()
If the blocker is interrupted by a signal, that signal will be delivered
to the process when returning to userspace (at the syscall exit point.)
We don't have to perform the dispatch manually in Thread::block_impl().
2022-01-30 16:21:59 +01:00
Andreas Kling
677da0288c Kernel: Don't dispatch signals in Processor::enter_current()
Signal dispatch is already taken care of elsewhere, so there appears to
be no need for the hack in enter_current().

This also allows us to remove the Thread::m_in_block flag, simplifying
thread blocking logic somewhat.

Verified with the original repro for #4336 which this was meant to fix.
2022-01-30 16:21:59 +01:00
Andreas Kling
3845c90e08 Kernel: Remove unnecessary includes from Thread.h
...and deal with the fallout by adding missing includes everywhere.
2022-01-30 16:21:59 +01:00
Andreas Kling
f469fb47b8 Kernel: Move Thread::block<BlockerType>() out of the Thread.h header
This function is large and unwieldy and forces Thread.h to #include
a bunch of things. The only reason it was in the header is because we
need to instantiate a blocker based on the templated BlockerType.

We actually keep block<BlockerType>() in the header, but move the
bulk of the function body out of line into Thread::block_impl().

To preserve destructor ordering, we add Blocker::finalize() which is
called where we'd previously destroy the Blocker.
2022-01-30 16:21:59 +01:00
Andreas Kling
79ee846f3d AK: Disable the empty-string-vs-null-string test until we have a fix 2022-01-30 16:21:59 +01:00
networkException
f49948cc48 LibGUI: Collect menu and submenu actions for CommandPalette
We now not only collect actions that are children of windows but also
all actions that are part of a window's menus and submenus :^)
2022-01-30 15:24:35 +01:00
networkException
3a50ab3f4c LibGUI: Increase the width of a CommandPalette dialog 2022-01-30 15:24:35 +01:00
networkException
4af973fec6 LibGUI: Add Menu column to CommandPalette :^)
This patch adds a new column to CommandPalette showing the menu an
action is part of
2022-01-30 15:24:35 +01:00
networkException
1921a166e5 Tests: Add test for null string and empty string to be unequal
See #12213
2022-01-30 15:24:35 +01:00
Jelle Raaijmakers
98d666eab3 Kernel: Support PS/2 right super key
We currently support the left super key. This poses an issue on
keyboards that only have a right super key, such as my Steelseries 6G.

The implementation mirrors the left/right shift key logic and
effectively considers the right super key identical to the left one.
2022-01-30 15:08:49 +01:00
bugreport0
c20f1e06c0 LibGUI: Flash menubar when using command palette 2022-01-30 01:32:20 +01:00
networkException
048ed64c26 LibGUI: Allow CommandPalette to distinguish radio buttons and checkboxes 2022-01-30 01:27:14 +01:00
Idan Horowitz
fe687412a6 LibJS: Visit m_async_from_sync_iterator_prototype in GlobalObject
This prevents random crashes in for async loops due to GC.
2022-01-29 22:35:43 +00:00
Timothy Flynn
3b2ec01038 LibJS: Update spec numbers for ECMA-402
Intl.Segmenter is now section 18; bump the "Locale Sensitive Functions".
2022-01-29 22:23:25 +00:00
Daniel Bertalan
5b64abe76e Shell: Use StringView instead of String const& where feasible 2022-01-29 23:08:27 +01:00
Daniel Bertalan
1a4aad9b7e AK: Implement String's comparison operators in terms of StringView's 2022-01-29 23:08:27 +01:00
Daniel Bertalan
5b3ba2d9ad AK: Implement FlyString's comparison operators in terms of StringView's 2022-01-29 23:08:27 +01:00
Daniel Bertalan
ca58c71faa AK: Implement all comparison operators for StringView 2022-01-29 23:08:27 +01:00
Idan Horowitz
2e5a9b4fab Kernel: Use HashCompatible HashMap lookups instead of specifying a hash 2022-01-29 23:01:23 +02:00
Idan Horowitz
c68609b27f Kernel: Make {Nonnull,}OwnPtr<KString> hash compatible with StringView
This will allow us to use KString as HashTable/HashMap keys more easily
2022-01-29 23:01:23 +02:00
Idan Horowitz
9b0d90a71d AK: Support using custom comparison operations for hash compatible keys 2022-01-29 23:01:23 +02:00
Timothy Flynn
4a99170cd2 LibJS: Implement Intl.Collator.prototype.resolvedOptions 2022-01-29 20:27:24 +00:00
Timothy Flynn
17306078b5 LibJS: Implement Intl.Collator.supportedLocalesOf 2022-01-29 20:27:24 +00:00
Timothy Flynn
5a1eefcc1d js: Implement pretty-printing of Intl.Collator 2022-01-29 20:27:24 +00:00
Timothy Flynn
06a6100b12 LibJS: Implement the Intl.Collator constructor 2022-01-29 20:27:24 +00:00
Timothy Flynn
1607a05d4c LibJS: Add co, kf, and kn Unicode locale keywords to ResolveLocale 2022-01-29 20:27:24 +00:00
Timothy Flynn
4a3e142d55 LibJS: Implement a nearly empty Intl.Collator object
This adds plumbing for the Intl.Collator object, constructor, and
prototype.
2022-01-29 20:27:24 +00:00
Timothy Flynn
4d43aeae30 LibUnicode: Fill in case-first and numeric BCP47 keywords
Unlike other BCP47 keywords that we are parsing, these only appear in
the BCP47 XML file itself within the CLDR. The values are very simple
though, so just hard code them until the Unicode org re-releases the
CLDR with BCP47: https://unicode-org.atlassian.net/browse/CLDR-15158
2022-01-29 20:27:24 +00:00
Lady Gegga
2ad38102f5 Base: Add Osage to font Katica Regular 10
104B0-104FB https://www.unicode.org/charts/PDF/U104B0.pdf
2022-01-29 19:57:45 +00:00
Dmitry Petrov
2616b61eee WebContent: Switch scroll direction on shift modifier 2022-01-29 21:48:57 +02:00
Lenny Maiorani
b0a54518d8 Everywhere: Remove redundant inline keyword
`constexpr` implies `inline` so when both are used it is redundant.
2022-01-29 21:45:17 +02:00
Idan Horowitz
e28af4a2fc Kernel: Stop using HashMap in Mutex
This commit removes the usage of HashMap in Mutex, thereby making Mutex
be allocation-free.

In order to achieve this several simplifications were made to Mutex,
removing unused code-paths and extra VERIFYs:
 * We no longer support 'upgrading' a shared lock holder to an
   exclusive holder when it is the only shared holder and it did not
   unlock the lock before relocking it as exclusive. NOTE: Unlike the
   rest of these changes, this scenario is not VERIFY-able in an
   allocation-free way, as a result the new LOCK_SHARED_UPGRADE_DEBUG
   debug flag was added, this flag lets Mutex allocate in order to
   detect such cases when debugging a deadlock.
 * We no longer support checking if a Mutex is locked by the current
   thread when the Mutex was not locked exclusively, the shared version
   of this check was not used anywhere.
 * We no longer support force unlocking/relocking a Mutex if the Mutex
   was not locked exclusively, the shared version of these functions
   was not used anywhere.
2022-01-29 16:45:39 +01:00
Pankaj Raghav
60aa4152e9 Kernel: Optimize StorageDevice read and write function
Use shift operator with log size instead of division while calculating
the index and len.
2022-01-29 17:41:06 +02:00
Pankaj Raghav
24c66b8442 AK: Fix log2 calculation for Integer
For a `N` bit integer X, the log2 calculation should be as follows:
(N - 1) - ctz(X)
2022-01-29 17:41:06 +02:00