Commit Graph

23257 Commits

Author SHA1 Message Date
Andreas Kling
e28b22c316 PixelPaint: Make BrushTool only invalidate the modified area :^) 2021-07-07 13:01:20 +02:00
Andreas Kling
f33edd33cc LibGfx: Small improvements to fill_rect_with_checkerboard()
- Clamp the checkerboard scanline prologue length to the total width
  of the (clipped) rect we're filling.

- Use fast_u32_fill() for the prologue and epilogue as well.
2021-07-07 13:01:20 +02:00
Andreas Kling
7cbcf5a5fa PixelPaint: Make PenTool only invalidate the modified area :^) 2021-07-07 13:01:20 +02:00
Andreas Kling
f7053059c9 PixelPaint: Allow partial invalidation of Layer and Image
Let's give ourselves the tools needed to update less than the entire
image every time we paint.

This patch adds plumbing so that Layer invalidations have a modified
rect that gets passed on to Image, and then on to ImageEditor.
2021-07-07 13:01:20 +02:00
Andreas Kling
b7e551b164 LibGUI: Make Widget ignore paint events that don't intersect it
LibGUI widgets fully contain their child widgets, so there's no pass
the paint event on to our children if we get a paint event that doesn't
intersect with our rect.

While Gfx::Painter was already dutifully clipping out any attempts at
painting, this avoids even more pointless work.
2021-07-07 13:01:20 +02:00
Gunnar Beutner
13a14b3112 LibELF: Fix loading libs with a .text segment that's not page-aligned
It's perfectly acceptable for the segment's vaddr to not be page aligned
as long as the segment itself is page-aligned. We'll just map a few more
bytes at the start of the segment that will be unused by the library.

We didn't notice this problem because because GCC either always uses
0 for the .text segment's vaddr or at least aligns the vaddr to the
page size.

LibELF would also fail to load really small libraries (i.e. smaller than
4096 bytes).
2021-07-07 11:53:17 +02:00
Gunnar Beutner
4591c00328 DynamicLoader: Don't use LibELF to do the initial relocations
Using LibELF to do the initial relocations doesn't work when building
SerenityOS with Clang. We seem to be accessing a global symbol that
hasn't been relocated yet somewhere along the path to
ELF::DynamicObject::create().
2021-07-07 11:53:17 +02:00
Idan Horowitz
c351b4ad0d LibJS: Stop using a native property for Array lengths
Specifically, replace it with a specification-based implementation that
overrides the internal methods that interact with the length property
instead.
2021-07-07 10:14:44 +01:00
Idan Horowitz
fff112c8a3 LibJS: Add missing spec link to ValidateAndApplyPropertyDescriptor 2021-07-07 10:14:44 +01:00
Edwin Hoksberg
99328e1038 Kernel+KeyboardSettings: Remove numlock syscall and implement ioctl 2021-07-07 10:44:20 +02:00
Edwin Hoksberg
385e2ccb66 Kernel: Add keyboard ioctl to get num/caps lock state 2021-07-07 10:44:20 +02:00
Tom
864b50b5c2 Kernel: Do not hold spinlock while touching user mode futex values
The user_atomic_* functions are subject to the same rules as
copy_from/to/user, which may require preemption.
2021-07-07 10:05:55 +02:00
Tom
7593418b77 Kernel: Fix futex race that could lead to thread waiting forever
There is a race condition where we would remove a FutexQueue from
our futex map and in the meanwhile another thread started to queue
itself into that very same futex, leading to that thread to wait
forever as no other wake operation could discover that removed
FutexQueue.

This fixes the problem by:
* Tracking imminent waits, which prevents a new FutexQueue from being
  deleted that a thread will wait on momentarily
* Atomically marking a FutexQueue as removed, which prevents a thread
  from waiting on it before it is actually removed from the futex map.
2021-07-07 10:05:55 +02:00
Idan Horowitz
dd27490ee1 LibJS: Throw if the trap result of OwnPropertyKeys contains duplicates 2021-07-07 01:38:10 +01:00
Idan Horowitz
d577678658 LibJS: Add a name property to the proxy revoker anonymous function
As per the specification this should an empty string.
2021-07-07 01:38:10 +01:00
Linus Groh
5319694510 js: Implement pretty-printing of Temporal.TimeZone objects 2021-07-07 00:42:01 +01:00
Linus Groh
6cd16eceb3 LibJS: Implement Temporal.now.timeZone() 2021-07-07 00:42:01 +01:00
Linus Groh
265e89367e LibJS: Start implementing Temporal.TimeZone
Here we got our first Temporal object :^)
This patch adds the TimeZone object itself, its constructor and
prototype (currently empty), and a bunch of required abstract operations
2021-07-07 00:42:01 +01:00
Linus Groh
6735353b96 LibJS: Add preparation for Temporal constructors and prototypes
Add a JS_ENUMERATE_TEMPORAL_OBJECTS macro and use it to generate:

- Forward declarations
- CommonPropertyNames class name members
- Constructor and prototype GlobalObject members, getters, visitors,
  and initialize_constructor() calls
2021-07-07 00:42:01 +01:00
Linus Groh
7da1fcb2ef LibJS: Add the Temporal.now namespace object
This will be home to various functions:

- Temporal.now.timeZone()
- Temporal.now.instant()
- Temporal.now.plainDateTime()
- Temporal.now.plainDateTimeISO()
- Temporal.now.zonedDateTime()
- Temporal.now.zonedDateTimeISO()
- Temporal.now.plainDate()
- Temporal.now.plainDateISO()
- Temporal.now.plainTimeISO()
2021-07-07 00:42:01 +01:00
Linus Groh
8269921212 LibJS: Add the Temporal namespace object :^)
Currently empty, but we gotta start somewhere! This is the start of
implementing the Temporal proposal (currently stage 3).

I have decided to start a new subdirectory (Runtime/Temporal/) as well
as a new C++ namespace (JS::Temporal) for this so we don't have to
prefix all the files and classes with "Temporal" - there will be a lot.

https://tc39.es/proposal-temporal/
2021-07-07 00:42:01 +01:00
ngc6302h
a39ec19cd7 Kernel: Fix kernel crash when remote peer resets unexpectedly 2021-07-07 01:18:25 +02:00
Linus Groh
15070b76b3 js: Convert to east const 2021-07-06 23:58:50 +01:00
Hendi
37c4fbb6ca LibJS: Don't hoist functions under certain circumstances
When a lexical declaration with the same name as a function exists,
the function is not hoisted (annex B).
2021-07-06 22:55:16 +01:00
Timothy Flynn
e0d26fff8c LibJS: Replace strings with the search value coerced to a string
This only causes 1 new test262 test to pass. Other tests that rely on
this coercion fail due to receiving an unexpected value for 'this' when
invoking a functional replacement. For example:

    String/prototype/replaceAll/replaceValue-call-matching-empty.js

Receives 'undefined' for 'this' in the functional replacement invocation
but is expected to receive the global 'this'.
2021-07-06 22:33:17 +01:00
Timothy Flynn
81fec49ac3 LibJS: Evaluate replacement value before searching source string
The String.prototype.replace spec requires evaluating the replacement
value (if it is not a function) before searching the source string.

Fixes 4 test262 tests.
2021-07-06 22:33:17 +01:00
Timothy Flynn
65003241e4 LibRegex: Allow dollar signs in ECMA262 named capture groups
Fixes 1 test262 test.
2021-07-06 22:33:17 +01:00
Max Wipfli
d3a2e492fb Documentation: Document the ConfigureComponents utility
This adds documentation for the ConfigureComponents utility to the build
instructions.
2021-07-06 21:54:51 +02:00
Max Wipfli
2d71eaadcd Meta: Add the ConfigureComponents utility
This adds a utility program which is essentially a command generator for
CMake. It reads the 'components.ini' file generated by CMake in the
build directory, prompts the user to select a build type and optionally
customize it, generates and runs a CMake command as well as 'ninja
clean' and 'rm -rf Root', which are needed to properly remove system
components.

The program uses whiptail(1) for user interaction.
2021-07-06 21:54:51 +02:00
Linus Groh
24c490c520 LibJS: Remove unused Lexer/Parser includes from GlobalObject.cpp 2021-07-06 18:41:24 +01:00
Idan Horowitz
5e621e494f LibJS: Implement Object.getOwnPropertyDescriptors() 2021-07-06 18:41:15 +01:00
Idan Horowitz
0f91883b17 LibJS: Rename ObjectConstructor::{define_property_ => define_property}
As the non-standard helper define_property is now removed, this doesnt
clash with it anymore.
2021-07-06 18:41:15 +01:00
Gunnar Beutner
148679d1b5 Ports: Update gcc patch to match the toolchain 2021-07-06 19:08:22 +02:00
Gunnar Beutner
d86275d271 Kernel+Toolchain: Remove the kernel-specific toolchain
This is no longer necessary now that the kernel doesn't use libsupc++
anymore.
2021-07-06 19:08:22 +02:00
Gunnar Beutner
67f0c0d5f0 Kernel+LibELF: Don't demangle symbols in the kernel
Instead we should just generate kernel.map in such a way that it already
contains demangled symbols.
2021-07-06 19:08:22 +02:00
Liav A
8e8a5680d5 Kernel/x86_64: Print if machine doesn't support x86_64 mode
We drop to real mode and use two BIOS calls to do this.
2021-07-06 19:01:27 +02:00
Idan Horowitz
7d40987ab6 Meta: Add a note about commit hooks to the contribution guide
These are pretty useful but are not documented anywhere, so this should
fix that :^)
2021-07-06 17:32:46 +01:00
Linus Groh
83f61748a5 LibJS: Don't treat 2^32 - 1 as numeric PropertyName
10.4.2 Array Exotic Objects
    https://tc39.es/ecma262/#sec-array-exotic-objects

    A String property name P is an array index if and only if
    ToString(ToUint32(P)) equals P and ToUint32(P) is not the same value
    as 𝔽(2^32 - 1).
2021-07-06 17:29:12 +01:00
Linus Groh
47bd25a2f1 LibJS: Make Value::as_u32() slightly less broken
Still a horrible mess, but at least it can actually return numbers > i32
max now.
2021-07-06 17:29:12 +01:00
Linus Groh
30fe0529bd LibJS: Fix second argument passed to Proxy [[Call]] trap (thisArgument) 2021-07-06 17:29:12 +01:00
LuK1337
f15ad9523d LibGUI: Fix go_upwards_instead check in ComboBox
This change addresses an issue where ComboBox list window would always
be drawn upwards if the number of elements is lower or equal 3.
2021-07-06 17:26:50 +02:00
Sergey Bugaev
d91119ba78 test-pthread: Add semaphore tests 2021-07-06 17:25:34 +02:00
Sergey Bugaev
5aa629717e LibPthread: Fix some assertions 2021-07-06 17:25:34 +02:00
Sergey Bugaev
78f5c4a4c2 LibPthread: Fix ordering
It would be enough to use relaxed ordering here if it weren't for
the mutex, which we also need to store and retrieve. To ensure the
pthread_cond_broadcast() call sees the store, use release and acquire
as appropriate. Thankfully, both of these are on the slow paths.
2021-07-06 17:25:34 +02:00
Sergey Bugaev
30caa33f7e LibC: Only set owner on recursive mutexes
This lets us skip the gettid() calls on fast paths.

Also, verify that futex_wake() succeeds.
2021-07-06 17:25:34 +02:00
Andrew Kaster
d0447f23b8 Tests+Base: Convert stack-smash to be LibTest based and stop skipping it
Now that the test is converted to be LibTest based, we can remove it
from the exclude list in /home/anon/.config/Tests.ini.

Prior to this it would crash and fail because it was signaled instead of
returning normally with exit code 0.
2021-07-06 17:22:45 +02:00
Andrew Kaster
f0d562131f Tests: Generate data in memory for TestXSV benchmark case
The actual data file for this benchmark was never actually committed to
the repository, so let's generate 100k identical lines in memory to be
the fairly large data for this test instead.
2021-07-06 17:22:45 +02:00
Andrew Kaster
b7ae561945 LibTest: Clear core dump flag for CrashTest child processes
Because these processes are expected to crash, generating a core dump
from them and throwing up a CrashReporter window is less helpful than
it is distracting while running many tests at a time.

Use the prctl for controlling the core dump-able flag to tell the kernel
we don't want core dumps from these processes. Note that because we also
build LibTest for Lagom, we have to check for MacOS which doesn't
support prctl(PR_SET_DUMPABLE).
2021-07-06 17:22:45 +02:00
Andrew Kaster
e4013f6cc6 Tests: Set a default font in BenchmarkGfxPainter to prevent crashes
After the changes to LibGfx to make default font management handled in
WindowServer instead of each GUI application to allow for global font
broadcasts, the two LibGfx tests broke. The non-benchmark was fixed in
8f96d2, but the benchmark was left in the dust because nobody really
runs it manually :^(
2021-07-06 17:22:45 +02:00
Andrew Kaster
ad0b8b42eb Base: Pass show-progress=false to run-tests to avoid confusing CI
We pass this to test-js, and since they share some common code, it makes
sense to pass it to run-tests as well. This prevents the OSC 9 escape
sequences from being emitted when running tests via the script.
2021-07-06 17:22:45 +02:00