Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoist bloom filter into scoped TLS, and remove a bunch of complexity and unsafety from the style system #14662

Merged
merged 5 commits into from Dec 22, 2016

Conversation

@bholley
Copy link
Contributor

bholley commented Dec 21, 2016

With this PR, the only remaining usage of UnsafeNode is the transition stuff, which is servo-only and probably going to be rewritten over the course of stylo. The parallel traversal is now fully typechecked and safe. \o/

r? @emilio


This change is Reviewable

@highfive
Copy link

highfive commented Dec 21, 2016

Heads up! This PR modifies the following files:

  • @emilio: components/style/lib.rs, components/layout/traversal.rs, components/style/bloom.rs, components/style/tid.rs, components/style/traversal.rs, components/style/context.rs
@highfive
Copy link

highfive commented Dec 21, 2016

warning Warning warning

  • These commits modify style and layout code, but no tests are modified. Please consider adding a test!
@bholley
Copy link
Contributor Author

bholley commented Dec 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 21, 2016

Trying commit 5047184 with merge 5565a88...

bors-servo added a commit that referenced this pull request Dec 21, 2016
Hoist bloom filter into scoped TLS and simplify code

I'm working on more patches to clean up the types, but might as well get this part landed.

r? @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14662)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 21, 2016

@bholley bholley changed the title Hoist bloom filter into scoped TLS and simplify code Hoist bloom filter into scoped TLS, and remove a bunch of complexity and unsafety from the style system Dec 21, 2016
@bholley
Copy link
Contributor Author

bholley commented Dec 21, 2016

I have some more commits which I'll roll into this PR given that it hasn't landed yet.

@bholley bholley force-pushed the bholley:bloom_tls branch from 5047184 to 9cad8dd Dec 21, 2016
@bholley
Copy link
Contributor Author

bholley commented Dec 21, 2016

CCing a few people who might be happy to hear that the parallel traversal is now fully safe.

@pcwalton @SimonSapin @metajack @larsbergstrom @dherman @heycam @upsuper @jdm @nox @mbrubeck @nikomatsakis @Manishearth

@metajack
Copy link
Contributor

metajack commented Dec 22, 2016

This is awesome news!

@emilio
emilio approved these changes Dec 22, 2016
Copy link
Member

emilio left a comment

Awesome! r=me with that line removed, and probably a size check at least for SendNode :)

@@ -143,7 +140,7 @@ fn construct_flows_at<'a, N>(context: &LayoutContext<'a>,
el.mutate_data().unwrap().persist();
unsafe { el.unset_dirty_descendants(); }

remove_from_bloom_filter(&context.shared.style_context, root, el);
thread_local.style_context.bloom_filter.maybe_pop(el);

This comment has been minimized.

Copy link
@emilio

emilio Dec 22, 2016

Member

Just drop this line, I'm not really sure it's worth to keep it. The only reason it (IIRC) was there was to help a bit the sequential traversal, and (maybe) eat the bloom filter when the traversal ended (but that was only done in one of the workers, so oh well), or the generation didn't match (but now there's no generation, which is awesome).

/// objects to other threads.

#[derive(Clone, Debug, PartialEq)]
pub struct SendNode<N: TNode>(N);

This comment has been minimized.

Copy link
@emilio

emilio Dec 22, 2016

Member

Please add a size_of test in the unit tests with Servo's DOM (and presumably with Gecko's), to ensure this type stays small, since we allocate it all over the place.

@emilio
Copy link
Member

emilio commented Dec 22, 2016

Oh, also, either here or in a followup, remove all the restyle generation code, which I think is unused now.

@bholley bholley force-pushed the bholley:bloom_tls branch from dec6f0f to 940cda1 Dec 22, 2016
@bholley
Copy link
Contributor Author

bholley commented Dec 22, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2016

📌 Commit 940cda1 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2016

Testing commit 940cda1 with merge b35ab98...

bors-servo added a commit that referenced this pull request Dec 22, 2016
Hoist bloom filter into scoped TLS, and remove a bunch of complexity and unsafety from the style system

With this PR, the only remaining usage of UnsafeNode is the transition stuff, which is servo-only and probably going to be rewritten over the course of stylo. The parallel traversal is now fully typechecked and safe. \o/

r? @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14662)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2016

@bors-servo bors-servo merged commit 940cda1 into servo:master Dec 22, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.