Commit graph

33640 commits

Author SHA1 Message Date
Timothy Flynn
a120e85596 LibJS: Provide public access to list of sanctioned unit identifiers 2022-01-31 00:32:41 +00:00
Timothy Flynn
98348d9a33 LibJS: Allow calling Array::create_from without allocating a Vector
This method works as-is with a Span instead of a Vector (with some minor
const correctness adjustments).
2022-01-31 00:32:41 +00:00
Timothy Flynn
2e1db1b090 LibTimeZone: Use new generator util to generate all time zones
Added the call to generate_available_values(), then realized it is the
exact same as the existing, manually written implementation. So let's
use the new utility.
2022-01-31 00:32:41 +00:00
Timothy Flynn
bb0f548614 LibUnicode: Generate a list of available currencies 2022-01-31 00:32:41 +00:00
Timothy Flynn
481ced53d8 LibUnicode: Generate a list of available numbering systems 2022-01-31 00:32:41 +00:00
Timothy Flynn
ebd33e580b LibUnicode: Generate a list of available calendars 2022-01-31 00:32:41 +00:00
Jelle Raaijmakers
48eecaad64 LibGUI: Remove Window background color
The `m_background_color` field was not used anywhere. Both `Terminal`
and the `ColorPicker` widget invoked `set_background_color()` to no
avail.
2022-01-31 00:38:15 +01:00
Timothy Flynn
687276fc38 LibJS: Implement ECMA-402 BigInt.prototype.toLocaleString 2022-01-30 20:05:27 +00:00
Timothy Flynn
d6e926e5b1 LibJS: Support BigInt number formatting with Intl.NumberFormat 2022-01-30 20:05:27 +00:00
Timothy Flynn
a0253af8c1 LibJS: Generalize Intl.NumberFormat to operate on Value types
Intl.NumberFormat is meant to format both Number and BigInt types. To
prepare for formatting BigInt types, this generalizes our NumberFormat
implementation to operate on Value instances rather than doubles. All
arithmetic is moved to static helpers that can now be updated with
BigInt semantics.
2022-01-30 20:05:27 +00:00
Idan Horowitz
4ba4e4c777 LibJS: Implement Intl %SegmentsPrototype%[@@iterator] 2022-01-30 19:47:01 +00:00
Idan Horowitz
6c26a02aa8 LibJS: Start implementing Intl Segment Iterator objects 2022-01-30 19:47:01 +00:00
Idan Horowitz
9802b16298 js: Implement pretty-printing of Intl Segments objects 2022-01-30 19:47:01 +00:00
Idan Horowitz
9001a8cbe1 LibJS: Implement Intl.Segmenter.prototype.segment 2022-01-30 19:47:01 +00:00
Idan Horowitz
bbacea255f LibJS: Start implementing Intl Segments objects 2022-01-30 19:47:01 +00:00
Idan Horowitz
891dfd9cbb LibJS: Implement Intl.Segmenter.prototype.resolvedOptions 2022-01-30 19:47:01 +00:00
Idan Horowitz
6b8dfefc20 LibJS: Implement Intl.Segmenter.supportedLocalesOf 2022-01-30 19:47:01 +00:00
Idan Horowitz
7cf3f11815 js: Implement pretty-printing of Intl.Segmenter 2022-01-30 19:47:01 +00:00
Idan Horowitz
a3bc06bb23 LibJS: Start implementing Intl.Segmenter 2022-01-30 19:47:01 +00:00
Liav A
88c5992e0b Kernel/Interrupts: Initialize two spurious handlers when PIC is disabled
Even if the PIC was disabled it can still generate noise (spurious IRQs)
so we need to register two handlers for handling such cases.

Also, we declare interrupt service routine offset 0x20 to 0x2f as
reserved, so when the PIC is disabled, we can handle spurious IRQs from
the PIC at separate handlers.
2022-01-30 21:07:20 +02:00
Liav A
7028a64997 Kernel: Use a constexpr declaration for the disabled PIC IRQ base 2022-01-30 21:07:20 +02:00
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