Closed
Bug 1370711
Opened 8 years ago
Closed 8 years ago
stylo: Force the NonZero optimization for servo_arc and StrongRuleNode
Categories
(Core :: CSS Parsing and Computation, enhancement, P1)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
|
2.41 KB,
patch
|
manishearth
:
review+
|
Details | Diff | Splinter Review |
|
7.85 KB,
patch
|
manishearth
:
review+
|
Details | Diff | Splinter Review |
|
11.93 KB,
patch
|
manishearth
:
review+
|
Details | Diff | Splinter Review |
|
11.59 KB,
patch
|
manishearth
:
review+
|
Details | Diff | Splinter Review |
Fixing this brings the size of ElementData from 88 bytes to 56 bytes. Credit to nox for prodding me to do this.
| Assignee | ||
Comment 1•8 years ago
|
||
MozReview-Commit-ID: Aj0rryEnJpl
Attachment #8875044 -
Flags: review?(manishearth)
| Assignee | ||
Comment 2•8 years ago
|
||
The reasoning for this is explained in a comment in the next patch.
MozReview-Commit-ID: FQgDY77mg3B
Attachment #8875045 -
Flags: review?(manishearth)
| Assignee | ||
Comment 3•8 years ago
|
||
MozReview-Commit-ID: AAmeyjfyXeU
Attachment #8875046 -
Flags: review?(manishearth)
| Assignee | ||
Comment 4•8 years ago
|
||
MozReview-Commit-ID: Da4Ds7SIcCD
Attachment #8875047 -
Flags: review?(manishearth)
Updated•8 years ago
|
Attachment #8875045 -
Flags: review?(manishearth) → review+
Updated•8 years ago
|
Attachment #8875047 -
Flags: review?(manishearth) → review+
Updated•8 years ago
|
Attachment #8875044 -
Flags: review?(manishearth) → review+
Comment 5•8 years ago
|
||
Comment on attachment 8875046 [details] [diff] [review]
Part 3 - Introduce NonZeroPtrMut and use it in servo_arc. v1
Review of attachment 8875046 [details] [diff] [review]:
-----------------------------------------------------------------
::: servo/components/servo_arc/lib.rs
@@ +79,5 @@
> +/// be thin or fat (which depends on whether or not T is sized). Given
> +/// that this is all a temporary hack, this restriction is fine for now.
> +///
> +/// [1] https://github.com/rust-lang/rust/issues/27730
> +pub struct NonZeroPtrMut<T: ?Sized + 'static>(&'static mut T);
The `mut` shouldn't be necessary. If this is an Arc it can't be mutated anyway, except for the internal atomic, which rust's aliasing analysis understands as always-mutable.
@@ +97,5 @@
> + NonZeroPtrMut::new(self.ptr())
> + }
> +}
> +
> +impl<T: ?Sized + 'static> ::std::fmt::Debug for NonZeroPtrMut<T> {
This should be an impl of http://doc.servo.org/core/fmt/trait.Pointer.html (`{:p}`), and the Debug impl should pass-through or something. Probably.
Attachment #8875046 -
Flags: review?(manishearth) → review+
| Assignee | ||
Comment 6•8 years ago
|
||
(In reply to Manish Goregaokar [:manishearth] from comment #5)
> Comment on attachment 8875046 [details] [diff] [review]
> Part 3 - Introduce NonZeroPtrMut and use it in servo_arc. v1
>
> Review of attachment 8875046 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: servo/components/servo_arc/lib.rs
> @@ +79,5 @@
> > +/// be thin or fat (which depends on whether or not T is sized). Given
> > +/// that this is all a temporary hack, this restriction is fine for now.
> > +///
> > +/// [1] https://github.com/rust-lang/rust/issues/27730
> > +pub struct NonZeroPtrMut<T: ?Sized + 'static>(&'static mut T);
>
> The `mut` shouldn't be necessary. If this is an Arc it can't be mutated
> anyway, except for the internal atomic
Well, modulo make_mut, and types with internal mutability like AtomicRefCell.
>, which rust's aliasing analysis
> understands as always-mutable.
Yeah, but the pointers were *mut before. I'd rather just match the old code as closely as possible, since I don't think it hurts anything.
>
> @@ +97,5 @@
> > + NonZeroPtrMut::new(self.ptr())
> > + }
> > +}
> > +
> > +impl<T: ?Sized + 'static> ::std::fmt::Debug for NonZeroPtrMut<T> {
>
> This should be an impl of http://doc.servo.org/core/fmt/trait.Pointer.html
> (`{:p}`), and the Debug impl should pass-through or something. Probably.
Ok.
| Assignee | ||
Comment 7•8 years ago
|
||
Looks like this has been merged:
https://hg.mozilla.org/mozilla-central/rev/ced7540c6f6f6cb857df6b3770121f6fceac726c
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•