The user is not required to keep the object alive, this commit makes it
so the lifetime of these functions is extended to match the Wasm module
it is imported into.
Fixes the crash in #907.
(cherry picked from commit 1fa528b19fb4551ebc6b4d33b408e456ba367acc)
Previously, the fact that this wasn't accounted for could lead to a
crash when large messages were received.
(cherry picked from commit 34e465a67e41b82b276050dde0b4b321c2cf1b18)
Moves paint_table_borders() call into PaintableBox::paint() to make
scroll offset and clip rectangle of enclosing scrollable be applied
in ::before_paint().
(cherry picked from commit 2cc2646f5585e4a1f617ac809806bf05e8e515a4)
If setrlimit fails, let's just report the error rather than failing to
start the browser at all.
(cherry picked from commit cf25a06d6715c8ef699973db7634016f8659c9d7)
Adds additional padding to the end-side of the scrollable overflow
rectangle as necessary to enable a scroll position that satisfies
the requirements of `place-content: end` alignment.
(cherry picked from commit 963cf1c2c4e4b1cd482c41d6f673b7207bbcc067)
Previously, the legacy `-webkit-foo` properties would all be top of the
list, when they are generally not useful to inspect. Instead, put them
at the bottom, so that users can still see them if they want to, but
they're not in the way.
(cherry picked from commit 113b4da1df7ec65a8686af4e7b91e2f8d4114e2c)
The Inspector looks a bit nicer if we don't paint the horizontal scroll
bars unless we need to.
(cherry picked from commit 5c73a31b4f3e18acb783b6a5c6c9a479d2956de8)
Currently, the feel of scrolling containers in the Inspector is a bit
awkward. We make the entire split-view container scrollable, then we
absolutely position the tab control buttons to force them to not scroll.
The result is that the scroll bar is painted over the tab controls, and
the tab content that we actually want to scroll has to scroll under the
tab controls. This never looked quite right.
It was basically:
<div tab-container> <!-- Scrollable -->
<div tab-controls /> <!-- Pinned to not be scrollable -->
<div tab-content /> <!-- The part we actually want to scroll -->
</div>
This patch moves the "scrollability" to just the tab content. We then
don't need to go out of our way to ensure only the content is actually
scrollable.
So we now have:
<div tab-container> <!-- Not scrollable -->
<div tab-controls /> <!-- Not pinned, uses normal layout -->
<div tab-content /> <!-- Scrollable -->
</div>
(cherry picked from commit d2c775b0ca202aa9be81ab21b0c71a8f8ac005e3)
This patch moves the data members of URL to an internal URL::Data struct
that is also reference-counted. URL then uses a CopyOnWrite<T> template
to give itself copy-on-write behavior.
This means that URL itself is now 8 bytes per instance, and copying is
cheap as long as you don't mutate.
This shrinks many data structures over in LibWeb land. As an example,
CSS::ComputedValues goes from 3024 bytes to 2288 bytes per instance.
(cherry picked from commit 936b76f36e87a6d4cf267c15c95786ef677515fc)
This shrinks each instance of PercentageOr by 8 bytes and avoids virtual
dispatch when resolving calc() values. It's a win-win!
Many data structures shrink as a result. An example is ComputedValues
which goes from 3376 bytes to 3024 bytes per instance.
(cherry picked from commit c282138fd0b20604384b39bfc0a8c5f6ccab56bd)
This avoids padding the style value array, shrinking StyleProperties
from 4368 bytes to 2288 bytes per instance.
(cherry picked from commit b42b7c8dd02911504e6947fc2816b85220cdcf9f)
We were saving to source declarations for *every* property, even though
we only ever looked it up for animation-name.
This patch gets rid of the per-property source pointer and we now keep
a single pointer to the animation-name source only.
This shrinks StyleProperties from 6512 bytes to 4368 bytes per instance.
(cherry picked from commit c288bfb40453d4abe95af694dfc7c2175cd04a14)
We don't want to set the intrinsic Console object's client to non-top-
level clients, created for e.g. subframes. We also want to make sure the
Console client is updated if the top-level document has changed.
(cherry picked from commit 0e640f6f706e7682b8a0004945ef0ddec2d44988)
We explicitly stopped visting the map of documents to console clients in
commit 44659f2f2a to avoid keeping the
document alive. However, if nothing else visits the console clients, we
may set the top-level console client to a client that has been garbage
collected.
So instead of storing this map, just store the console client on the
document itself. This will allow the document to visit its client.
(cherry picked from commit 0a819e628eb296200b8b5e609b4936a1a4bf330f)
This will allow testing if they are for fragment parsing during methods
invoked from Document::initialize.
(cherry picked from commit c838ca78c81261e6111aa255c79e4a0599759c80)
Before, we would compute and store the output of each predictor,
then pick the best one, and then copy its data.
Now, we compute the output of each predictor but only compute its
score and do not store the predicted data. We then pick the best
one, and do a second pass that re-computes the output of the best
predictor, and stores it.
Instead of computing the output of the 5 different predictors, we now
compute the output of the 5 different predictors, and then the output of
one of them again. In exchange, we only write each output row once
instead of 5 times. (We also have to read the input row twice instead of
once, but the second time round it'll come from L1 or L2.)
Making the simplifying assumption that each predictor takes the same
time to compute, this increases compute to 6/5th, and reduces memory
bandwidth to 3/6th. (Before: 1 input row read, 5 output row writes;
after: 2 input row reads, 1 output row write.)
Produces exactly the same output, but is faster:
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 0
34.8 ms ± 0.9 ms -> 22.7 ms ± 0.8 ms (34.7% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 1
64.2 ms ± 4.9 ms -> 50.5 ms ± 0.5 ms (31.3% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 2
190.3 ms ± 1.6 ms -> 179.0 ms ± 2.8 ms (5.8% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 3
646.5 ms ± 4.7 ms -> 635.3 ms ± 4.4 ms (3.3% faster)
Compression level 2 is the default, so about a 6% speedup in practice.
`sips` still needs 49.9 ms ± 3.0 ms to convert sunset_retro.bmp to
sunset_retro.png at its default compression level 1.
We used to take 1.27x as long as sips, now we take 1.01x as long,
while producing a smaller output :^)
(For other, larger, input files sips is still faster and produces
smaller output.)
Takes
(cd Tests/LibGfx; ../../Build/lagom/bin/BenchmarkPNG)
from 59ms to 32ms on my system.
Adds AK::SIMD::bitselect() (modeled after the wasm SIMD equivalent),
and AK::SIMD::abs() implemented on top of it.
No behavior change.
Writes to SharedInodeVMObjects could cause a Protection Violation if a
page was marked as dirty by a different process.
This happened due to a combination of 2 things:
* handle_dirty_on_write_fault() was skipped if a page was already marked
as dirty
* when a page was marked as dirty, only the Region that caused the page
fault was remapped
This commit:
* fixes the crash by making handle_fault() stop checking if a page was
marked dirty before running handle_dirty_on_write_fault()
* modifies handle_dirty_on_write_fault() so that it always marks the
page as dirty and remaps the page (this avoids a 2nd bug that was
never hit due to the 1st bug)
Resolve a regression caused by 01e1af732b.
This unbreaks coredump generation, because we need to use the VFS root
context of the crashed process and not of the FinalizerTask, as it will
hold an empty VFS root context that is assigned to kernel processes.
This commit adds a new test case which carries out the following steps:
* write() to a block of an ext2 file, verify the write() was successful
* read() the same block back, verify the read() was successful
* verify that the data from the read() is identical to the data that was
written in the write()
The test runs the above steps on the following blocks of an ext2 file:
* the first and last direct blocks
* the first and last singly indirect blocks
* the first and last doubly indirect blocks
* the first and last triply indirect blocks
Running in the microvm doesn't work anymore, since we removed IDE
support. Currently, we only support PCI(e)-attached storage devices,
which are not compatible with the microvm, as it doesn't support PCI(e)
at all.
Bulk transfers also use Normal TRBs, so move the reusable normal TRB
setup code from submit_async_interrupt_transfer into a new function
prepare_normal_transfer.
submit_bulk_transfer and submit_async_interrupt_transfer use this
function and then either block on the completion or submit it
asynchronously and wrap it into a PeriodicPendingTransfer.
Produces exactly the same output, but a bit faster.
The speedup is relatively bigger for worse compression:
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 0
56.8 ms ± 1.5 ms -> 34.8 ms ± 0.9 ms (38.7% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 1
84.6 ms ± 1.7 ms -> 64.2 ms ± 4.9 ms (24.1% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 2
212.1 ms ± 2.5 ms -> 190.3 ms ± 1.6 ms (10.3% faster)
image -o sunset_retro.png sunset_retro.bmp --png-compression-level 3
671.4 ms ± 12.3 ms -> 646.5 ms ± 4.7 ms (3.7% faster)
Compression level 2 is the default, so about a 10% speedup in practice.
For comparison, `sips` needs 49.9 ms ± 3.0 ms to convert
sunset_retro.bmp to sunset_retro.png, and judging from the output file
size, it uses something similar to our compression level 1.
We used to take 1.7x as long as sips, now we take 1.29x as long.