Commit Graph

25204 Commits

Author SHA1 Message Date
Linus Groh
4b22d0f2ce LibJS: Implement Temporal.ZonedDateTime.prototype.microsecond 2021-08-05 19:19:40 +02:00
Linus Groh
752b3eb0c0 LibJS: Implement Temporal.ZonedDateTime.prototype.millisecond 2021-08-05 19:19:40 +02:00
Linus Groh
9d9ab492df LibJS: Implement Temporal.ZonedDateTime.prototype.second 2021-08-05 19:19:40 +02:00
Linus Groh
a6775517ad LibJS: Implement Temporal.ZonedDateTime.prototype.minute 2021-08-05 19:19:40 +02:00
Linus Groh
32f1e17e71 LibJS: Implement Temporal.ZonedDateTime.prototype.hour 2021-08-05 19:19:40 +02:00
Linus Groh
0580f102e4 LibJS: Implement Temporal.ZonedDateTime.prototype.day 2021-08-05 19:19:40 +02:00
Linus Groh
30e27f6483 LibJS: Implement Temporal.ZonedDateTime.prototype.monthCode 2021-08-05 19:19:40 +02:00
Linus Groh
fd18dc782f LibJS: Implement Temporal.ZonedDateTime.prototype.month 2021-08-05 19:19:40 +02:00
Linus Groh
b8ac31500c LibJS: Implement Temporal.ZonedDateTime.prototype.year 2021-08-05 19:19:40 +02:00
Linus Groh
e036f4a786 LibJS: Make regulate_iso_date() and iso_date_from_fields() use ISODate
No need for TemporalDate, we don't use the calendar field here anyway.
2021-08-05 19:19:40 +02:00
Andreas Kling
dd58d0f650 Kernel: Uncommit a shared COW page when discovering it was unshared
When we hit a COW fault and discover than no other process is sharing
the physical page, we simply remap it r/w and save ourselves the
trouble. When this happens, we can also give back (uncommit) one of our
shared committed COW pages, since we won't be needing it.

We had this optimization before, but I mistakenly removed it in
50472fd69f since I had misunderstood
it to be the reason for a panic.
2021-08-05 17:41:58 +02:00
Andreas Kling
843d0d0d15 Kernel: Detach AnonymousVMObject from shared COW pages set once emptied
We currently overcommit for COW when forking a process and cloning its
memory regions. Both the parent and child process share a set of.
committed COW pages.

If there's COW sharing across more than two processeses within a lineage
(e.g parent, child & grandchild), it's possible to exhaust these pages.
When the shared set is emptied, the next COW fault in each process must
detach from the shared set and fall back to on demand allocation.

This patch makes sure that we detach from the shared set once we
discover it to be empty (during COW fault handling). This fixes an issue
where we'd try to allocate from an exhausted shared set while building
GNU binutils inside SerenityOS.
2021-08-05 17:41:58 +02:00
Andreas Kling
89a9ae7d0c Kernel: Handle AnonymousVMObject allocation failure when forking
Thanks to all the RAII, AnonymousVMObject::try_clone() can now
gracefully handle allocation failure.
2021-08-05 17:41:58 +02:00
Andreas Kling
0672163840 Kernel: Simplify AnonymousVMObject copy constructor
It was doing a bunch of things it didn't need to do. I think we had
misunderstood the base class as having copied m_lock in its copy
constructor but it's actually default initialized.
2021-08-05 17:41:58 +02:00
Andreas Kling
fa627c1eb2 Kernel: Use RAII to manage committed physical pages
We had issues with committed physical pages getting miscounted in some
situations, and instead of figuring out what was going wrong and making
sure all the commits had matching uncommits, this patch makes the
problem go away by adding an RAII class to manage this instead. :^)

MemoryManager::commit_user_physical_pages() now returns an (optional)
CommittedPhysicalPageSet. You can then allocate pages from the page set
by calling take_one() on it. Any unallocated pages are uncommitted upon
destruction of the page set.
2021-08-05 17:41:58 +02:00
Andreas Kling
ec49213f7b Kernel: Add MemoryManager to Forward.h 2021-08-05 17:41:58 +02:00
Jamie Mansfield
506363c08d Solitaire: Clear selection when starting new game
Fixes #9218.
2021-08-05 12:52:33 +02:00
Jamie Mansfield
22aeec1218 Spider: Clear selection when starting new game
Fixes #9217.
2021-08-05 12:52:33 +02:00
Karol Kosek
64ca51265d Assistant: Quit the application after losing focus
Prior to this change, Assistant would just stay in the background,
unless one pressed an Escape key or launched some app.
2021-08-05 11:43:12 +02:00
Karol Kosek
ac21c6625d LibGUI: Add on_active_window_change function object to the Window class 2021-08-05 11:43:12 +02:00
brapru
a037e0ffec Utilities: Improve the arp information output
This updates the arp command to use output styles similar to other
utilities.
2021-08-05 09:30:35 +02:00
brapru
3bd6905ea8 Utilities: Add pledge and unveil protections in arp 2021-08-05 09:30:35 +02:00
Gunnar Beutner
d9d2287a11 Meta: Detect nested KVM support for WSL2 and use that when available
This allows running QEMU inside WSL2 for hosts which have nested KVM
and WSLg support (e.g. Windows 11).

Running QEMU inside the WSL2 VM is slightly slower than running QEMU
on Windows, probably because of how WSLg handles screen updates.
2021-08-04 21:15:41 +02:00
Gunnar Beutner
723c89af67 Meta: Automatically enable WHPX when possible 2021-08-04 21:15:41 +02:00
Gunnar Beutner
5445155dba Meta: Auto-detect where QEMU is installed on Windows 2021-08-04 21:15:41 +02:00
Idan Horowitz
ffee3d6c5d Kernel: Remove the always 1-sized super physical regions Vector
Since we only ever add 1 super physical region, theres no reason to
add the extra redirection and allocation that comes with a dynamically
sized Vector.
2021-08-04 21:02:40 +02:00
Luke
cbbbc38f27 Kernel: Print panic backtrace to both the screen and serial
Previously it would only print the backtrace to serial, which would be
inaccessible if you don't have serial setup.
2021-08-04 20:14:54 +02:00
Liav A
7c617394a1 Kernel: Ensure we read valid values from the RTC CMOS registers
We try to read twice from the RTC CMOS registers, and if the values are
not the same for 5 attempts, we know there's a malfunction with the
hardware so we declare these values as bogus in the kernel log.
2021-08-04 19:53:04 +02:00
Liav A
517460d3a9 Kernel: Ensure we don't get in an endless loop while querying the CMOS
When we try to query the time from the RTC CMOS, we try to check if
the CMOS is updated. If it is updated for a long period of time (as a
result of hardware malfunction), break the loop and return Unix epoch
time.
2021-08-04 19:53:04 +02:00
Sam Atkins
74c9587798 LibWeb: Fix EOF handling in CSS Tokenizer peek_{twin,triplet}()
Previously, the loops would stop before reaching EOF, meaning that the
values that should have been set to EOF were left with their 0 initial
values. Now, we initialize to EOFs instead. The if/else inside the loops
always ran the else branch so I have removed the if branches.
2021-08-04 19:04:12 +04:30
Jelle Raaijmakers
31e3b3028b Documentation: Add ImageMagick as dependency for macOS 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
d2379dfe96 Ports: Add PHP entry to taskbar menu 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
a76c208bae Ports: Support icons for launchers with arguments 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
1a4b1ecd04 LibDesktop: Add support for IconPath in AppFile
With `IconPath`, you can override the icon used for the application
shortcut. This currently only supports resolving the icon through
`GUI::FileIconProvider`, the implementation for pointing to actual
image files is left as an exercise for the reader.
2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
0ec39aafb6 LibDesktop: Collapse if-else in AppFile 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
c7e72a52a3 Taskbar: Use provided AppFile icon instead of finding it ourselves 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
8493477cc7 Ports: Convert only first index of ico files
When installing an icon, we fall back to a resizing strategy when an
exact match on the image dimensions is missing. However, if we are
dealing with an `.ico` file with multiple indices, `convert` will
resize every separate index and will create multiple files.

This changes makes sure we only resize the first index. A future
improvement could be to select an index most closely matching the
requested dimensions.
2021-08-04 13:54:08 +01:00
Jelle Raaijmakers
546af2d9ef Ports: Notify user of missing ImageMagick binaries 2021-08-04 13:54:08 +01:00
Timothy Flynn
6f2640d031 LibUnicode: Parse UCD DerivedBinaryProperties.txt and generate property 2021-08-04 13:50:32 +01:00
Timothy Flynn
9113f892a7 LibUnicode: Parse UCD emoji-data.txt and generate Unicode property 2021-08-04 13:50:32 +01:00
Timothy Flynn
484ccfadc3 LibRegex: Support property escapes of Unicode script extensions 2021-08-04 13:50:32 +01:00
Timothy Flynn
5edd458420 LibUnicode: Parse UCD ScriptExtensions.txt and generate property 2021-08-04 13:50:32 +01:00
Timothy Flynn
6bdb19fe21 LibUnicode: Remove unused parameter from Unicode data generator 2021-08-04 13:50:32 +01:00
Timothy Flynn
06088df729 LibRegex: Support property escapes of the Unicode script property
Note that unlike binary properties and general categories, scripts must
be specified in the non-binary (Script=Value) form.
2021-08-04 13:50:32 +01:00
Timothy Flynn
f5c1bbc00b LibUnicode: Parse UCD Scripts.txt and generate as a Unicode property
There are a couple of minor nuances with parsing script values, compared
to other properties. In Scripts.txt, the UCD file lists the full name of
each script; other properties, like General Category, list the shorter
name in their primary files. This means that the aliases listed in
PropertyValueAliases.txt are reversed for script values.
2021-08-04 13:50:32 +01:00
kleines Filmröllchen
619c924042 AudioWidget: Proper volume changes when scrolling on the widget
Because setting the slider's value in the mousewheel handler will cause
the volume logarithm logic and the volume setting to happen anyways, we
don't need to do it in the mousewheel handler again. By just moving the
slider up and down with the scroll wheel, we mimic normal SliderWidget
behavior that doesn't exhibit the multiple previous bugs.
2021-08-04 11:36:36 +02:00
Timothy Flynn
1bb6404a19 LibUnicode: Invoke Unicode data generator a single time
It takes a non-neglible amount of time to parse all of the UCD files and
generate the Unicode data files. To help compile times, only invoke the
generator once.
2021-08-04 11:18:24 +02:00
Timothy Flynn
9413c3a0d1 LibUnicode: Generate a map of code points to their Unicode table index
The current strategy of searching for a code point within the generated
table is slow for code points > U+0377 (the last code point whose index
is the same value as the code point itself). For larger code points, we
are doing a linear search through the table.

Instead, generate a HashMap of each code point to its entry in the table
for faster runtime lookups.

This had the added benefit of being able to remove a fair amount of code
from the generator. We no longer need to track that last contiguous code
point (U+0377) nor each code point's index in the generated table.
2021-08-04 11:18:24 +02:00
Timothy Flynn
70080feab2 AK+LibJS: Implement String.from{CharCode,CodePoint} using UTF-16 strings
Most of String.prototype and RegExp.prototype is implemented with UTF-16
so this is to prevent extra copying of the string data.
2021-08-04 11:18:24 +02:00
Timothy Flynn
b6ff7f4fcc LibJS: Allow PrimitiveString to be created with a UTF-16 string
PrimitiveString may currently only be created with a UTF-8 string, and
it transcodes on the fly when a UTF-16 string is needed. Allow creating
a PrimitiveString from a UTF-16 string to avoid unnecessary transcoding
when the caller only wants UTF-16.
2021-08-04 11:18:24 +02:00