Commit graph

17911 commits

Author SHA1 Message Date
Andreas Kling
dc8817638e LibJS: Only update anonymous function names when necessary
Previously we would generate function names for anonymous functions
on every AssignmentExpression, even if we weren't assigning a function.

We were also setting names of anonymous functions in arrays, which is
apparently a SpiderMonkey specific behavior not supported by V8, JSC
or required by ECMA262. This patch removes that behavior.

This is a huge performance improvement on the CanvasCycle demo! :^)
2021-03-21 21:39:39 +01:00
Andreas Kling
f89c479358 profile: Add -a option as an alias for "-p -1" (all processes) 2021-03-21 16:02:11 +01:00
Andreas Kling
1603623772 LibJS: Move AST node stack from VM to Interpreter 2021-03-21 16:02:11 +01:00
Idan Horowitz
b3b8c01ebf LibCompress: Convert GzipDecompressor from recursive to iterative
This way a gzip compressed file that contains a large amount of small
blocks wont cause a stack overflow.
2021-03-21 15:46:35 +01:00
Linus Groh
00bbe76c94 MenuApplets: Remove unused .gitignore files
These are not needed since the switch to CMake and out-of-tree builds.
2021-03-21 15:11:48 +01:00
Liav A
6440beeffe Kernel/AHCI: Shift the call to reset() for the WorkQueue 2021-03-21 13:41:09 +01:00
Liav A
2ae9de77bb Kernel/AHCI: Reorder complete_current_request
Clear the m_current_request before signalling the end of request.
2021-03-21 13:41:09 +01:00
Liav A
cfc2f33dcb Kernel/AHCI: Add a boot argument to force AHCI to operate on IRQ 11
As a compromise, if the fimrware decided to set the IRQ line to be 7,
or something else we can't deal with, the user can simply force the code
to work with IRQ 11, with the boot argument "force_ahci_irq_11" being
set to "on".
2021-03-21 13:41:09 +01:00
Liav A
36a82188a8 Kernel/PCI: Allow to set the PCI IRQ line of a device
This will be used later by the AHCI code to set the IRQ line to be 11,
if hardware by mistake changed the value to be something we can't deal
with.
2021-03-21 13:41:09 +01:00
Liav A
6c03fdc1ef Kernel/AHCI: Don't set the PRDBC when accessing the device
This resulted in fatal error when trying to write to real hard drive
I tested, so we only set the counts in the scatter/gather list later.
2021-03-21 13:41:09 +01:00
Liav A
0b1fa97b30 Kernel/AHCI: Use interrupts for IO operations
Instead of polling if the device ended the operation, we can just use
interrupts for signalling about end of IO operation.
In similar way, we use interrupts during device detection.

Also, we use the new Work Queue mechanism introduced by @tomuta to allow
better performance and stability :)
2021-03-21 13:41:09 +01:00
Liav A
21bb7fd5c9 Kernel/AHCI: Add a method to get raw interrupt enable register 2021-03-21 13:41:09 +01:00
Tom
20cccda731 Kernel: Add simplistic work queues
We can't use deferred functions for anything that may require preemption,
such as copying from/to user or accessing the disk. For those purposes
we should use a work queue, which is essentially a kernel thread that
may be preempted or blocked.
2021-03-21 13:41:09 +01:00
Liav A
314f04b896 Kernel: Fix undefined behavior due to shifting out of bounds 2021-03-21 13:41:09 +01:00
Cesar Torres
b7d726e226 LibGUI: Fix crash when getting text of selected line after a line delete 2021-03-21 11:45:22 +01:00
Andreas Kling
d0664ce6c9 LibJS: Don't punish large arrays with generic indexed property storage
This patch rethinks the way indexed property storage works:

Instead of having a cut-off point at 200 elements where we always move
to generic property storage, we now allow arrays to stay in simple mode
as long as we don't create a gap/hole larger than 200 elements.

We also simplify generic storage to only have a hash map (for now)
instead of juggling both a vector and a hash map. This is mostly fine
since the vast majority of arrays get to stay simple now.

This is a huge speedup on anything that uses basic JS arrays with more
than 200 elements in them. :^)
2021-03-21 11:37:10 +01:00
Itamar
dee0c46c9b HackStudio: Display warning when opening binary files
We now detect and display a warning when we can't render the text of an
opened file.

Closes #5062.
2021-03-21 09:46:21 +01:00
Itamar
3cc7b00e24 LibGUI: Allow TextDocument::set_text to fail 2021-03-21 09:46:21 +01:00
Brendan Coles
f8c603fe7e LibELF: DynamicObject: set for_each_symbol/for_each_dynamic_entry public 2021-03-21 09:40:30 +01:00
Oleg
d0e7d45b85
LibGfx: Don't use target's alpha if it doesn't have one (#5888) 2021-03-21 09:40:14 +01:00
aabajyan
8560108717 LibWeb: Add support to view JSON.
Extremely small change, all I did is check for application/json,
mime type and parsed it as text.
2021-03-21 09:37:51 +01:00
Luke
31f7296934 LibWeb: Add legacy Image factory function 2021-03-21 09:37:25 +01:00
Linus Groh
c183ebc723 LibWeb: Only call page_did_change_title() from main frame
Otherwise an embedded iframe will override the page title in the
browser, for example.
2021-03-21 09:36:37 +01:00
Linus Groh
ae95ed5ddd LibJS: Append first sparse element to packed elements in take_first()
Otherwise we continuously lose the first sparse element (at index
SPARSE_ARRAY_THRESHOLD) without noticing, as we overwrite all indices
with the value at index+1.

Fixes #5884.
2021-03-21 09:35:47 +01:00
Hendiadyoin1
611b3c2c49 Kernel: Make TSS use in thread generic
This way it won't be architecture dependent
2021-03-21 09:35:23 +01:00
Hendiadyoin1
ce4f43a192 Kernel::x86_64: Re-copy boot.S and add longmode in
Now we should have the posibility to run in longmode, after enabling it
in the gdt
2021-03-21 09:35:23 +01:00
Hendiadyoin1
61240aaad3 Kernel: Make IDT Entries their one struct
This is to make them a bit more transparent, and with a bit of Compiler
magic we get the 64-bit implementation in the same package
2021-03-21 09:35:23 +01:00
Hendiadyoin1
0d934fc991 Kernel::CPU: Move headers into common directory
Alot of code is shared between i386/i686/x86 and x86_64
and a lot probably will be used for compatability modes.
So we start by moving the headers into one Directory.
We will probalby be able to move some cpp files aswell.
2021-03-21 09:35:23 +01:00
Hendiadyoin1
5a8cc07485 Kernel: Add TSS64 and Desciptor for 64-bit 2021-03-21 09:35:23 +01:00
Hendiadyoin1
009b196a04 LibC: Add x86_64 Registers 2021-03-21 09:35:23 +01:00
Hendiadyoin1
60caffb113 AK+LibC: Make %p specifier Architecture Independent
We were using u32 as a pointer representation and not FlatPtr
2021-03-21 09:35:23 +01:00
Hendiadyoin1
f673f08bec AK: Fix integer_sequence_generate_array
It was for some reason Architecture dependent.
Now we use size_t instead of unsinged long
2021-03-21 09:35:23 +01:00
Hendiadyoin1
0b04363b01 Kernel: Renable UHCIController on 64-bit processors 2021-03-21 09:35:23 +01:00
Hendiadyoin1
7ba3c22931 AK: Add a Ptr32 type to handle fixed sized pointers
This will be used to fix the UHCI Controller, which relies on
the pointer-size being 32-bit
2021-03-21 09:35:23 +01:00
Jaan
226e063207 Ports: vitetris 2021-03-21 09:33:35 +01:00
Andreas Kling
0a911178ce LibJS: Add fast_is<T> for StringObject and GlobalObject
Both of these are quite hot in profiles.
2021-03-19 23:12:47 +01:00
tuqqu
43f0c92bcd LibJS: Add Date methods: setHours, setMinutes, setSeconds, setMilliseconds 2021-03-19 23:08:21 +01:00
Idan Horowitz
974a981ded LibCompress: Convert DeflateDecompressor from recursive to iterative
This way a deflate blob that contains a large amount of small blocks
wont cause a stack overflow.
2021-03-19 23:03:04 +01:00
thankyouverycool
b02be11a6f LibGUI: Add corresponding padding to ListView content width
Fixes clipped text in list items
2021-03-19 22:56:36 +01:00
thankyouverycool
cfaf97a463 LibGUI: Walk all visible rows when updating TreeView column sizes
Previously only rows containing root nodes were considered. Fixes
offset content drift and columns failing to resize in multi-column
TreeViews
2021-03-19 22:56:36 +01:00
thankyouverycool
bf86676272 LibGUI: Support double-click resizing multi-column TreeViews 2021-03-19 22:56:36 +01:00
Itamar
2365e06b12 Kernel: Set TLS-related members of Process after loading static program
We previously ignored these values in the return value of
load_elf_object, which causes us to not allocate a TLS region for
statically-linked programs.
2021-03-19 22:55:53 +01:00
Itamar
4cb38f6dd8 CI: Don't fail check-symbols if symbol is defiend somewhere else 2021-03-19 22:55:53 +01:00
Itamar
ae67cabe11 CMake: Make libc.a self-contained
Previously, libc.a contained undefined symbols from ssp and libsystem,
which caused static compilation to fail.

We now generate libc.a with a custom CMake rule that combines all
object files from libc, ssp and libsystem to form libc.a

Closes #5758.
2021-03-19 22:55:53 +01:00
tuqqu
ad40c5f9a9 LibJS: Support month and day arguments of Date.setFullYear 2021-03-19 22:55:36 +01:00
Andreas Kling
d48666489c Kernel: Make FileDescription::seek() return KResultOr<off_t>
This exposed a bunch of places where errors were not propagated,
so this patch is forced to deal with them as well.
2021-03-19 10:44:25 +01:00
Brendan Coles
ed1789cc04 readelf: Add --checksec flag to display security hardening info 2021-03-19 09:17:17 +01:00
Brendan Coles
215375f2a5 Build: Enable --noexecstack
Build ELF executables with a zero length `GNU_STACK`
program header flagged non-executable.

The stack is never executable on SerenityOS regardless
of whether the `GNU_STACK` header is specified.

Specifically defining this header is more explicit,
as absence of this header implies an executable stack
on other systems (Linux).
2021-03-19 09:16:53 +01:00
Edgar Araújo
5df34f6567 TextEditor: Exit program when file is not opened
When trying to open files not permitted by the user, display the error
message and exit.
2021-03-19 09:15:43 +01:00
Jean-Baptiste Boric
67f01fd82e checksum: Don't read the entire input file in memory
Unsurprisingly, this doesn't work too well if the input file is in the
gigabyte range.
2021-03-19 09:15:19 +01:00