Commit graph

40401 commits

Author SHA1 Message Date
Linus Groh
f0b793db74 LibJS: Replace GlobalObject with VM in RegExp AOs [Part 9/19] 2022-08-23 13:58:30 +01:00
Linus Groh
d74f8039eb LibJS: Replace GlobalObject with VM in Promise AOs [Part 8/19] 2022-08-23 13:58:30 +01:00
Linus Groh
ccdfa2320c LibJS: Replace GlobalObject with VM in Iterator AOs [Part 7/19] 2022-08-23 13:58:30 +01:00
Linus Groh
ae9e031f56 LibJS: Replace GlobalObject with VM in Reference AOs [Part 6/19] 2022-08-23 13:58:30 +01:00
Linus Groh
275a7a0c0a LibJS: Replace GlobalObject with VM in Environment AOs [Part 5/19] 2022-08-23 13:58:30 +01:00
Linus Groh
a022e548b8 LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
This is where the fun begins. :^)
2022-08-23 13:58:30 +01:00
Linus Groh
f6c4a0f5d0 LibJS: Replace GlobalObject with VM in PrototypeObject AOs [Part 3/19] 2022-08-23 13:58:30 +01:00
Linus Groh
694f66b5ca LibJS: Replace GlobalObject with VM in Temporal AOs [Part 2/19] 2022-08-23 13:58:30 +01:00
Linus Groh
f9705eb2f4 LibJS: Replace GlobalObject with VM in Intl AOs [Part 1/19]
Instead of passing a GlobalObject everywhere, we will simply pass a VM,
from which we can get everything we need: common names, the current
realm, symbols, arguments, the heap, and a few other things.

In some places we already don't actually need a global object and just
do it for consistency - no more `auto& vm = global_object.vm();`!

This will eventually automatically fix the "wrong realm" issue we have
in some places where we (incorrectly) use the global object from the
allocating object, e.g. in call() / construct() implementations. When
only ever a VM is passed around, this issue can't happen :^)

I've decided to split this change into a series of patches that should
keep each commit down do a somewhat manageable size.
2022-08-23 13:58:30 +01:00
Linus Groh
999da617c5 LibJS: Remove GlobalObject from VM::this_value()
This is a continuation of the previous six commits.

The global object is only needed to return it if the execution context
stack is empty, but that doesn't seem like a useful thing to allow in
the first place - if you're not currently executing JS, and the
execution context stack is empty, there is no this value to retrieve.
2022-08-23 13:58:30 +01:00
Linus Groh
f3117d46dc LibJS: Remove GlobalObject from VM::throw_completion()
This is a continuation of the previous five commits.

A first big step into the direction of no longer having to pass a realm
(or currently, a global object) trough layers upon layers of AOs!
Unlike the create() APIs we can safely assume that this is only ever
called when a running execution context and therefore current realm
exists. If not, you can always manually allocate the Error and put it in
a Completion :^)

In the spec, throw exceptions implicitly use the current realm's
intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23 13:58:30 +01:00
Linus Groh
5398dcc55e LibJS: Remove GlobalObject from execute() and related AST functions
This is a continuation of the previous four commits.

Passing a global object here is largely redundant, we definitely need
the interpreter but can get the VM and (later) current active realm from
there - and also the global object while we still need it, although I'd
like to remove Interpreter::global_object() in the future.

This now matches the bytecode interpreter's execute_impl() functions.
2022-08-23 13:58:30 +01:00
Linus Groh
e992a9f469 LibJS+LibWeb: Replace GlobalObject with Realm in Heap::allocate<T>()
This is a continuation of the previous three commits.

Now that create() receives the allocating realm, we can simply forward
that to allocate(), which accounts for the majority of these changes.
Additionally, we can get rid of the realm_from_global_object() in one
place, with one more remaining in VM::throw_completion().
2022-08-23 13:58:30 +01:00
Linus Groh
b99cc7d050 LibJS+LibWeb: Replace GlobalObject with Realm in create() functions
This is a continuation of the previous two commits.

As allocating a JS cell already primarily involves a realm instead of a
global object, and we'll need to pass one to the allocate() function
itself eventually (it's bridged via the global object right now), the
create() functions need to receive a realm as well.
The plan is for this to be the highest-level function that actually
receives a realm and passes it around, AOs on an even higher level will
use the "current realm" concept via VM::current_realm() as that's what
the spec assumes; passing around realms (or global objects, for that
matter) on higher AO levels is pointless and unlike for allocating
individual objects, which may happen outside of regular JS execution, we
don't need control over the specific realm that is being used there.
2022-08-23 13:58:30 +01:00
Linus Groh
5dd5896588 LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions
This is a continuation of the previous commit.

Calling initialize() is the first thing that's done after allocating a
cell on the JS heap - and in the common case of allocating an object,
that's where properties are assigned and intrinsics occasionally
accessed.
Since those are supposed to live on the realm eventually, this is
another step into that direction.
2022-08-23 13:58:30 +01:00
Linus Groh
ecd163bdf1 LibJS+LibWeb: Replace GlobalObject with Realm in object constructors
No functional changes - we can still very easily get to the global
object via `Realm::global_object()`. This is in preparation of moving
the intrinsics to the realm and no longer having to pass a global
object when allocating any object.
In a few (now, and many more in subsequent commits) places we get a
realm using `GlobalObject::associated_realm()`, this is intended to be
temporary. For example, create() functions will later receive the same
treatment and are passed a realm instead of a global object.
2022-08-23 13:58:30 +01:00
Linus Groh
4c300cc5e8 LibJS: Fix the prototype of AsyncFunctionDriverWrapper's Promise base 2022-08-23 13:58:30 +01:00
Linus Groh
8ceef031e8 LibWeb: Fix the prototype of a couple of WebAssembly prototype objects
Like any other regular, non-inheriting web platform prototype, the
prototype's prototype should be Object.prototype, not the global object.

Another reason to get rid of "global object (an object) + prototype
object (also an object)"-style APIs for allocation :^)
2022-08-23 13:58:30 +01:00
huttongrabiel
4806567f05 NetworkServer: Use Core::Stream instead of Core::File
As per the FIXME.
2022-08-23 13:37:21 +01:00
Hendiadyoin1
4e9313fa73 PixelPaint: Use Sqrt1_2 constant in EllipseTool instead of 1/1.41
This also demotes the constant to floats instead of doubles, because we
truncate it to int anyways and don't need the extra accuracy.
2022-08-23 13:35:15 +01:00
Tim Schumacher
a0820b205c Ports/SDL2_ttf: Update to 2.20.1 2022-08-23 13:30:48 +01:00
Tim Schumacher
4678028842 Ports/SDL2_net: Update to 2.2.0 2022-08-23 13:30:48 +01:00
Tim Schumacher
ebf713da60 Ports/SDL2_mixer: Update to 2.6.2 2022-08-23 13:30:48 +01:00
Tim Schumacher
1ce3b9ea48 Ports/SDL2_image: Update to 2.6.2 2022-08-23 13:30:48 +01:00
Tim Schumacher
831afe3c3d Ports/SDL2: Update to 2.24.0 2022-08-23 13:30:48 +01:00
Tim Schumacher
2e31a479c4 Ports/SDL2: Do an out-of-tree build
SDL 2.24.0 starts having include loops if we try to do an in-tree build
against its wishes, so let's not do that anymore.
2022-08-23 13:30:48 +01:00
Seal Sealy
ffe9a862f0 Ports: Add aclock port 2022-08-23 13:29:32 +01:00
djwisdom
f3cec9de75 Base: Add five new emojis
 - U+26A1 HIGH VOLTAGE
 - U+26AA WHITE CIRCLE
 - U+26AB BLACK CIRCLE
 - U+26BE BASEBALL
✉ - U+2709 ENVELOPE

Coverage: https://emoji.serenityos.net
2022-08-23 13:27:58 +01:00
Ryan Liptak
b4856a4070 Base: Add 5 new emojis
🌡 - U+1F321 THERMOMETER
🌞 - U+1F31E SUN WITH FACE
 - U+26C5 SUN BEHIND CLOUD
⛈ - U+26C8 CLOUD WITH LIGHTNING AND RAIN
🌪 - U+1F32A TORNADO
2022-08-23 13:27:40 +01:00
MacDue
50ab2de10e LibWeb: Remove done TODO and fix typo 2022-08-23 13:27:02 +01:00
MacDue
40ad8b793d LibWeb: Avoid infinite loops in background painting
Previously if `background-size` was 0px in any dimension we would
go into in infinite loop whilst painting.
2022-08-23 13:27:02 +01:00
Linus Groh
ae264c9143 CI: Install newer Bash via homebrew on macOS
The recently added generate-emoji-txt.sh script uses a Bash 4
substitution feature, causing CI to fail as macOS ships an ancient Bash
3.x. We'll want to use a more recent version anyway, so let's do that
instead of updading the script to older syntax.
2022-08-23 13:25:39 +01:00
networkException
2161f20aa6 LibGUI: Call on_segment_change handler from on_{click,focus_change}
The on_segment_change handler introduced in
a00fa793b3 was only getting called by
programmatically setting the segment, not by clicking a button or using
tab navigation.
2022-08-23 12:50:20 +02:00
networkException
c1c11df3b8 LibGUI: Don't call on_segment_change handler if the index did not change
This patch makes the handler's behavior closer to what can be expected
from it's name by not handling set_selected_segment if the segment is
already selected.
2022-08-23 12:50:20 +02:00
Samuel Bowman
91574ed677 Kernel: Fix boot profiling
Boot profiling was previously broken due to init_stage2() passing the
event mask to sys$profiling_enable() via kernel pointer, but a user
pointer is expected.

To fix this, I added Process::profiling_enable() as an alternative to
Process::sys$profiling_enable which takes a u64 rather than a
Userspace<u64 const*>. It's a bit of a hack, but it works.
2022-08-23 11:48:50 +02:00
electrikmilk
0abe4d8b97 Base: Add More Emojis
This adds 16 emojis, and improves the emoji for Wine Glass.
2022-08-23 09:36:49 +01:00
Xexxa
0d05569257 Base: Add more emoji
🫶🏿 - U+1FAF6 U+1F3FF Heart Hands: Dark Skin Tone
🫶🏾 - U+1FAF6 U+1F3FE Heart Hands: Medium-Dark Skin Tone
🫶🏽 - U+1FAF6 U+1F3FD Heart Hands: Medium Skin Tone
🫶🏼 - U+1FAF6 U+1F3FC Heart Hands: Medium-Light Skin Tone
🫶🏻 - U+1FAF6 U+1F3FB Heart Hands: Light Skin Tone
2022-08-23 06:59:46 +00:00
kleines Filmröllchen
4355a01455 LibCore: Fix deadlock in SharedSingleProducerCircularQueue
This deadlock would incorrectly change the queue from almost empty to
full on dequeue because someone else could empty the queue after we had
checked its non-emptyness. The test would deadlock on this, which
doesn't happen anymore.
2022-08-23 01:03:10 +02:00
MacDue
be9d3f9aa4 Base: Add an example linear-gradient with double-position color stops 2022-08-23 01:02:49 +02:00
MacDue
698717d102 LibWeb: Resolve double-position linear-gradient() color stops
These just resolve to an extra color stop.
Something like "red 10% 40%"  is just shorthand for "red 10%, red 40%".
2022-08-23 01:02:49 +02:00
MacDue
fa5c2183df LibWeb: Don't regenerate linear gradient data unless size changes
This is an easy check to add and seems like it makes things a
tiny bit smoother.
2022-08-23 01:02:49 +02:00
MacDue
de5d25ee44 LibWeb: Add missing checks to LinearGradientStyleValue::equals() 2022-08-23 01:02:49 +02:00
MacDue
3a1f8d714a LibWeb: Parse double-position linear-gradient() color stops
The only accepted syntax for these seems to be
<color> <length percentage> <length percentage>, no other order.

But that's just gathered from looking at other browsers as though
these are supported by all major browsers, they don't appear in
the W3C spec.
2022-08-23 01:02:49 +02:00
Anthony Iacono
ec3d8a7a18 Kernel: Remove unused Process::in_group() 2022-08-23 01:01:48 +02:00
Andreas Kling
434d77cd43 Kernel/ProcFS: Silently ignore attempts to update ProcFS timestamps
We have to override Inode::update_timestamps() for ProcFS inodes,
otherwise we'll get the default behavior of erroring with ENOTIMPL.
2022-08-23 01:00:40 +02:00
Andreas Kling
5307e1bf01 Kernel/SysFS: Silently ignore attempts to update SysFS timestamps
We have to override Inode::update_timestamps() for SysFS inodes,
otherwise we'll get the default behavior of erroring with ENOTIMPL.
2022-08-23 00:55:41 +02:00
Andreas Kling
ecf85875b5 PixelPaint: Disambiguate layer vs image actions in their names
Instead of having "Flip Horizontally" in both the Image and Layer menus,
we now have "Flip Image Horizontally" and "Flip Layer Horizontally".

This same concept applied to other, similar actions.
2022-08-22 21:55:19 +02:00
Andreas Kling
ac943c60ef PixelPaint: Add actions for flipping and rotating an individual layer 2022-08-22 21:55:19 +02:00
Andreas Kling
4491ef8ae6 PixelPaint: Relayout ImageEditor immediately when image rect changes
This avoids a jarring effect where we'd "snap" the image into place
upon the next resize event.
2022-08-22 21:55:19 +02:00
Andreas Kling
d7cf36ec6c PixelPaint: Create undo items for more editing actions 2022-08-22 21:55:19 +02:00