Commit graph

25888 commits

Author SHA1 Message Date
Martin Åberg
5d146628e1 Documentation: Update FreeBSD prerequisites
FreeBSD comes with Clang as default host compiler and provides
GCC in the package system. The commit adds a few dependencies to
the pkg command line.
2021-08-18 00:35:09 +02:00
Linus Groh
90f7e01179 LibJS/Tests: Add Temporal.Calendar.from() tests for more object types 2021-08-17 23:06:05 +01:00
Linus Groh
0cdad283c0 LibJS: Reflect Record wording editorial change in the Temporal spec
See: https://github.com/tc39/proposal-temporal/commit/c8f14d0
2021-08-17 21:59:35 +01:00
Linus Groh
74ee1c9a8c LibJS: Add PlainDateTime fast path to various Calendar.prototype getters
This is a recent editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c3880a3
2021-08-17 21:59:35 +01:00
Linus Groh
d46c531023 LibJS: Add and use newly introduced ToIntegerThrowOnInfinity Temporal AO
See: https://github.com/tc39/proposal-temporal/commit/2ed58f4
2021-08-17 21:59:35 +01:00
Timothy Flynn
4073fe497a Meta: Add Azure DevOps badge to README 2021-08-17 21:06:15 +01:00
Timothy Flynn
ef3ab8dd5f CI: Remove Lagom from GitHub Actions entirely
Fuzzing was the only Lagom build left.
2021-08-17 21:06:15 +01:00
Timothy Flynn
e3d4778a63 CI: Build Lagom with fuzzing on Azure 2021-08-17 21:06:15 +01:00
Nico Weber
9fd2f97d27 echo: Implement -e flag
This lets you do things like `echo -e '\e[31mhello\e[m'` to print
red text, without having to resort to the tyranny of printf(1).
2021-08-17 19:59:23 +01:00
Andrew January
f62ac5d81d Kernel/SysFS: Prepend to the custody cache instead of append
Usage patterns mean we are more likely to need a Custody we just cached.
Because lookup walks the list from the beginning, prepending new items
instead of appending means they will be found quicker.

This reduces the number of items in the cache we need to walk by 50% for
boot and application startups.
2021-08-17 16:30:03 +02:00
Timothy Flynn
86069fa28d CI: Remove nightly Clang toolchain GitHub Action 2021-08-17 13:31:43 +01:00
Timothy Flynn
3ce6f26924 CI: Build and test SerenityOS with the Clang toolchain on Azure 2021-08-17 13:31:43 +01:00
Timothy Flynn
5eba8c948d CI: Use Azure caching for Lagom build
Adds a compiler cache and a cache for the UCD files.
2021-08-17 13:31:43 +01:00
Timothy Flynn
831f90c9d4 Meta: Semi-automatically detect ccache for Lagom builds
The top-level CMakeLists.txt already automatically detects ccache, but
CI will invoke CMake with Lagom's CMakeLists.txt. Add an option to Lagom
to do the same detection.
2021-08-17 13:31:43 +01:00
Timothy Flynn
eedb26110a Kernel: Fix compilation with Clang
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2021-08-17 13:31:43 +01:00
Timothy Flynn
7ea55c883b Toolchain: Make Kernel/API headers available to Clang toolchain build
Copied from 9b79867909.
2021-08-17 13:31:43 +01:00
Linus Groh
1292d80b93 LibJS: Implement Temporal.Calendar.prototype.mergeFields() 2021-08-17 00:26:19 +01:00
Andreas Kling
1ea604adb1 Kernel/ProcFS: Avoid String allocation when traversing /proc/PID/fd/ 2021-08-17 01:21:47 +02:00
Andreas Kling
45a5cf95f9 Kernel: Add a little explainer comment to ListedRefCounted 2021-08-17 01:21:47 +02:00
Andreas Kling
ea09294351 Kernel: Port Inode to ListedRefCounted
This consolidates the lock+list combo into a SpinLockProtectedValue
and closes yet another unref() race. :^)
2021-08-17 01:21:47 +02:00
Andreas Kling
b70b3a9b92 Kernel: Remove unused VMObject::is_contiguous() 2021-08-17 01:21:47 +02:00
Andreas Kling
4226b662cd Kernel+Userland: Remove global futexes
We only ever use private futexes, so it doesn't make sense to carry
around all the complexity required for global (cross-process) futexes.
2021-08-17 01:21:47 +02:00
Andreas Kling
7979b5a8bb Kernel: Port VMObject to ListedRefCounted
The VMObject class now manages its own instance list (it was previously
a member of MemoryManager.) Removal from the list is done safely on the
last unref(), closing a race window in the previous implementation.

Note that VMObject::all_instances() now has its own lock instead of
using the global MM lock.
2021-08-17 01:21:47 +02:00
Andreas Kling
3a2d888913 Kernel/DevPtsFS: Avoid String allocation during directory traversal
Use a StringBuilder to generate a temporary string buffer with the
slave PTY names. (This works because StringBuilder has 128 bytes of
inline stack capacity before it does any heap allocations.)
2021-08-17 01:21:47 +02:00
Andreas Kling
0de8c95d49 Kernel: Convert SlavePTY all-instances HashTable to an IntrusiveList
This simplifies the DevPtsFS implementation somewhat, as it no longer
requires SlavePTY to register itself with it, since it can now simply
use the list of SlavePTY instances.
2021-08-17 01:21:47 +02:00
Andreas Kling
62719b85e0 Kernel: Port Thread to ListedRefCounted 2021-08-17 01:21:47 +02:00
Andreas Kling
c410f08c2b Kernel: Add ListedRefCounted<T> template class
This class implements the emerging "ref-counted object that participates
in a lock-protected list that requires safe removal on unref()" pattern
as a base class that can be inherited in place of RefCounted<T>.
2021-08-17 01:21:47 +02:00
Andreas Kling
641083f3b8 Kernel: Customize File::unref() and make it virtual
Make File inherit from RefCountedBase and provide a custom unref()
implementation. This will allow subclasses that participate in lists to
remove themselves in a safe way when being destroyed.
2021-08-17 01:21:47 +02:00
Andreas Kling
fc0cd8317a Kernel/DevPtsFS: Add tightly typed DevPtsFSInode::fs() 2021-08-17 01:21:47 +02:00
kleines Filmröllchen
65c8fa9f91 AudioApplet: Persist settings and respect audio server settings
The audio applet uses the user configuration file "AudioApplet.ini" to
persist its settings, currently only whether the audio percentage should
be shown.

Since the audio server now may have specific settings when it starts,
the audio applet respects them by reading these same settings once when
it starts. Therefore, the audio server settings are not immediately
overridden by the audio applet defaults, as was the case before this
change.

A minor change was done to the way that the audio volume is calculated;
doubles are now used.
2021-08-17 01:21:17 +02:00
kleines Filmröllchen
d1b0143ba5 AudioServer: Persist audio settings with a config file
AudioServer loads its settings, currently volume and mute state, from a
user config file "Audio.ini". Additionally, the current settings are
stored every ten seconds, if necessary. This allows for persistent audio
settings in between boots.
2021-08-17 01:21:17 +02:00
davidot
47bc72bcf6 LibJS: Correctly handle Unicode characters in JS source text
Also recognize additional white space characters.
2021-08-16 23:20:04 +01:00
davidot
4d6502de42 LibJS: Disallow standalone super expression 2021-08-16 23:20:04 +01:00
davidot
a8b25d6c36 LibJS: Handle '++' and '--' more correctly within expression 2021-08-16 23:20:04 +01:00
davidot
5f344f7ca3 LibJS: Check that 'let' is followed by declaration before matching it
Since 'let' is a valid variable name (in non-strict mode) let may not be
the start of a declaration but just an identifier.
2021-08-16 23:20:04 +01:00
davidot
179c48e1a4 LibJS: Add optional extra strict checks in parse_binding_pattern 2021-08-16 23:20:04 +01:00
davidot
f1f338edcd LibJS: Tighten default values in formal parameter parsing
Disallow default parameter for rest parameters.
Disallow yield expressions as default values.
2021-08-16 23:20:04 +01:00
davidot
4989e79c45 LibJS: Allow yielding a class 2021-08-16 23:20:04 +01:00
davidot
19582ccad8 LibJS: Treat yield as an identifier in more non-generator contexts
And disallow some cases where we are in a generator context.
2021-08-16 23:20:04 +01:00
davidot
26177b1826 LibJS: Add more duplicated declarations detection
This is a small step in the right direction although the amount of
different checks is becoming unsustainable. In the future we probably
want to have the current_scope handle all declarations.
2021-08-16 23:20:04 +01:00
davidot
085c7df895 LibJS: Be more strict about the lhs of a for in/of loop
This is not entirely correct as really Object- and ArrayExpressions are
not allowed but that requires a bigger refactoring of for statement
parsing.
2021-08-16 23:20:04 +01:00
davidot
106f9e30d7 LibJS: Force the lexer to parse a regex when expecting a statement 2021-08-16 23:20:04 +01:00
davidot
05444103e3 LibJS: Treat arrow expression as function and stop parsing after 2021-08-16 23:20:04 +01:00
davidot
e31b715808 LibJS: Make functions reset break and continue context 2021-08-16 23:20:04 +01:00
davidot
be3b4a68d2 LibJS: Allow class methods named "get", "set" or "static" 2021-08-16 23:20:04 +01:00
davidot
b16c02d6b4 LibJS: Allow labelled functions in certain contexts
Also disallow duplicated labels.
2021-08-16 23:20:04 +01:00
davidot
4cc95ae39d LibJS: Fix that a windows-style new line was not escaped properly 2021-08-16 23:20:04 +01:00
kleines Filmröllchen
ba622cffe4 LibAudio: Fix overflow on 24-bit FLAC LPC data
When computing sample values from a linear predictor, the repeated
multiplication and addition can lead to very large values that may
overflow a 32-bit integer. This was never discovered with 16-bit FLAC
test files used to create and validate the first version of the FLAC
loader. However, 24-bit audio, especially with large LPC shifts, will
regularly exceed and overflow i32. Therefore, we now use 64 bits
temporarily. If the resulting value is too large for 32 bits, something
else has gone wrong :^)

This fixes playback noise on 24-bit FLACs.
2021-08-17 00:16:00 +02:00
kleines Filmröllchen
c974be91ab LibAudio: Rescale integer samples correctly in FLAC loader
The FLAC samples are signed, so we need to rescale them not by their bit
depth, but by half of the bit depth. For example, a 24-bit sample
extends from -2^23 to 2^23-1, and therefore needs to be rescaled by 2^23
to conform to the [-1, 1] double sample range.
2021-08-17 00:16:00 +02:00
kleines Filmröllchen
442aa48a61 LibAudio: Use size_t in loops
This is more idiomatic :^)
2021-08-17 00:16:00 +02:00