Closed Bug 1376655 Opened 7 years ago Closed 7 years ago

stylo: Stop doing EnsureSameStructsCached during the post-traversal

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: bholley, Assigned: bholley)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files)

This is unnecessary overhead. I have patches.
Attachment #8881803 - Flags: review?(emilio+bugs) → review+
Comment on attachment 8881805 [details] [diff] [review]
Part 2 - Don't call EnsureSameStructsCached in ServoRestyleManager. v1

Review of attachment 8881805 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/style/ServoStyleContext.h
@@ +53,5 @@
> +    uint64_t newBits = (ourBits ^ otherBits) & NS_STYLE_INHERIT_MASK;
> +
> +#define STYLE_STRUCT(name_, checkdata_cb)                                             \
> +    if (nsStyle##name_::kHasFinishStyle && newBits & NS_STYLE_INHERIT_BIT(name_)) {   \
> +      const nsStyle##name_* data = Servo_GetStyle##name_(ComputedValues());           \

PeekStyle##name_?
Attachment #8881805 - Flags: review?(emilio+bugs) → review+
Attachment #8881806 - Flags: review?(emilio+bugs) → review+
Attachment #8881807 - Flags: review?(emilio+bugs) → review+
(In reply to Emilio Cobos Álvarez [:emilio] from comment #8)
> Comment on attachment 8881805 [details] [diff] [review]
> Part 2 - Don't call EnsureSameStructsCached in ServoRestyleManager. v1
> 
> Review of attachment 8881805 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: layout/style/ServoStyleContext.h
> @@ +53,5 @@
> > +    uint64_t newBits = (ourBits ^ otherBits) & NS_STYLE_INHERIT_MASK;
> > +
> > +#define STYLE_STRUCT(name_, checkdata_cb)                                             \
> > +    if (nsStyle##name_::kHasFinishStyle && newBits & NS_STYLE_INHERIT_BIT(name_)) {   \
> > +      const nsStyle##name_* data = Servo_GetStyle##name_(ComputedValues());           \
> 
> PeekStyle##name_?

Per IRL discussion, the bit isn't set yet. And all this will just become a struct member access afte bug 1367904.
Pushed by bholley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d13cb72a5669
Use ServoStyleContext in more places. r=emilio
https://hg.mozilla.org/integration/autoland/rev/378597d9a6c3
Don't call EnsureSameStructsCached in ServoRestyleManager. r=emilio
https://hg.mozilla.org/integration/autoland/rev/0eb7e3863c5f
Stop using EnsureSameStructsCached in ViewportFrame::UpdateStyle. r=emilio
https://hg.mozilla.org/integration/autoland/rev/f3e0f0a4ab7b
Move EnsureSameStructsCached to GeckoStyleContext. r=emilio
You need to log in before you can comment on or make changes to this bug.