summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-28LibJS: Avoid pointless transitions and metadata lookups in storage_set()Linus Groh
- Replace the misleading abuse of the m_transitions_enabled flag for the fast path without lookup with a new m_initialized boolean that's set either by Heap::allocate() after calling the Object's initialize(), or by the GlobalObject in its special initialize_global_object(). This makes it work regardless of the shape's uniqueness. - When we're adding a new property past the initialization phase, there's no need to do a second metadata lookup to retrieve the storage value offset - it's known to always be the shape's property count minus one. Also, instead of doing manual storage resizing and assignment via indexing, just use Vector::append(). - When we didn't add a new property but are overwriting an existing one, the property count and therefore storage value offset doesn't change, so we don't have to retrieve it either. As a result, Object::set_shape() is now solely responsible for updating the m_shape pointer and is not resizing storage anymore, so I moved it into the header.
2021-08-28LibCore: Store ObjectRegistration names as StringViewsAndrew Kaster
We don't need to be allocating Strings for these names during static initialization. The C-string literals will be stored in the .rodata ELF section, so they're not going anywhere. We can just wrap the .rodata storage for the class names in StringViews and use those in Object registration and lookup APIs.
2021-08-28MailSettings: Add unveilLuke Wilde
2021-08-28MailSettings: Use LibConfig instead of Core::ConfigFileLuke Wilde
This also tightens the pledges.
2021-08-28Mail: Add unveilLuke Wilde
2021-08-28Mail: Use LibConfig instead of Core::ConfigFileLuke Wilde
This also tightens the pledges.
2021-08-28Kernel: Omit all actual code from the kernel on aarch64 for nowNico Weber
2021-08-28Prekernel: Make build on aarch64Nico Weber
Add a dummy Arch/aarch64/boot.S that for now does nothing but let all processor cores sleep. For now, none of the actual Prekernel code is built for aarch64.
2021-08-28Prekernel: Move boot.S and multiboot.S into an Arch/x86 subfolderNico Weber
2021-08-28Meta: Don't pass net -device flags in aarch64 buils in run.shNico Weber
2021-08-28Meta: Introduce SERENITY_MACHINE variable in run.shNico Weber
Set it to all the `-m`, `-display`, `-device` flags for Intel, and to just "-M raspi3" for aarch64 builds.
2021-08-28Meta: Disable spice in aarch64 buils in run.shNico Weber
2021-08-28Meta: Run qemu-system-aarch64 in aarch64 builds in run.shNico Weber
2021-08-28Meta: Disable kvm for aarch64 in run.shNico Weber
2021-08-28Meta: Make build-root-filesystem.sh omit libgcc_so.so in aarch64 buildsNico Weber
2021-08-28CMake: Don't build Userland and Tests in aarch64 builds for nowNico Weber
2021-08-28Toolchain: Also build aarch64-softmmu in BuildQemu.shNico Weber
2021-08-28Kernel: Verify interrupts are disabled when interacting with MutexesAndrew Kaster
This should help prevent deadlocks where a thread blocks on a Mutex while interrupts are disabled, and makes it impossible for the holder of the Mutex to make forward progress because it cannot be scheduled in. Hide it behind a new debug macro LOCK_IN_CRITICAL_DEBUG for now, because Ext2FS takes a series of Mutexes from the page fault handler, which executes with interrupts disabled.
2021-08-28Kernel: Don't acquire Mutex for hostname() before scheduling is enabledAndrew Kaster
There's no reason to acquire the mutex for this resource before APs are booted, before scheduling is enabled, and before interrupts are enabled.
2021-08-28Kernel: Acquire reference to waitee before trying to block in sys$waitidAndrew Kaster
Previously, we would try to acquire a reference to the all processes lock or other contended resources while holding both the scheduler lock and the thread's blocker lock. This could lead to a deadlock if we actually have to block on those other resources.
2021-08-28Kernel: Guard the all processes list with a Spinlock rather than a MutexAndrew Kaster
There are callers of processes().with or processes().for_each that require interrupts to be disabled. Taking a Mutexe with interrupts disabled is a recipe for deadlock, so convert this to a Spinlock.
2021-08-28Kernel: Unlock ptrace lock before entering a critical section in execveAndrew Kaster
While it might not be as bad to release a mutex while interrupts are disabled as it is to acquire one, we don't want to mess with that.
2021-08-28Kernel: Don't disable interrupts in validate_inode_mmap_protAndrew Kaster
There's no need to disable interrupts when trying to access an inode's shared vmobject. Additionally, Inode::shared_vmobject() acquires a Mutex which is a recipe for deadlock if acquired with interrupts disabled.
2021-08-28LibELF: Apply some minor optimizations to symbol lookupBrian Gianforcaro
Optimizations: - Make sure `DT_SYMTAB` is a string view literal, instead of string. - DynamicObject::HashSection::lookup_sysv_symbol should be using raw_name() from symbol comparison to avoid needlessly calling `strlen`, when the StrinView::operator= walks the cstring without calling `strlen` first. - DynamicObject::HashSection::lookup_gnu_symbol shouldn't create a symbol unless we know the hashes match first. In order to test these changes I enabled Undefined behavior sanitizer which creates a huge amount of relocations, and then ran the browser with the help argument 100 times. The browser is a fairly big app with a few different libraries being loaded, so it seemed liked a good target. Command: `time -n 100 br --help` Before: ``` Timing report: ============== Command: br --help Average time: 3897.679931 ms Excluding first: 3901.242431 ms ``` After: ``` Timing report: ============== Command: br --help Average time: 3612.860107 ms Excluding first: 3613.54541 ms ```
2021-08-28UserspaceEmulator: Profiles are now expected to have a `strings` arrayBrian Gianforcaro
The kernel profiles were recently changed to have a `strings` array as part of the profile objects. The `ProfileViewer` now checks for that during startup and declares the profile invalid if the array is not present. The UserspaceEmulator doesn't use the API which the kernel exposed the string array for, so just fake it by always adding an empty array to the generated profiles.
2021-08-28UserspaceEmulator: Make generated profiles debugable with cli toolsBrian Gianforcaro
The fact that profiles are json on one giant line makes them very difficult to debug when things go wrong. Instead make sure to wrap each event or sample on a newline so you can easily grep/heap/tail the profile files.
2021-08-28Shell: Use a relative path in builtin_cd for chdir if possibleAli Mohammad Pur
This kinda sorta addresses the Shell side of #9655, however the fact that `chdir` (and most other syscalls that take paths) are artifically limited to a length of PATH_MAX remains.
2021-08-28CMake: Let `Meta/serenity.sh run aarch64` make it past cmakeNico Weber
This adds just enough scaffolding to make cmake succeed. The build falls over immediately.
2021-08-28LibELF: Reindent .S files to be consistent with other .S filesNico Weber
Most .S files don't indent directives, so don't indent them here either. Also, one file had tabs instead of spaces, `:retab` that file.
2021-08-28Toolchain: Enough to make `rebuild-toolchain aarch64` workNico Weber
The gcc patch might not be completely correct, but at least the toolchain completes building.
2021-08-28Toolchain: Regenerate binutils.patch and gcc.patchNico Weber
I locally modified Meta/serenity.sh to pass `--dev` to BuildIt.sh in build_toolchain(). Then I ran `Meta/serenity.sh rebuild-toolchain`, cd'd into Toolchain/Tarballs/binutils-2.37, `git add`ed unadded files in `git status`, and then ran `git diff > ../../Patches/binutils.patch`. Then I did the same for Toolchain/Tarballs/gcc-11.2.0 (and was careful not to `git add` serenity-kernel.h, since that's created by Toolchain/BuildIt.sh). No behavior change. This just rewrites the patch like git writes it.
2021-08-28Spreadsheet: Use strict mode for runtime.jsLinus Groh
2021-08-28Spreadsheet: Replace loose with strict equality operators in runtime.jsLinus Groh
2021-08-28Spreadsheet: Remove custom JS string split function implementationLinus Groh
2021-08-28Spreadsheed: Call native functions in runtime.js on thisSheetLinus Groh
I think this *should* be working as-is, but there's probably something wrong with the this value of native functions. Either way, not relying on the implicit this value will allow us to use strict mode here eventually. Fixes #9240.
2021-08-28ps: Sort using input order in case of `-q`Mahmoud Mandour
Now the output of `ps -q <list>` is sorted according to the order the user specified.
2021-08-28ps: Select specific processes by their PIDsMahmoud Mandour
This adds a `-q` option, which expects a comma-separated list of PIDs as a value. On using it, only the processes associated with the supplied PIDs are output.
2021-08-28MailSettings: Remove proc and exec from plegesLinus Groh
2021-08-28MailSettings: Use the app-mail icon for the windowLinus Groh
No app-mail-settings icon exists (yet). app-mail is also what's being embedded in the executable, so let's stick with it.
2021-08-28Meta: Let serenity.sh's TARGET default to SERENITY_ARCH, not i686Linus Groh
This environment variable is already widely used across our build scripts and tooling, so serenity.sh should respect it as well. It still uses i686 as the fallback.
2021-08-282048: Remove wpath and cpath pledgesLuke Wilde
With the move to LibConfig, these are no longer needed.
2021-08-28Spider: Remove wpath and cpath pledges and pledge earlierLuke Wilde
With the move to LibConfig, the wpath and cpath pledges are no longer needed.
2021-08-28Solitaire: Remove wpath and cpath pledges and pledge earlierLuke Wilde
With the move to LibConfig, the wpath and cpath pledges are no longer needed.
2021-08-28Chess: Perform pledges earlierLuke Wilde
2021-08-28FlappyBug: Remove wpath and cpath pledgesLuke Wilde
With the move to LibConfig, these are no longer needed.
2021-08-28GameOfLife: Add pledge and unveilLuke Wilde
2021-08-28Pong: Remove wpath and cpath pledgesLuke Wilde
With the move to LibConfig, these are no longer needed.
2021-08-28Snake: Remove wpath and cpath pledgesLuke Wilde
With the move to LibConfig, these are no longer needed.
2021-08-28Minesweeper: Remove wpath and cpath pledgesLuke Wilde
With the move to LibConfig, these are no longer needed.
2021-08-28Meta: Remove write-only-on-difference scriptAndrew Kaster
It's now been replaced with "${CMAKE_PROGRAM}" -E copy_if_different in all previous usage locations.