Commit graph

31207 commits

Author SHA1 Message Date
bugreport0 1a2ff38609 CrashReporter: Remove redundant pledge() 2021-12-11 23:06:56 +01:00
Hendiadyoin1 7a206868f8 Kernel: Move architecture dependent includes to the top in Processor.h
With the declaration order dependency resolved in the last two commits
we can now do this, which looks a lot nicer.
2021-12-11 13:23:27 -08:00
Hendiadyoin1 3f434506f5 Kernel: Extract ProcessorSpecificDataID from from Arch/Processor.h 2021-12-11 13:23:27 -08:00
Hendiadyoin1 556b516182 Kernel: Extract DeferredCallEntry from Arch/Processor.h 2021-12-11 13:23:27 -08:00
David Lindbom 235a2b35d6 passwd: Port to LibMain 2021-12-11 13:16:55 -08:00
Hendiadyoin1 e34eb3e36d Kernel: Remove unused String.h includes
This makes searching for not yet OOM safe interfaces a bit easier.
2021-12-11 13:15:26 -08:00
Daniel Bertalan 52e4753722 Meta: Move compiler-specific warnings into the appropriate if clause 2021-12-11 13:14:15 -08:00
Daniel Bertalan 4a81b33c07 Everywhere: Fix -Winconsistent-missing-override warnings from Clang
This option is already enabled when building Lagom, so let's enable it
for the main build too. We will no longer be surprised by Lagom Clang
CI builds failing while everything compiles locally.

Furthermore, the stronger `-Wsuggest-override` warning is enabled in
this commit, which enforces the use of the `override` keyword in all
classes, not just those which already have some methods marked as
`override`. This works with both GCC and Clang.
2021-12-11 13:14:15 -08:00
Andreas Kling 813593a485 Kernel: Fix overly loose MemoryManager::kernel_region_from_vaddr()
It's not enough to just find the largest-address-not-above the argument,
we must also check that the found region actually contains the argument.

Regressed in a23edd42b8, thanks to Idan
for pointing this out.
2021-12-11 21:18:42 +01:00
Andreas Kling ecccd511fa Meta: Run QEMU with QMP socket
This allows external connections to the QEMU monitor via QMP.
2021-12-11 20:13:36 +01:00
Andreas Kling 259cca456f Kernel: Make PhysicalRegion::return_page() do arithmetic instead of loop
Most of the time, we will be freeing physical pages within the
full-sized zones. We can do some simple math to find the right zone
immediately instead of looping through the zones, checking each one.

We still do loop through the slack/remainder zones at the end.
There's probably an even nicer way to solve this, but this is already a
nice improvement. :^)
2021-12-11 20:13:32 +01:00
Andreas Kling 63117f826b Kernel: Simplify 64-bit HPET reads on x86_64
We don't have to worry about racy 32-bit reads when we're reading the
64-bit HPET value using a 64-bit CPU. :^)
2021-12-11 20:13:25 +01:00
Andreas Kling a23edd42b8 Kernel: Store kernel memory regions in a RedBlackTree
We were already doing this for userspace memory regions (in the
Memory::AddressSpace class), so let's do it for kernel regions as well.

This gives a nice speed-up on test-js and probably basically everything
else as well. :^)
2021-12-11 20:13:20 +01:00
Linus Groh 6d9a1d3c93 Ports: Update Python to 3.10.1 :^)
This was released a couple of days ago, on 2021-12-06 and contains
various changes that we previously needed custom patches for, so we are
now able to remove those and compile more unchanged upstream sources.
Thanks to Rodrigo for making that effort! :^)
2021-12-11 19:02:00 +00:00
Timothy Flynn 1e95e7716b LibUnicode: Generate unique units 2021-12-11 14:17:47 +00:00
Timothy Flynn 4c2c8b8e33 LibUnicode: Generate unique number systems 2021-12-11 14:17:47 +00:00
Timothy Flynn 2a7f36b392 LibJS+LibUnicode: Generate unique numeric symbol lists
There are 443 number system objects generated, each of which held an
array of number system symbols. Of those 443 arrays, only 39 are unique.

To uniquely store these, this change moves the generated NumericSymbol
enumeration to the public LibUnicode/NumberFormat.h header with a pre-
defined set of symbols that we need. This is to ensure the generated,
unique arrays are created in a known order with known symbols. While it
is unfortunate to no longer discover these symbols at generation time,
it does allow us to ignore unwanted symbols and perform less string-to-
enumeration conversions at lookup time.
2021-12-11 14:17:47 +00:00
Timothy Flynn 9cc323b0b0 LibUnicode: Generate unique NumberFormat lists for each Unit 2021-12-11 14:17:47 +00:00
Timothy Flynn cdbfe01827 LibUnicode: Generate unique NumberFormat lists for each NumberSystem 2021-12-11 14:17:47 +00:00
Timothy Flynn 76af9fae63 LibUnicode: Support storing lists in UniqueStorage for code generators
The evolution of UniqueStorage has been as follows:

1. It was created as UniqueStringStorage to ensure only one copy of each
   unique string is generated. Interested parties stored an index into
   a unique string list, rather than the string itself.
   Commits: f9e605397c and 04e6b43f05

2. It became apparent that non-string structures could also be de-
   duplicated to reduce the size of libunicode.so. UniqueStringStorage
   was generalized to UniqueStorage for this purpose.
   Commit: d8e6beb14f

It's now also apparent that there's heavy duplication of lists of
structures. For example, the NumberFormat generator stores 4 lists of
NumberFormat objects. In total, we currently generate nearly 2,000 lists
of these objects, of which 275 are unique.

This change updates UniqueStorage to support storing lists. The only
change is how the storage is generated - we generate each stored list
individually, then an array storing spans of those lists.
2021-12-11 14:17:47 +00:00
bugreport0 8a4b9c0926 passwd: Remove redundant pledge() 2021-12-11 03:17:11 -08:00
Linus Groh aa2b85c697 LibJS: Use AK::NaN<double> in Date::date_value() to fix build error
This was not happening locally for me, neither when building Lagom on
Linux nor with the SerenityOS toolchain...

    error: implicit conversion from ‘float’ to ‘double’ to match other
    result of conditional [-Werror=double-promotion]
2021-12-10 23:32:54 +00:00
Linus Groh de00a7594f LibJS: Implement the thisTimeValue() AO and use it where applicable 2021-12-10 23:02:35 +00:00
Linus Groh 038d354b5d LibJS: Remove Object::value_of()
Being really close to Object.prototype.valueOf() name wise makes this
unnecessarily confusing - while it sometimes serves as the
implementation of a valueOf() function, it's an abstraction which the
spec doesn't have.
Use the appropriate getters to retrieve specific internal slots instead,
most commonly [[FooData]] from the primitive wrapper objects.
For the Object class specifically, use the Value(Object*) ctor instead.
2021-12-10 22:52:36 +00:00
Timothy Flynn 07c5419a82 LibJS: Add test case for locales which do not define day periods
Some locales do not define morning, night, etc. day period ranges.
TR-35 states they should fall back to the fixed day periods AM and PM.
Add a test case for the "as" locale, which is one such locale, to ensure
its AM/PM symbols are used.
2021-12-10 21:27:24 +00:00
Timothy Flynn 5bdee9e38a LibJS: Use locale-aware day period time ranges to format period symbols
For the test cases changed here, we now recognize "morning2" and
"afternoon2" from the CLDR, so the expected results now match the specs
and other engines.
2021-12-10 21:27:24 +00:00
Timothy Flynn a417c23de0 LibUnicode: Parse and generate per-locale day period ranges 2021-12-10 21:27:24 +00:00
Timothy Flynn fa8e881cfa LibUnicode: Parse and generate secondary day period symbols
Generate morning2, afternoon2, evening2, and night2 symbols.
2021-12-10 21:27:24 +00:00
Timothy Flynn 76aab821f4 LibJS+LibUnicode: Rename some Unicode::DayPeriod values
In the CLDR, there aren't "night" values, there are "night1" & "night2"
values. This is for locales which use a different name for nighttime
depending on the hour. For example, the ja locale uses "夜" between the
hours of 19:00 and 23:00, and "夜中" between the hours of 23:00 and
04:00. Our CLDR parser is currently ignoring "night2", so this rename
is to prepare for that.

We could probably come up with better names, but in the end, the API in
LibUnicode will be such that outside callers won't even see Night1, etc.
2021-12-10 21:27:24 +00:00
Luke Wilde 1a5bf15b4d LibWeb: Implement AbortSignal.throwIfAborted
See: https://github.com/whatwg/dom/commit/cfe2f1e
2021-12-10 23:05:36 +02:00
Luke Wilde 64040c136e LibWeb: Add support for AbortSignal.reason 2021-12-10 23:05:36 +02:00
Idan Horowitz 4dbda2d5b4 Meta: Enable the "bugprone-dangling-handle" clang-tidy check
This should catch (the trivial cases of) construction of StringViews
from temporary Strings and the construction of Spans from temporary
Vectors.
2021-12-10 23:00:24 +02:00
Sam Atkins 197759e30f LibWeb: Fix off-by-one error when highlighting unquoted HTML attributes
This fixes #11166
2021-12-10 21:27:13 +01:00
Timothy Flynn 2e4e0195de LibJS: Implement ECMA-402 Date.prototype.toLocaleTimeString 2021-12-10 13:58:33 +00:00
Timothy Flynn 4d310fd7aa LibJS: Implement ECMA-402 Date.prototype.toLocaleDateString 2021-12-10 13:58:33 +00:00
Timothy Flynn 9a62c01ebc LibJS: Implement ECMA-402 Date.prototype.toLocaleString 2021-12-10 13:58:33 +00:00
Hendiadyoin1 9be409585c Kernel: Some clang-tidy fixes in Bus/VirtIO 2021-12-09 22:53:42 -08:00
Hendiadyoin1 471b38db68 Kernel: Some clang-tidy fixes in Bus/USB 2021-12-09 22:53:42 -08:00
Hendiadyoin1 b03b7f806a Kernel: Mark USBTransfer's constructor as private
We have a try_create method for that.
2021-12-09 22:53:42 -08:00
Hendiadyoin1 21c5c4026b Kernel: Mark ACPI::Parser's empty destructor as default 2021-12-09 22:53:42 -08:00
Hendiadyoin1 73aa5c75d5 Kernel: Fix some clang-tidy warnings in PCI::Access 2021-12-09 22:53:42 -08:00
Hendiadyoin1 19ba32651d Kernel: Use AK:any_of in PCI::Device capability checks
This is equivalent to std::any_of as clang-tidy suggests.
2021-12-09 22:53:42 -08:00
Hendiadyoin1 5adf5f4dee Kernel: Construct PCIDeviceAttributeSysFSComponent with StringViews
There is no use to create a temporary String of a char const* to just
cast it to a StringView on SysFSComponent construction again.
Also this could have lead to a UAF bug.
2021-12-09 22:53:42 -08:00
Hendiadyoin1 de26dd253b Kernel: Pass capabilities as const reference in PCI::Address 2021-12-09 22:53:42 -08:00
Hendiadyoin1 3070252090 Kernel: Mark PCI::Address as trivially copyable 2021-12-09 22:53:42 -08:00
Hendiadyoin1 f9e8fe557c Kernel: Add missing include to SlabAllocator 2021-12-09 22:53:42 -08:00
Lady Gegga 991384856a Base: Add some Vai characters to font Katica Regular 10
A5A8-A5D1 https://www.unicode.org/charts/PDF/UA500.pdf
2021-12-10 06:52:40 +01:00
Sam Atkins 54bbb97ac6 Browser+LibWeb+WebContent: Add variables display to Inspector
This allows us to see which custom properties apply to a given element,
which previously wasn't shown.
2021-12-10 06:52:17 +01:00
Timothy Flynn 53df13fed7 LibJS: Implement Intl.DateTimeFormat.prototype.formatRangeToParts 2021-12-09 23:43:04 +00:00
Timothy Flynn 04f8fb07e1 LibJS: Implement Intl.DateTimeFormat.prototype.formatRange 2021-12-09 23:43:04 +00:00