Commit graph

22643 commits

Author SHA1 Message Date
Andreas Kling 49018553d3 LibJS+LibCrypto: Allow '_' as a numeric literal separator :^)
This patch adds support for the NumericLiteralSeparator concept from
the ECMAScript grammar.
2021-06-26 16:30:35 +02:00
Andreas Kling 527c639c1f LibJS: Fix spelling mistake in one of the syntax error descriptions 2021-06-26 16:25:11 +02:00
Idan Horowitz f3197faf39 CI: Increase the on-target tests timeout to 60 minutes from 30 minutes
This should help reduce the random test failures due to timeouts on
slower github actions runners.
2021-06-26 13:41:58 +01:00
Luke a1f3e711c0 LibJS: Add %TypedArray%.prototype.entries 2021-06-26 13:32:53 +01:00
Luke a6324481e1 LibJS: Add %TypedArray%.prototype.values 2021-06-26 13:32:53 +01:00
Luke fb43b778ab LibJS: Add %TypedArray%.prototype.keys 2021-06-26 13:32:53 +01:00
Luke 293974c1cb LibJS: Add TypedArray support to ArrayIterator
ArrayIteratorPrototype::next seems to implement CreateArrayIterator,
which is an issue for a separate PR.
2021-06-26 13:32:53 +01:00
Gunnar Beutner 787f80d114 Kernel: Specify -fno-pic when using -mcmodel=large
According to the gcc man page these are mutually exclusive and did
in fact cause problems when trying to get the address for asm labels
on x86_64.
2021-06-26 11:08:52 +02:00
Gunnar Beutner b9f6b40651 Kernel: Clean up create_signal_trampoline a bit
The types for asm_signal_trampoline and asm_signal_trampoline_end
were incorrect. They both point into the text segment but they're
not really functions.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 389bf82889 Kernel: Add CPUID flag for long mode
This isn't particularly useful because by the time we've entered
init() the CPU had better support x86_64 anyway. However this shows the
CPU flag in System Monitor - even in 32-bit mode.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 409b874514 Kernel: Ensure that the ProcessBase class is properly laid out on x86_64
Without this the ProcessBase class is placed into the padding for the
ProtectedProcessBase class which then causes the members of the
RefCounted class to end up without the first 4096 bytes of the Process
class:

BP 1, Kernel::Process::protect_data (this=this@entry=0xc063b000)
205     {
(gdb) p &m_ref_count
$1 = (AK::Atomic<unsigned int, (AK::MemoryOrder)5> *) 0xc063bffc

Note how the difference between 'this' and &m_ref_count is less than
4096.
2021-06-26 11:08:52 +02:00
Gunnar Beutner 9077c64d37 Kernel: Correct spelling mistake 2021-06-26 11:08:52 +02:00
Gunnar Beutner 078eeb7bb0 Kernel: Make addresses returned by kmalloc() properly aligned for x86_64 2021-06-26 11:08:52 +02:00
Gunnar Beutner 1e20dd2a45 Kernel: Add PML4T support for the PageDirectory class 2021-06-26 11:08:52 +02:00
Gunnar Beutner f5cd366006 Kernel: Fix memcpy and memset for x86_64
Those size_ts sure are growing up fast.
2021-06-26 11:08:52 +02:00
Gunnar Beutner c4acfdc0fb Kernel: Add slab allocator for 256 bytes
Our types are getting a tiny bit larger for x86_64 so we need another
slab allocator to deal with that.
2021-06-26 11:08:52 +02:00
Gunnar Beutner e52051903b Kernel: Fix off-by-one error in Processor::write_raw_gdt_entry 2021-06-26 11:08:52 +02:00
Gunnar Beutner f630299d49 Kernel: Add support for setting up a x86_64 GDT once in C++ land 2021-06-26 11:08:52 +02:00
Gunnar Beutner 29d9666e02 Kernel: Fix GDT limits
The GDT limits are inclusive, so for correctness we should subtract
one from the structs' size.
2021-06-26 11:08:52 +02:00
Andreas Kling ee4fc97038 LibJS: Align ObjectEnvironmentRecord member names with the spec
In the spec, object environments have a [[BindingObject]], so let's
call it the same thing in our implementation.
2021-06-26 10:39:16 +02:00
Andreas Kling 0f9038b732 LibJS: Remove unnecessary GlobalObject& member on global environment
We already store the GlobalObject& in a base class, so no need to also
store it in the subclass. :^)
2021-06-26 10:34:55 +02:00
Andreas Kling 6d7d8f3db9 LibJS: Create new object earlier in VM::construct()
Also make use of OrdinaryCreateFromConstructor() instead of setting
the prototype manually.

This fixes 2 function tests in test262. :^)
2021-06-26 00:04:54 +02:00
Tom 8fe52b8306 Meta: Force relative mouse coordinates with multiple screens
QEMU appears to always relay absolute mouse coordinates relative to the
screen that the mouse is pointed to, without any way for us to know
what screen it was. So, when dealing with multiple displays force using
relative coordinates only.
2021-06-25 23:54:37 +02:00
Linus Groh a59ba0e21f LibJS: Change PropertyName(i32) => template<Integral T> PropertyName(T)
Negative numeric properties are not a thing (and we even VERIFY()'d this
in the constructor). It still allows using types with a negative range
for now as we have various places using int for example (without
actually needing the negative range, but that's a different story).

u32 is the internal type of `m_number` already, so this now allows us to
leverage the full u32 range for numeric properties.
2021-06-25 22:01:23 +01:00
Linus Groh f4867572b7 LibJS: Change PropertyName(Symbol*) => PropertyName(Symbol&)
Requires a bunch of find-and-replace updates across LibJS, but
constructing a PropertyName from a nullptr Symbol* should not be
possible - let's enforce this at the compiler level instead of using
VERIFY() (and already dereference Symbol pointers at the call site).
2021-06-25 22:01:23 +01:00
Tom 3d5340d033 Meta: Add SERENITY_SCREENS environment variable
This allows specifying how many screens we should use. This also then
only enables virtio-gpu if more than one display is requested.

This also adds an environment variable SERENITY_QEMU_DISPLAY_BACKEND
which allows overriding the default qemu display backend, as it may
not be available.
2021-06-25 22:20:55 +02:00
Andreas Kling d436d6d565 LibJS: Rename ScriptFunction::m_parent_scope => m_environment
This is for the [[Environment]] slot so let's have a matching name. :^)
2021-06-25 21:22:37 +02:00
Andreas Kling 667bba2410 LibJS: Add the Function.[[ThisMode]] field
This is not a behavioral change in itself, just prep work for future
spec-compliance changes.
2021-06-25 21:15:04 +02:00
Andreas Kling b650d11dd3 LibJS: FunctionEnvironment.[[FunctionObject]] is the *invoked* function
We were setting the wrong [[FunctionObject]] on the environment when
going through ProxyObject and BoundFunction.
2021-06-25 20:38:43 +02:00
Andreas Kling 08d2ea3fac LibJS: Rename the context in Call/Construct ops to "callee context"
This matches what the spec calls them.
2021-06-25 20:38:43 +02:00
Andreas Kling 06787410ad LibJS: Make assertion in BindThisValue mirror the spec exactly :^) 2021-06-25 20:38:43 +02:00
Tom 8cfb4c82f0 WindowServer: Change rendering drag&drop to use the Overlay class
This enables flicker-free rendering.
2021-06-25 20:38:13 +02:00
Tom 84cab29c59 WindowServer: Change window geometry label to use the Overlay class
This enables flicker-free rendering.
2021-06-25 20:38:13 +02:00
Tom 8b26debda1 DisplaySettings: Show screen numbers when showing the Monitors tab
This will be helpful once we allow the user to rearrange the displays.
2021-06-25 20:38:13 +02:00
Tom 41859ad3fe WindowServer: Add an Overlay class for flicker-free overlay rendering
An Overlay is similar to a transparent window, but has less overhead
and does not get rendered within the window stack. Basically, the area
that an Overlay occupies forces transparency rendering for any window
underneath, which allows us to render them flicker-free.

This also adds a new API that allows displaying the screen numbers,
e.g. while the user configures the screen layout in DisplaySettings

Because other things like drag&drop or the window-size label are not
yet converted to use this new mechanism, they will be drawn over the
screen-number currently.
2021-06-25 20:38:13 +02:00
Tom 42cb38b71a WindowServer: Enhance simple shadow function to include optional frame
If the shadow bitmap contains portions of the frame then we need to
slightly tweak the logic dealing with very small width and/or height.
2021-06-25 20:38:13 +02:00
Sahan Fernando b9ad6058aa Kernel: Add VirtIOGPU graphics device 2021-06-25 19:26:30 +02:00
Sahan Fernando b569b2df35 Kernel: Don't clear VirtualConsoles when initializing
Instead of calling clear() for each virtual console we initialize, we
only call clear() when activating it from ConsoleManagement.
2021-06-25 19:26:30 +02:00
Sahan Fernando bab6fb76b7 WindowServer: Redraw screen when switching back from tty 2021-06-25 19:26:30 +02:00
Sahan Fernando ae5d961d97 Kernel: Pass TTY-switch keyboard combo to userspace 2021-06-25 19:26:30 +02:00
Sahan Fernando 4f53e52ca3 Kernel: Fix use after AK::move in Kernel::TimerQueue 2021-06-25 19:26:30 +02:00
Sahan Fernando 974e996d33 Userland: Add FB_FLUSH ioctl for fbdev 2021-06-25 19:26:30 +02:00
Sahan Fernando 34e9fa4d3b Kernel: Abstract FramebufferConsole away from contiguous physical range
Currently, Kernel::Graphics::FramebufferConsole is written assuming that
the underlying framebuffer memory exists in physically contiguous
memory. There are a bunch of framebuffer devices that would need to use
the components of FramebufferConsole (in particular access to the kernel
bitmap font rendering logic). To reduce code duplication, framebuffer
console has been split into two parts, the abstract
GenericFramebufferConsole class which does the rendering, and the
ContiguousFramebufferConsole class which contains all logic related to
managing the underling vm object.

Also, a new flush method has been added to the class, to support devices
that require an extra flush step to render.
2021-06-25 19:26:30 +02:00
Sahan Fernando cf1c8eb778 Kernel: Add Scheduler::is_initialized 2021-06-25 19:26:30 +02:00
Sam Atkins 8e9fb3766d FileManager: Add "Open in New Window" context menu action 2021-06-25 19:19:57 +02:00
Itamar e16c24bb95 HackStudio: Do not create a new LanguageClient unless needed
Previously, whenever Editor::set_document() was called, we destroyed
the previous LanguageClient instance of the editor and created a new
one.

We now check if the language of the existing LanguageClient matches the
new document, and if so we do not create a new LanguageClient instance.

This fixes an issue where doing "goto definition" would crash
HackStudio. This was probably introduced in 44418cb351.

The crash occurred because when doing "goto definition", we called a
AK::Function callback from the LanguageClient, which internally called
Editor::set_document().

Editor::set_document() destroyed the existing LanguageClient, which
cased a VERIFY in Function::clear() to fail because we were trying to
destroy the AK::Function object while executing inside it.
2021-06-25 18:58:34 +02:00
Itamar 7331b74731 LibGUI: Add TextEditor::has_document() 2021-06-25 18:58:34 +02:00
Itamar 743157348d HackStudio: Add LanguageClient::Language() getter 2021-06-25 18:58:34 +02:00
Itamar eecbcff6af AK: Add NOTE about VERIFY in Function::clear 2021-06-25 18:58:34 +02:00
kleines Filmröllchen 22d7e57955 LibAudio: Implement a basic FLAC loader
This commit adds a loader for the FLAC audio codec, the Free Lossless
Audio codec by the Xiph.Org foundation. LibAudio will automatically
read and parse FLAC files, so users do not need to adjust.

This implementation is bare-bones and needs to be improved upon.
There are many bugs, verbatim subframes and any kind of seeking is
not supported. However, stereo files exported by libavcodec on
highest compression setting seem to work well.
2021-06-25 20:48:14 +04:30