summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-29LibJS: Change Intl's GetOption AO to accept a Span rather than a VectorTimothy Flynn
Allocating a Vector for each of these invocations is a bit silly when the values are basically all compile-time arrays. This AO is used even more heavily by Intl.DateTimeFormat, so change it to accept a Span to reduce its cost. This also adds an overload to accept a fixed-size C-array so callers do not have to be prefixed with AK::Array, i.e. this: get_option(..., AK::Array { "a"sv, "b"sv }, ...); Reduces to: get_option(..., { "a"sv, "b"sv }, ...); (Which is how all call sites were already written to construct a Vector in place).
2021-11-29LibDSP: Fix potential slicing issue in volume_from_envelopeBrian Gianforcaro
Use pointer or reference to avoid slicing from "PitchedEnvelope" to "Envelope". This was found by SonarCloud.
2021-11-29LibCpp: Fix copy paste typo in Parser::match_secondary_expressionBrian Gianforcaro
This was caught by SonarCloud.
2021-11-293DFileViewer: Set correct aspect ratio in view frustumJelle Raaijmakers
2021-11-29Tests: Add a simple LibGL render-testHendiadyoin1
At the moment we just check if we *can* render a simple triangle, we do not yet actually test if the image is indeed the triangle we wanted. This test also outputs the rendered image when GL_DEBUG is enabled to a file called "picture.bmp" for manual verification. Co-authored-by: sunverwerth <s.unverwerth@serenityos.org>
2021-11-29Lagom: Add LibGL to the librariesHendiadyoin1
2021-11-29Lagom: Disable implicit-const-int-float-conversion warningsHendiadyoin1
2021-11-29LibGL: Mark SoftwareGLContext::gl_scissor as overrideHendiadyoin1
I do not know how this did not trigger CI up until now...
2021-11-29LibGfx: Link against LibIPCHendiadyoin1
Gfx::Color implements an IPC::[en|de]code function, but we did not actually link against LibIPC to resolve the needed Symbols for that and were relying on LibGui or others to link against it for us. Having this linkage is unfortunate, but static inlining the functions in question is sadly not possible, due needed includes leading the IPC pipeline to initialize multiple times then, which leads to a compilation error.
2021-11-29LibGfx: Load default font lazilyHendiadyoin1
This is required when trying to use a Painter from lagom, due to /res/font not being present
2021-11-29LibJS: Implement parsing and executing for-await-of loopsdavidot
2021-11-29LibJS: Implement the async versions of iterator operationsdavidot
Since AsyncIteratorClose and IteratorClose differ only in that the async version awaits the inner value we just implement them with an enum flag to switch just that behavior.
2021-11-29LibJS: Add AsyncFromSyncIteratorPrototype and Async-From-Sync instancesdavidot
Until we have actual iterator records we have to store the sync iterator as the raw object.
2021-11-29LibJS: Move the TRY_OR_REJECT macro to PromiseReactiondavidot
Also fixes that we ignored the result of the Call which we shouldn't according to the spec.
2021-11-29LibJS: Add AsyncIteratorPrototypedavidot
2021-11-29ImageDecoder: Fix assertion after failed decodeAndreas Kling
We were calling value() on an ErrorOr containing an error when trying to extract the frame duration after a failed decode. This fixes ImageDecoder crashing on various websites.
2021-11-293DFileViewer: Improve FPS displayJelle Raaijmakers
We only showed frame times down to the millisecond. Our FPS counter was based off of that, allowing for a limited set of possible FPS values. Convert these calculations to floating point so we get more useful FPS and frame time values.
2021-11-29LibIPC: Mark m_sockfd as maybe_unused on non Serenity platformsdavidot
2021-11-28Kernel: Use peripheral addresses returned from MMIO to map prekernel memJames Mintram
2021-11-28Kernel: Refactor prekernel MMU to use a bump allocatorJames Mintram
2021-11-28Kernel: Rename Aarch64Asm -> ASM_wrapper and add Aarch64::Asm namespaceJames Mintram
2021-11-28Kernel: Rename Aarch64Registers -> Registers and add Aarch64 namespaceJames Mintram
2021-11-28Kernel: Set up and activate the MMU in the aarch64 perkernelJames Mintram
2021-11-28Kernel: Move common aarch64 asm functions into kernel folder and NSJames Mintram
2021-11-28Kernel: Split prekernel exception level code into its own fileJames Mintram
2021-11-28Kernel: Change prekernel to use shared SP across Exception LevelsJames Mintram
2021-11-28Kernel: Replace inline asm with typesafe static member functionsJames Mintram
2021-11-28Kernel: Remove unused header from Aarch64_asm_utilsJames Mintram
2021-11-29LibIPC: Replace u32/u64 value coders with u/ul/ull value codersAndreas Kling
We can and should do more cleanups of this kind, but this is a quick fix to unbreak the 32-bit HackStudio build.
2021-11-28SpiceAgent: Port to LibMain :^)Andreas Kling
2021-11-28LibCore: Add syscall wrapper for dup()Andreas Kling
2021-11-28LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void>Andreas Kling
This allows us to use TRY() in decoding helpers, leading to a nice reduction in line count.
2021-11-28LibIPC: Make IPC::Connection::post_message() return ErrorOrAndreas Kling
2021-11-28LibCore: Add syscall wrappers for sendfd() and recvfd()Andreas Kling
2021-11-28LibIPC: Give MessageBuffer::fds some inline capacity (1)Andreas Kling
This dodges a heap allocation when sending 0 or 1 fd across the IPC boundary (which covers every message.)
2021-11-28LibAudio: Optimize sample moves in FlacLoaderkleines Filmröllchen
As long as possible, entire decoded frame sample vectors are moved into the output vector, leading to up to 20% speedups by avoiding memmoves on take_first.
2021-11-28AK: Stop Vector::extend from unnecessary reallocationkleines Filmröllchen
Previously, Vector::extend for a moved vector would move the other vector into this vector if this vector was empty, thereby throwing away existing allocated capacity. Therefore, this commit allows the move to only happen if this vector's capacity is too small to fit the other vector. This will also alleviate bugs where callers relied on the capacity to never shrink with calls to unchecked_append, extend and the like.
2021-11-28AK: Add Vector::unchecked_append for data pointerskleines Filmröllchen
This mirrors the existence of append() for data pointers and is very useful when the program needs to have a guarantee of no allocations, as is necessary for real-time audio.
2021-11-28Utilites: Add abench utilitykleines Filmröllchen
abench (audio benchmark) is an audio benchmarking utility that allows testing decoder performance.
2021-11-28LibAudio: New error propagation API in Loader and Bufferkleines Filmröllchen
Previously, a libc-like out-of-line error information was used in the loader and its plugins. Now, all functions that may fail to do their job return some sort of Result. The universally-used error type ist the new LoaderError, which can contain information about the general error category (such as file format, I/O, unimplemented features), an error description, and location information, such as file index or sample index. Additionally, the loader plugins try to do as little work as possible in their constructors. Right after being constructed, a user should call initialize() and check the errors returned from there. (This is done transparently by Loader itself.) If a constructor caused an error, the call to initialize should check and return it immediately. This opportunity was used to rework a lot of the internal error propagation in both loader classes, especially FlacLoader. Therefore, a couple of other refactorings may have sneaked in as well. The adoption of LibAudio users is minimal. Piano's adoption is not important, as the code will receive major refactoring in the near future anyways. SoundPlayer's adoption is also less important, as changes to refactor it are in the works as well. aplay's adoption is the best and may serve as an example for other users. It also includes new buffering behavior. Buffer also gets some attention, making it OOM-safe and thereby also propagating its errors to the user.
2021-11-28LibAudio: Buffer API improvementskleines Filmröllchen
This consists of two changes: First, a utility function create_empty allows the user to quickly create an empty buffer. Second, most creation functions now return a NonnullRefPtr, as their failure causes a VERIFY crash anyways.
2021-11-28LibAudio: Avoid frequent read() calls in FLAC residual decodekleines Filmröllchen
Decoding the residual in FLAC subframes is by far the most I/O-heavy operation in FLAC decoding, as the residual data makes up the majority of subframe data in LPC subframes. As the residual consists of many Rice-encoded numbers with different bit sizes for differently large numbers, the residual decoder frequently reads only one or two bytes at a time. As we use a normal FileInputStream, that directly translates to many calls to the read() syscall. We can see that the I/O overhead while FLAC decoding is quite large, and much time is spent in the read() syscall's kernel code. This is optimized by using a Buffered<FileInputStream> instead, leading to 4K blocks being read at once and a large reduction in I/O overhead. Benchmarking with the new abench utility gives a 15-20% speedup on identical files, usually pushing FLAC decoding to 10-15x realtime speed on common sample rates.
2021-11-28AK: Expose Buffered's buffer size and underlying streamkleines Filmröllchen
2021-11-28AK: Allow to "get a result" from Result<void>Hendiadyoin1
This is to make Result<void> work inside TRY
2021-11-28AK: Remove unused static member of BitmapBen Wiederhake
This is a remnant of the Bitmap/BitmapView split.
2021-11-28Meta: Allow overlong 'fixup!' commit titles in pre-commit hookBen Wiederhake
2021-11-28ThemeEditor: Use LibMainMarcus Nilsson
Use the new serenity_main construct and TRY in ThemeEditor.
2021-11-28Magnifier: Use LibMainMarcus Nilsson
Use the new serenity_main construct and TRY in Magnifier.
2021-11-28LibGL: Initialize all GL context matrices with the identity matrixStephan Unverwerth
2021-11-28Toolchain/Clang: Fix CMake using utilities from the LLVM portDaniel Bertalan
If we have the LLVM port installed, CMake might pick up some of the tools installed as part of it (`llvm-ar`, `llvm-strip`, etc.) instead of the ones belonging to the host toolchain. These, of course, can't be run on the host platform, so builds would eventually fail. This made it impossible to rebuild the LLVM toolchain. We now set these variables explicitly when compiling the LLVM runtime libraries in order to avoid this issue.