This most importantly gets rid of a chain of "String to DeprecatedString
to String" transformations when setting a tooltip from GUI::Widget's
set_tooltip function.
As the newly created function has been also applied to printing the
number of matched file lines, file names will now also be colored
with the `--count` option set. :^)
Previously we had two somewhat duplicated methods: one just for handling
stdin with the standard C API, and the other one used for everything
else with our Core::File class. By using always Core::File, the code
should be now a little bit cleaner.
Additionally, grep will now use the standard input when it finds a '-'
argument (previously it tried to open a file with that name.)
For example, the locale "fr-FR" will have the preferred hour cycle list
of "H hB", meaning h23 and h12-with-day-periods. Whether date-times are
actually formatted with day-periods is up to the user, but we need to
parse the hour cycle as h12 to know that the FR region supports h12.
This bug was revealed by LibJS no longer blindly falling back to h12 (if
the `hour12` option is true) or h24 (if the `hour12` option is false).
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/73926a5
The idea here is to reduce duplication of these AOs between ECMA-262,
ECMA-402, and Temporal. This patch contains only the ECMA-262 changes.
We currently only return primary time zones, i.e. time zones that are
not a Link. LibJS will require knowledge of Link entries, and whether
each entry is or is not a Link.
This patch adds a fast path to the PutByValue bytecode op that bypasses
a ton of things *if* a set of assumptions hold:
- The property key must be a non-negative Int32
- The base object must not interfere with indexed property access
- The base object must have simple indexed property storage
- The property key must already be present as an own property
- The existing value must not have any accessors defined
If this holds (which it should in many common cases), we can skip all
kinds of checks and poke directly at the property storage, saving time.
16% speed-up on the entire Kraken benchmark :^)
(including: 88% speed-up on Kraken/imaging-desaturate.js)
(including: 55% speed-up on Kraken/audio-fft.js)
(including: 54% speed-up on Kraken/audio-beat-detection.js)
This patch adds a fast path to the GetByValue bytecode op that bypasses
a ton of things *if* a set of assumptions hold:
- The property key must be a non-negative Int32
- The base object must not interfere with indexed property access
- The property key must already be present as an own property
- The existing value must not have any accessors defined
If this holds (which it should in the common case), we can poke directly
at the indexed property storage and save a boatload of time.
10% speed-up on the entire Kraken benchmark :^)
(including: 31% speed-up on Kraken/audio-dft.js)
(including: 23% speed-up on Kraken/stanford-crypto-aes.js)
This function must return true if the object may intercept and customize
access to indexed properties (properties where the property name is a
non-negative integer.)
This will be used to implement fast path optimizations for array-like
accesses in subsequent commits.
The "dependency" lines really belong to the main port entry, it doesn't
make sense logically to represent them separately and handling them
together will also allow easier dependency management later on. This
commit greatly simplifies the port database parsing to facilitate this,
and removes the -d option from the command line. Instead, ports are
listed with their dependencies, if they have any.
The strings will get deduplicated when actually turned into
PrimitiveString objects at runtime anyway, and keeping the string
tables deduplicated was actually wasting a lot of time.
4.4% speed-up on Kraken/stanford-crypto-ccm.js :^)
Color::lightened() and Color::darkened() multiply the color values, so
they don't work for black. So for simplicity, we use a semi-transparent
white or black instead.
The following snippet would cause "i" to be incremented twice(!):
let a = []
let i = 0
a[++i] += 0
This patch solves the issue by remembering the base object and property
name for computed MemberExpression LHS in codegen. We the store the
result of the assignment to the same object and property (instead of
computing the LHS again).
3 new passes on test262. :^)
When the spec says to call "! TrimString", we should use MUST instead
of TRY. (We were previously using TRY in order to propagate OOM errors,
but we don't care about such OOMs anymore.)
Alter the card dimensions to be 80x110px with a corner radius of 7px.
This is inspired by the dimensions of physical playing cards. It gives
12px of padding between the illustration and the card's border.
Move the card letter and symbol closer to the edge to make space.
Adjust the Club symbol to have the same dimensions as the other symbols.
The program now terminates with an error if the command passed to
`-exec` is not terminated with a semicolon.
This commit also ensures that the argument containing the terminating
semicolon must be 1 byte long. Previously, any argument whose first
byte was a semicolon was treated as a valid terminator.
This behaves identically to the `-exec` option but prompts the user
for confirmation before executing the specified command.
A command is executed if a line beginning with 'y' or 'Y' is entered
by the user. This matches the behavior of `find` on Linux and FreeBSD
when using the POSIX locale.
Previously, we would divide the widget width and height by the tile size
and round up, which did not result in enough tiles to cover the entire
widget. Although this calculation is correct if you starting drawing
tiles in the top left corner, we have an additional offset to account
for.
Now, we take the number of tiles that fit in the widget completely and
pad it with 2 tiles to account for the partial left/right and top/bottom
sides. An additional tile is added to account for the iterator
translating by width / 2, which rounds down again.
The resulting tile rects are always intersected with the widget
dimensions, so even if we're generating more tile coordinates than
strictly necessary, we're not performing the actual download or draw
operations.
The `operator++` of the spiraling tile iterator was repeating the first
coordinates (`0, 0`) instead of moving to the next tile on the first
iteration. Swapping the move and check ensures we get to the end of the
iterator, fixing gray tiles that would sometimes pop up in the lower
right.
Since we never return from `operator++` without setting a valid
position, we can drop `current_x` and `current_y` and just use the
`Gfx::Point<T>` directly.
Since we divide the width and height of the downscaled tiles by 2,
bilinear blending is identical to box sampling and should be preferred
since it's the simpler one of the two algorithms.
Renaming the DeprecatedString version of this function to
deprecated_tag_name. A FlyString is used here as we often need to
perform equality checks here, and the HTMLParser already has tag_name as
a FlyString.
Remove a FIXME while we're at it - we were already following the spec
there, and we still are :^)
Which pretty much needs to be done together due to the amount of places
where they are compared together.
This also involves porting over StackOfOpenElements over to FlyString
from DeprecatedFly string to prevent a gazillion calls to
`.to_deprecated_fly_string` calls in HTMLParser.
Renaming the DeprecatedString version of this function to
Element::get_deprecated_attribute.
While performing this rename, port over functions where it is trivial to
do so to the Optional<String> version of this function.
Similar to Element::has_attribute, ideally this would take a
`FlyString const&`, but NamedNodeMap::get_attribute_ns already takes a
StringView. To aid in porting away from DeprecatedString, just take a
StringView for now.
By loading only the fonts actually used on a page, we can often avoid
making a lot of unnecessary requests and style invalidations.
This change makes initial loading of apple.com much faster.
Fixes https://github.com/SerenityOS/serenity/issues/20747
A key press, which is an ASCII control character will no longer cause
TableView to begin editing.
This fixes an issue in Spreadsheet where navigating to a cell then
pressing escape would cause a that cell's text to be set to a
non-printable value. Pressing escape after navigating to a cell
now has no effect.
Bash eats the backslash in this format (similarly for W\ORD etc.).
Dr.POSIX doesn't specify this anywhere, but it's used all over the
place, so let's support it.
The information the user is most interested in is usually in the center,
so we should start loading tiles from the center and move outwards.
Since tiles are loaded in draw order, simply drawing them in this order
achieves the desired effect. The current center-outwards loading
algorithm is a basic spiral algorithm, but others may be evaluated
later.
- Convert to FlatPtr instead of doing pointer arithmetic on a too-large
pointer type in find_min_and_max_block_addresses(). This makes the
range more accurate.
- Untag possible cell pointers in add_possible_value() before doing the
rejection. Otherwise we end up rejecting most pointers since the tags
sit in the highest bits!
This fixes a crash when running the Speedometer benchmark.
Just using Vector::resize() meant that we allocated exact capacity
instead of leaving padding at the end. This patch adds a call to
grow_capacity() before resize(), which ensures that we grow with the
usual extra padding.
This change adds a check to discard pointers that are lower than the
minimum address of all allocated blocks or higher than the maximum
address of all blocks. By doing this we avoid executing plenty of set()
operations on the HashMap in the add_possible_value().
With this change gather_conservative_roots() run 10x times faster in
Speedometer React-Redux-TodoMVC test.
Also, re-order things to match. No behaviour changes.
This reveals quite a few properties that are missing here, or which we
implement somewhat incorrectly.
The following commit will port MIME types to String. Traits<String>
- used in Vector::contains_slow - can't compare String type with char*,
so we need to use StringView instead.