summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-25LibCore: Add InputFileStream::seekkleines Filmröllchen
As a file is able to seek(), InputFileStreams can delegate the seek() easily. This allows for seeking to specific locations in the file.
2021-06-25Toolchain: Add the AFLACLOADER_DEBUG macrokleines Filmröllchen
This enables FLAC debugging output, which is used with the new FLAC loader introduced in later commits.
2021-06-25LibJS: Make sure to always initialize Reference::m_base_valueAndreas Kling
2021-06-25LibJS: Rename Reference methods to match the specAndreas Kling
- get -> get_value (GetValue in the spec) - put -> put_value (PutValue in the spec) Also add spec links. :^)
2021-06-25LibJS: Bring Reference records a bit closer to the ECMAScript specAndreas Kling
Our Reference class now has the same fields as the spec: - Base (a non-nullish value, an environment record, or `unresolvable`) - Referenced Name (the name of the binding) - Strict (whether the reference originated in strict mode code) - ThisValue (if non-empty, the reference represents a `super` keyword) The main difference from before is that we now resolve the environment record that a reference interacts with. Previously we simply resolved to either "local variable" or "global variable". The associated abstract operations are still largely non-conforming, since we don't yet implement proper variable bindings. But this patch should at least fix a handful of test262 cases. :^) There's one minor regression: some TypeError message strings get a little worse due to doing a RequireObjectCoercible earlier in the evaluation of MemberExpression.
2021-06-25LibJS: Evaluate `this` in terms of ResolveThisBindingAndreas Kling
2021-06-25LibJS: Remove outdated FIXME in GetThisEnvironmentAndreas Kling
2021-06-25LibJS: Rename VM::get_reference() => resolve_binding()Andreas Kling
This function maps to the ResolveBinding operation from the spec, so let's rename it to match.
2021-06-25Kernel/AHCI: Dont assume ports start at 0Alexander
This fixes a bug that occurs when the controller's ports are not (internally) numbered sequentially. This is done by checking the bits set in PI. This bug was found on bare-metal, on a laptop with 1 Port that was reported as port 4.
2021-06-25Kernel/AHCI: Fix shift of 1Alexander
This makes the 1 in the shift unsigned. This also changes the is_set_at parameter to be a u8.
2021-06-25Meta: Increase RAM amount for BochsGunnar Beutner
Booting with 128 MB of RAM is kind of tough.
2021-06-25Kernel: Build the x86_64 kernel as an ELF32 executableGunnar Beutner
Multiboot only supports ELF32 executables. This changes the build process to build an ELF32 executable which has a 32-bit entry point, but consists of mostly 64-bit code.
2021-06-25Kernel: Ensure that the Multiboot header is placed into the first 8kBGunnar Beutner
The Multiboot header must be within the first 8kB of the executable for it to be picked up by QEMU, GRUB and other multiboot-capable boot loaders.
2021-06-25Kernel: Set an appropriate GDT for 64-bit modeGunnar Beutner
2021-06-25Kernel: Use PML4T for 64-bit modeGunnar Beutner
2021-06-25Kernel: Move Multiboot header into a separate fileGunnar Beutner
2021-06-25Kernel: Update the x86_64 boot code to match i386's codeGunnar Beutner
2021-06-25Meta: Run 64-bit kernels with qemu-system-x86_64Gunnar Beutner
2021-06-25LibWeb: Support :active pseudo-class for hyperlinks, :focus possiblyPaul Irwin
Adds support for the :active pseudo-class for hyperlinks (<a> tags only). Also, since it was very similar to :focus and an element having a focused state was already implemented, I went ahead and implemented that pseudo-class too, although I cannot come up with a working example to validate it.
2021-06-25Browser: Add alternate shortcut F6 for focusing the location boxAatos Majava
2021-06-25LibGUI: Add alternate shortcut F5 to the "reload" common actionAatos Majava
2021-06-25LibGUI: Make Action::shortcut() return const&Aatos Majava
Also do the same for Action::alternate_shortcut().
2021-06-25LibGUI: Add a new constructor to ActionAatos Majava
This constructor allows you to omit the modifier keys. Instead of doing "{ 0, Key_F5 }" you can now just do "Key_F5"
2021-06-25LibGUI: Actually use the Action alternate shortcutAatos Majava
This adds the actual functionality to Window and Application.
2021-06-25LibGUI: Add support for an alternate keyboard shortcut in ActionAatos Majava
This patch adds the alternate_shortcut member to LibGUI::Action, which enables one Action to have two keyboard shortcuts. Note that the string used in menus and tooltips only shows the main shortcut, which is the same behaviour as in Firefox and Chrome.
2021-06-24LibGUI: Add update() when changing widget color or paletteSpencer Dixon
2021-06-25WindowServer: Scale Mouse movementsAlexander
This fixes a bug where if the current screen was using scaling, the mouse would be twice as fast as normal.
2021-06-24Userland: Replace VERIFY(is<T>) with verify_cast<T>Andreas Kling
Instead of doing a VERIFY(is<T>(x)) and *then* casting it to T, we can just do the cast right away with verify_cast<T>. :^)
2021-06-24LibJS: Protect execution context variable environments from GCAndreas Kling
At the moment these environments are always the same as the lexical ones, so this didn't cause any trouble. Once we start separating them we have to make sure both environments are protected.
2021-06-24AK: Rename downcast<T> => verify_cast<T>Andreas Kling
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-24LibJS: Rename ExecutionContext::callee => functionAndreas Kling
This matches what ECMAScript calls it. Also make it a JS::Function* instead of a generic Value, since it will always either be a function object or null.
2021-06-24LibJS: Rename CallFrame => ExecutionContextAndreas Kling
This struct represents what the ECMAScript specification calls an "execution context" so let's use the same terminology. :^)
2021-06-24LibVT: Only resize the line after all rewrapping is doneAli Mohammad Pur
Otherwise we would end up inserting empty cells into the wrapped lines. Fixes #8227.
2021-06-24Kernel: Remove superfluous `alignas(T)` from `KResultOr<T>`Daniel Bertalan
Since `m_storage` is already guaranteed to be correctly aligned for the type, we can forgo specifying it for the entire class. This fixes an error: previously, this would *force* the value type's alignment on the entire class, which would try to make 1-byte aligned ints with `KResultOr<bool>`. GCC somehow compiled this (probably just ignored it), but this caused a build error with Clang. Closes #8072
2021-06-24LibCore+AK: Use proper atomics in `Singleton`Daniel Bertalan
2021-06-24LibGfx: Don't `constexpr` functions returning StringsDaniel Bertalan
Since strings don't have a constexpr constructor, these won't have any effect anyways. Furthermore, this is explicitly disallowed by the standard, and makes Clang tools freak out.
2021-06-24Kernel: Fix attribute orderingDaniel Bertalan
Clang requires that attributes declared using the bracketed `[[attr_name]]` syntax come before those with `__attribute__((attr-name))`. This fixes a Clang build error.
2021-06-24AK: Use `__attribute__((name))` for functions everywhereDaniel Bertalan
Clang enforces the ordering that attributes specified with the `[[attr_name]]` syntax must comes before those defines as `__attribute__((attr_name))`. We don't want to deal with that, so we should stick to a single syntax (for functions, at least). This commit favors the latter, as it's used more widely in the code (for declaring more "exotic" options), and changing those would be a larger effort than modifying this single file.
2021-06-24Kernel: Use proper `Atomic<T>` types in CPUDaniel Bertalan
This is needed because Clang's intrinsic atomic functions behave weirdly if only one of their pointer arguments is volatile.
2021-06-24Userland: Disambiguate dependent typesDaniel Bertalan
Clang produced an error on these pieces of code without the `typename` keyword.
2021-06-24Everywhere: Use nothrow new with `adopt_{ref,own}_if_nonnull`Daniel Bertalan
This commit converts naked `new`s to `AK::try_make` and `AK::try_create` wherever possible. If the called constructor is private, this can not be done, so we instead now use the standard-defined and compiler-agnostic `new (nothrow)`.
2021-06-24AK: Add factory methods for creating smart pointersDaniel Bertalan
These functions abstract away the need to call the proper new operator ("throwing" or "non-throwing") and manually adopt the resulting raw pointer. Modelled after the existing `NonnullOwnPtr<T> make()` functions, these forward their parameters to the object's constructor. Note: These can't be used in the common "factory method" idiom, as private constructors can't be called from a standalone function. The naming is consistent with AK's and Shell's previous implementation of these: - `make` creates a `NonnullOwnPtr<T>` and aborts if the allocation could not be performed. - `try_make` creates an `OwnPtr<T>`, which may be null if the allocation failed. - `create` creates a `NonnullRefPtr<T>`, and aborts on allocation failure. - `try_create` creates a `RefPtr<T>`, which may be null if the allocation was not successful.
2021-06-24AK+Kernel: Make fallible allocations compiler-agnosticDaniel Bertalan
In standard C++, operators `new` and `new[]` are guaranteed to return a valid (non-null) pointer and throw an exception if the allocation couldn't be performed. Based on this, compilers did not check the returned pointer before attempting to use them for object construction. To avoid this, the allocator operators were changed to be `noexcept` in PR #7026, which made GCC emit the desired null checks. Unfortunately, this is a non-standard feature which meant that Clang would not accept these function definitions, as it did not match its expected declaration. To make compiling using Clang possible, the special "nothrow" versions of `new` are implemented in this commit. These take a tag type of `std::nothrow_t` (used for disambiguating from placement new/etc.), and are allowed by the standard to return null. There is a global variable, `std::nothrow`, declared with this type, which is also exported into the global namespace. To perform fallible allocations, the following syntax should be used: ```cpp auto ptr = new (nothrow) T; ``` As we don't support exceptions in the kernel, the only way of uphold the "throwing" new's guarantee is to abort if the allocation couldn't be performed. Once we have proper OOM handling in the kernel, this should only be used for critical allocations, where we wouldn't be able to recover from allocation failures anyway.
2021-06-24AK: Specialize `Atomic<Integral>` for clang compatibilityDaniel Bertalan
While Clang claims to implement GCC's atomics libcall API, a small incompatibility caused our builds to fail on Clang. Clang requires requires the operands to its fixed-size functions to be integer types, while GCC will take any type with the same size and alignment as the various integer primitives. This was problematic, as atomic `enum class`es would not compile. Furthermore, Clang does not like if only one operand pointer is marked volatile. Because it only affects the standalone atomic functions, that will be fixed in a later commit. As an added benefit, the code is more type-safe, as it won't let us perform arithmetic on non-integer types. Types with overloaded arithmetic types won't cause unexpected behavior anymore. The constructors for the various atomic types can now be used in constant expressions.
2021-06-24AK: Make C++ concepts support mandatory for compilersDaniel Bertalan
The latest GCC and Clang versions both support this, so we can freely use these in our code.
2021-06-24Utilities: Validate user with Core::Account in userdelbrapru
Previously the remove home directory option never actually removed the user's home directory because it was not properly unveiled. By validating the user with Core::Account, we can identify the user's home directory earlier in the program and unveil as necessary. Additionally, by identifying if the user does not exist much earlier in the program, this elimates depending on getpwent to validate the user and creating unneccessary temp files.
2021-06-24LibJS: Fix clang-tidy warnings in AST.hAndreas Kling
- Add/remove `move()` as suggested. - Add missing `explicit` on single-parameter constructors.
2021-06-24LibJS: Don't use m_ prefix for argument name in ScriptFunctionAndreas Kling
2021-06-24LibJS: Remove unused DeclarativeEnvironmentRecord::type()Andreas Kling
Nothing was using this, and we now have separate classes for the different types of environment records instead.
2021-06-24LibJS: Add ObjectEnvironmentRecord.[[IsWithEnvironment]] fieldAndreas Kling
This is true for environments created by `with` statements, and false for other (global) object environments. Also add the WithBaseObject abstract operation while we're here.