Commit graph

22660 commits

Author SHA1 Message Date
Gunnar Beutner
a0c1af4327 Kernel: Specify I/O size for BMIDEChannel 2021-06-28 15:55:00 +02:00
Gunnar Beutner
32840dfa17 Kernel: Implement more x86_64 context switching functionality 2021-06-28 15:55:00 +02:00
Gunnar Beutner
076692b1ef Kernel: Implement entry code for x86_64 interrupts
With this fixed we can now properly handle interrupts (e.g. timer
interrupts) on x86_64.
2021-06-28 15:55:00 +02:00
Gunnar Beutner
328d44e227 Kernel: Fix stack for new threads on x86_64
Unlike on x86 iretq always pops rsp and ss.
2021-06-28 15:55:00 +02:00
Idan Horowitz
8eb48039c9 LibJS: Bring Reflect.construct() closer to the specification
This includes checking that the target is a constructor, not just a
function, as well as switching the order of the list creation and
argument validation to match the specification, to ensure correct
exception throwing order.
2021-06-28 14:22:35 +01:00
Idan Horowitz
596324ae9c LibJS: Rewrite String.raw() closer to the specification
This includes not throwing a custom exception and using the
length_of_array_like abstract operation where required.
2021-06-28 13:27:13 +01:00
Andreas Kling
d1ffeaf66d LibJS: Use CreateUnmappedArgumentsObject for non-simple parameter lists
This patch implements the IsSimpleParameterList static semantics for
ordinary function objects.

We now also create an unmapped arguments object for callee contexts
with non-simple parameter lists, instead of only doing it in strict
mode. Covered by test262.
2021-06-28 12:18:58 +02:00
Idan Horowitz
e2e695bc9f LibJS: Add and use the %ThrowTypeError% intrinsic 2021-06-28 08:55:14 +01:00
Idan Horowitz
581f20e6f2 LibJS: Accept FlyStrings in the NativeFunction constructors
This makes the implicit run-time assertion in PropertyName::to_string()
into an explicit compile-time requirement, removes a wasteful FlyString
-> PropertyName -> FlyString construction from NativeFunction::create()
and allows setting the function name to a null string for anonymous
native functions.
2021-06-28 08:55:14 +01:00
Sahan Fernando
16eb0803fc Meta: Choose the QEMU display backend based on whats available 2021-06-28 07:01:11 +04:30
Idan Horowitz
a939ffc617 LibJS: Handle values close to -0.5 correctly in Math.round(x)
This is done by just using the built-in ceiling and subtracting from
the result if its in the 0.5 range.
2021-06-28 01:19:11 +01:00
Andreas Kling
9eed7444de LibJS: Implement the CreateUnmappedArgumentsObject abstract operation 2021-06-28 02:00:46 +02:00
Linus Groh
63a1275378 LibJS/Tests: Improve valueToString() output
This regressed recently and would only output a bunch of '[object Foo]',
the reason being that String(value) failed in some cases - which is
easily fixed by trying that first and using Object.prototype.toString()
as a fallback in the case of an exception :^)
2021-06-27 22:17:05 +01:00
Andreas Kling
844efde54b LibJS: Unbreak test-js test that depended on function object class name 2021-06-27 22:51:39 +02:00
Andreas Kling
cd53d046b2 LibJS: Fix typo "sweeped" => "swept" everywhere 2021-06-27 22:40:49 +02:00
Andreas Kling
1bd52ce789 LibJS: Stop qualifying AK::Function
Now that JS function objects are JS::FunctionObject, we can stop
qualifying AK::Function and just say "Function" everywhere. Nice. :^)
2021-06-27 22:40:49 +02:00
Ali Mohammad Pur
745a1dbb5d AK: Add and use the RemoveCVReference<T> type trait 2021-06-28 01:08:41 +04:30
Andreas Kling
c8270dbe2e LibJS: Rename ScriptFunction => OrdinaryFunctionObject
These are basically what the spec calls "ordinary function objects",
so let's have the name reflect that. :^)
2021-06-27 22:36:04 +02:00
Andreas Kling
ba9d5c4d54 LibJS: Rename Function => FunctionObject 2021-06-27 22:36:04 +02:00
Andrew Kaster
e389ae3c97 LibJS: Ensure shift values in shift_right are modded by 32
The unsigned shift right implementation was already doing this, but
the spec requires a mod32 of rhs before the shift for the signed shift
right implementation as well. Caught by UBSAN and oss-fuzz.
2021-06-27 22:35:37 +02:00
Andrew Kaster
1f2720ce0d LibJS: Avoid undefined static cast of negative values in to_u32
If the value we get after fmod in Value::to_u32 is negative, UBSAN
complains that -N is out of bounds for u32. An extra static cast to i64
makes it stop complaining. An alternative implementation could add 2^32
if the fmod'd value is negative. Caught by UBSAN and oss-fuzz.
2021-06-27 22:35:37 +02:00
Tom
091628202f WindowServer: Un-tile window if resizing warrants it
Since being tiled means we restrict rendering a window to the screen it
is on (so that we don't "bleed" into an adjacent screen), we need to
untile it if the window either can't fit into the screen, or it is
detached from the screen edges.
2021-06-27 22:35:12 +02:00
Linus Groh
d3fc8652c7 LibJS: Add content type check to IntegerIndexedElementSet()
Resolves a FIXME.
2021-06-27 21:01:07 +01:00
Linus Groh
e08702a235 LibJS: Add content type check to InitializeTypedArrayFromTypedArray()
Resolves a FIXME.
2021-06-27 21:01:02 +01:00
Linus Groh
d7750999b3 LibJS: Implement the TypedArray [[ContentType]] internal slot 2021-06-27 21:01:01 +01:00
Linus Groh
93bae37dd9 LibJS: Add 'is detached' check to InitializeTypedArrayFromTypedArray()
Resolves a FIXME.
2021-06-27 21:01:01 +01:00
Linus Groh
48e7fd52e7 LibJS: Make variables in InitializeTypedArrayFromTypedArray() match spec
This makes it easier to follow the code and compare it to the spec.
2021-06-27 21:01:01 +01:00
Linus Groh
abb5a1f05c LibJS: Add missing InitializeTypedArrayFromTypedArray() spec link
Also move the others outside of their functions.
2021-06-27 21:00:57 +01:00
Ali Mohammad Pur
37b0f55104 AK: Make the constexpr StringView methods actually constexpr
Also add some tests to ensure that they _remain_ constexpr.
In general, any runtime assertions, weirdo C casts, pointer aliasing,
and such shenanigans should be gated behind the (helpfully newly added)
AK::is_constant_evaluated() function when the intention is to write
constexpr-capable code.
a.k.a. deliver promises of constexpr-ness :P
2021-06-27 20:54:59 +01:00
Andreas Kling
67d1b28b97 FileManager: Pass launch origin rects to spawned programs
This makes GUI applications animate their initial window showing up
on screen. :^)
2021-06-27 19:38:11 +02:00
Andreas Kling
6a132d8672 WindowServer+LibGUI: Allow specifying a "launch origin" for new windows
The launch_origin_rect parameter to create_window() specifies where on
screen the window was launched from. It's optional, but if you provide
it, the new window will have a short wireframe animation from the origin
to the initial window frame rect.

GUI::Window looks for the "__libgui_launch_origin_rect" environment
variable. Put your launch origin rect in there with the format
"<x>,<y>,<width>,<height>" and the first GUI::Window shown by the app
will use that as the launch origin rect.

Also it looks pretty neat, although I'm sure we can improve it. :^)
2021-06-27 19:38:11 +02:00
Andreas Kling
75f870a93f WindowServer: Add a more generic mechanism for animations
This patch adds the WindowServer::Animation class, which represents
a simple animation driven by the compositor.

An animation has a length (in milliseconds) and two hooks:

- on_update: called whenever the animation should render something.
- on_stop: called when the animation is finished and/or stopped.

This patch also ports the window minimization animation to this new
mechanism. :^)
2021-06-27 19:38:11 +02:00
stelar7
1f33c517df Meta: Do not use gl=on if building in WSL 2021-06-27 15:48:08 +02:00
Gunnar Beutner
9ed051fe25 Kernel: Implement initializing threads on x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner
f285241cb8 Kernel: Rename Thread::tss to Thread::regs and add x86_64 support
We're using software context switches so calling this struct tss is
somewhat misleading.
2021-06-27 15:46:42 +02:00
Gunnar Beutner
eba33f82b8 Kernel: Reorder code a bit to clarify which #if block it belongs to 2021-06-27 15:46:42 +02:00
Gunnar Beutner
df530941cc Kernel: Implement safe_* memory access functions for x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner
79ab9cce18 Kernel: Clear segment registers on x86_64
They're supposedly unused but iretq doesn't like ss being non-zero.
2021-06-27 15:46:42 +02:00
Gunnar Beutner
9d9f20391d Kernel: Use macros for GDT indices instead of hardcoding the values 2021-06-27 15:46:42 +02:00
Gunnar Beutner
065c6c307d Kernel: Add support for interrupts on x86_64 2021-06-27 15:46:42 +02:00
Gunnar Beutner
233ef26e4d Kernel+Userland: Add x86_64 registers to RegisterState/PtraceRegisters 2021-06-27 15:46:42 +02:00
Gunnar Beutner
10ca7f18a7 Kernel: Fix declaration for struct TrapFrame
This is declared as a struct elsewhere.
2021-06-27 15:46:42 +02:00
Gunnar Beutner
324f72d02b Kernel: Fix incorrect flags for the GDT entries
The Sz (protected mode) bit should not be set for 64-bit GDT entries.
2021-06-27 15:46:42 +02:00
Ali Mohammad Pur
fd72597999 LibWeb: Make ExceptionOr capable of holding all error types in the spec
The WebIDL spec specifies a few "simple" exception types in addition to
the DOMException type, let's support all of those.
This allows functions returning ExceptionOr<T> to throw regular
javascript exceptions (as limited by the webidl spec) by returning a
`DOM::SimpleException { DOM::SimpleExceptionType::T, "error message" }`
which is pretty damn cool :^)
2021-06-27 12:49:49 +01:00
Ali Mohammad Pur
bda19a9ff3 AK: Add explicit Variant conversion operators
This allows converting between Variants of different types with less
pain.
2021-06-27 12:49:49 +01:00
Andreas Kling
dff3439ad0 Profiler: Cache the timeline histograms instead of recomputing on paint
There was an aggressive amount of work happening on every paint. :^)
2021-06-27 12:05:28 +02:00
Andreas Kling
f4090d46de Kernel: Don't kmalloc() for small (<=1024) dbgputstr() syscalls 2021-06-27 10:50:24 +02:00
Tom
a9906cfcd1 WindowServer: Try to auto-add unconfigured framebuffer devices
This will try to auto-add framebuffer devices that haven't been
explicitly configured to the right-hand side.
2021-06-27 09:46:27 +02:00
Tom
38af4c29e6 WindowServer: Coalesce flushing buffers into one ioctl() call
We regularily need to flush many rectangles, so instead of making many
expensive ioctl() calls to the framebuffer driver, collect the
rectangles and only make one call. And if we have too many rectangles
then it may be cheaper to just update the entire region, in which case
we simply convert them all into a union and just flush that one
rectangle instead.
2021-06-27 09:46:27 +02:00
Tom
56cd0f929e Kernel: Enable additional VirtIO displays only on first resolution set
Also, only allocate the amount of memory we actually need for the given
resolution.
2021-06-27 09:46:27 +02:00