| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
The allocations in display_to_css_identifier show up in the profiles of
bug 1675628.
Differential Revision: https://phabricator.services.mozilla.com/D97856
|
|
|
|
|
|
|
|
|
|
|
|
| |
We still panic in a debug build, so that developers can notice when they
need to add a new static atom after modifying UA sheets.
We also add telemetry to note when this happens, add an app note to a
crash report, in case any crash later on occurs, and re-up the existing,
expired shared memory sheet telemetry probes so we can look at them
again.
Differential Revision: https://phabricator.services.mozilla.com/D73188
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have this optimization where, for non-generic structs, we generate just a
clone / move as the ToComputedValue / ToResolvedValue implementation.
This moves the optimization a bit further down, and refines it so that we still
generate all the relevant where clauses that make it sound, that is, that all
the ToComputedValue implementations of the fields return the same type.
Otherwise this wouldn't be sound and the type would need to become generic.
We add an escape hatch (no_field_bound) for fields that need to be cloned but
which don't implement the trait. This is right now only for the RefPtr<> in the
shared font-family list, and a piece of code in PaintWorklet which looks kinda
fishy, and probably should be fixed (but we don't ship it in Firefox and there's
a pre-existing FIXME for servo, so I punted on it for now).
The other thing this patch does is adding a bunch of ToComputedValue /
ToResolvedValue implementations that are trivial and were missing.
Differential Revision: https://phabricator.services.mozilla.com/D67913
|
|
|
|
|
|
|
|
|
|
|
| |
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().
Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.
Differential Revision: https://phabricator.services.mozilla.com/D58276
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I see atom dropping code generated in release builds for stuff like dropping the
"class" atom here:
https://searchfox.org/mozilla-central/rev/4df8821c1b824db5f40f381f48432f219d99ae36/servo/components/style/gecko/wrapper.rs#592
That is silly, and I hope making Atom be able to be used in const context will
help the compiler see that yeah, we're not doing anything interesting and the
atom shouldn't get dropped.
It also allows us to get rid of a few lazy_static!s, so we should do it anyway.
In order to accomplish this, compute the offset into gGkAtoms manually instead
of going through the static_atoms() array and then back to the byte offset.
Differential Revision: https://phabricator.services.mozilla.com/D55039
|
|
|
|
|
|
|
|
|
|
|
| |
At first I thought this was going to enable simplifications in the selector
parser (to simplify the attribute selector setup), but I couldn't end up
shrinking the layout enough.
However this should help with bug 1559076, which returns Option<Atom>, and it
was easy to write.
Differential Revision: https://phabricator.services.mozilla.com/D53766
|
|
|
|
| |
MozReview-Commit-ID: KGhYL6DJRaR
|
|
|
|
|
|
| |
-moz-context-properties.
Differential Revision: https://phabricator.services.mozilla.com/D30545
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D17197
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D17192
|
| |
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D15800
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D15078
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
And thus massively speed up ascii-case-insensitive atom comparisons when both
atoms are lowercase (which is the common case by far).
This removes almost all the slow selector-matching in this page, and it seems
an easier fix than storing the lowercased version of all class-names in quirks
mode in elements and selectors...
Differential Revision: https://phabricator.services.mozilla.com/D10945
|
|
|
|
|
|
| |
Co-authored-by: Nicholas Nethercote <nnethercote@mozilla.com>
Differential Revision: https://phabricator.services.mozilla.com/D11035
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This saves one word per static atom, per process.
The `nsGkAtoms` change is only a small part of this commit.
In regen_atoms.py:
- There is now only one link name per platform: nsGkAtoms::sAtoms[].
- But there is a new constant per atom, giving the index into
nsGkAtoms::sAtoms[].
- And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using
the index constant.
- A couple of `*mut` pointers are now `*const`.
Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are
necessary to avoid link errors, presumably due to some template instantiation
wrinkle.
Bug: 1449787
Reviewed-by: froydnj,emilio
|
|
|
|
|
|
|
| |
Somewhat ugly but hopefully not too much. Somehow it ends up removing more lines
than adding.
Differential Revision: https://phabricator.services.mozilla.com/D3536
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D3159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces memory usage because we only need one allocation instead of two
for the dynamic atom and its chars, and because we don't need to store a
refcount and a size. It precludes sharing of chars between dynamic atoms, but
we weren't benefiting much from that anyway.
This reduces per-process memory usage by up to several hundred KiB on my
Linux64 box.
One consequence of this change is that we need to allocate + copy in
DOMString::SetKnownLiveAtom(), which could make some things slower.
Bug: 1447951
Reviewed-by: froydnj
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.
In my current plan, this new trait will be used in bug 1434130 to expose
values as well.
Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
|
|
|
|
|
|
|
|
|
|
| |
This was generated with:
./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style
Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
|
| |
|
|
|
|
| |
Fixes #20158
|
|
|
|
| |
eq_ignore_ascii_case is not in AsciiExt since rustc 1.23.
|
|
|
|
|
|
|
| |
Much like we optimize to_ascii_lowercase.
This also fixes a bug in Servo where attr() rules with an unknown namespace
prefix are parsed, which is wrong.
|
| |
|
|
|
|
| |
See #19128, this part is cherry-picked so Gecko can build with rust nightly.
|
|
|
|
|
|
|
| |
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)
|
|
|
|
|
| |
The new name makes it clearer that it comes from the `malloc_size_of`
crate.
|
|
|
|
|
|
| |
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than
nsIAtom.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.
This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.
These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.
The patch does the following.
- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
into a new crate, malloc_size_of.
- Forks the heapsize_derive crate, calling it malloc_size_of, so that
MallocSizeOf can be derived.
- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
incorporated into heapsize in the future.
- Renames the methods within MallocSizeOf and the related traits so they are
more concise.
- Removes MallocSizeOfWithGuard.
- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
equivalent or almost-equivalent hand-written implementation.
- Adds stuff so that Rc/Arc can be handled properly.
|
| |
|
|
|
|
|
|
| |
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
|
|
|
|
|
|
| |
Bug: 1362338
Reviewed-by: froydnj
MozReview-Commit-ID: 3q5rz3L8quQ
|
| |
|
| |
|
|
|
|
| |
https://github.com/servo/rust-cssparser/pull/171
|
| |
|
| |
|
|
|
|
| |
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
|