diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-12-22 10:40:27 -0800 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-12-22 11:09:55 -0800 |
commit | 940cda1d15203063af00a5763e5ac090ddbd9c5a (patch) | |
tree | 9c60cb66c8184adf56d7e715b2a16f9b6aebc166 | |
parent | ea6a61af594c8795ff009d00e77363fe0ae855cc (diff) | |
download | servo-940cda1d15203063af00a5763e5ac090ddbd9c5a.tar.gz servo-940cda1d15203063af00a5763e5ac090ddbd9c5a.zip |
Remove generation, remove filter pop, and add size tests.
-rw-r--r-- | components/layout/traversal.rs | 4 | ||||
-rw-r--r-- | components/layout_thread/lib.rs | 1 | ||||
-rw-r--r-- | components/script/test.rs | 10 | ||||
-rw-r--r-- | components/style/context.rs | 4 | ||||
-rw-r--r-- | components/style/gecko/data.rs | 10 | ||||
-rw-r--r-- | components/style/traversal.rs | 4 | ||||
-rw-r--r-- | ports/geckolib/glue.rs | 1 | ||||
-rw-r--r-- | tests/unit/script/size_of.rs | 4 |
8 files changed, 14 insertions, 24 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 811074bb083..b3672ecf32c 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -112,7 +112,7 @@ pub trait PostorderNodeMutTraversal<ConcreteThreadSafeLayoutNode: ThreadSafeLayo #[inline] #[allow(unsafe_code)] fn construct_flows_at<'a, N>(context: &LayoutContext<'a>, - thread_local: &mut ScopedThreadLocalLayoutContext<N::ConcreteElement>, + _thread_local: &mut ScopedThreadLocalLayoutContext<N::ConcreteElement>, node: N) where N: LayoutNode, { @@ -139,8 +139,6 @@ fn construct_flows_at<'a, N>(context: &LayoutContext<'a>, if let Some(el) = node.as_element() { el.mutate_data().unwrap().persist(); unsafe { el.unset_dirty_descendants(); } - - thread_local.style_context.bloom_filter.maybe_pop(el); } } diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index b67e34b6e3c..f9f4c371a94 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -520,7 +520,6 @@ impl LayoutThread { viewport_size: self.viewport_size.clone(), screen_size_changed: screen_size_changed, stylist: rw_data.stylist.clone(), - generation: self.generation, goal: goal, running_animations: self.running_animations.clone(), expired_animations: self.expired_animations.clone(), diff --git a/components/script/test.rs b/components/script/test.rs index ca00b200788..31353b5ffa3 100644 --- a/components/script/test.rs +++ b/components/script/test.rs @@ -19,7 +19,7 @@ pub mod size_of { use dom::htmlspanelement::HTMLSpanElement; use dom::node::Node; use dom::text::Text; - use layout_wrapper::ServoThreadSafeLayoutNode; + use layout_wrapper::{ServoLayoutElement, ServoLayoutNode, ServoThreadSafeLayoutNode}; use std::mem::size_of; pub fn CharacterData() -> usize { @@ -50,6 +50,14 @@ pub mod size_of { size_of::<Node>() } + pub fn SendElement() -> usize { + size_of::<::style::dom::SendElement<ServoLayoutElement>>() + } + + pub fn SendNode() -> usize { + size_of::<::style::dom::SendNode<ServoLayoutNode>>() + } + pub fn ServoThreadSafeLayoutNode() -> usize { size_of::<ServoThreadSafeLayoutNode>() } diff --git a/components/style/context.rs b/components/style/context.rs index 09a4c28e1a2..f649f64afbf 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -49,10 +49,6 @@ pub struct SharedStyleContext { /// The CSS selector stylist. pub stylist: Arc<Stylist>, - /// Starts at zero, and increased by one every time a layout completes. - /// This can be used to easily check for invalid stale data. - pub generation: u32, - /// Why is this reflow occurring pub goal: ReflowGoal, diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 2b7cfc54a35..da334bfa4bf 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -25,9 +25,6 @@ pub struct PerDocumentStyleDataImpl { /// Rule processor. pub stylist: Arc<Stylist>, - /// Last restyle generation. - pub last_restyle_generation: u32, - /// List of stylesheets, mirrored from Gecko. pub stylesheets: Vec<Arc<Stylesheet>>, @@ -67,7 +64,6 @@ impl PerDocumentStyleData { PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl { stylist: Arc::new(Stylist::new(device)), - last_restyle_generation: 0, stylesheets: vec![], stylesheets_changed: true, new_animations_sender: new_anims_sender, @@ -105,12 +101,6 @@ impl PerDocumentStyleDataImpl { self.stylesheets_changed = false; } } - - pub fn next_generation(&mut self) -> u32 { - self.last_restyle_generation = - self.last_restyle_generation.wrapping_add(1); - self.last_restyle_generation - } } unsafe impl HasFFI for PerDocumentStyleData { diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 9534a087695..a9fd8c57a4d 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -18,10 +18,6 @@ use std::mem; use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use stylist::Stylist; -/// Every time we do another layout, the old bloom filters are invalid. This is -/// detected by ticking a generation number every layout. -pub type Generation = u32; - /// Style sharing candidate cache stats. These are only used when /// `-Z style-sharing-stats` is given. pub static STYLE_SHARING_CACHE_HITS: AtomicUsize = ATOMIC_USIZE_INIT; diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index bab3a36f470..b028065f48a 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -101,7 +101,6 @@ fn create_shared_context(mut per_doc_data: &mut AtomicRefMut<PerDocumentStyleDat // FIXME (bug 1303229): Use the actual viewport size here viewport_size: Size2D::new(Au(0), Au(0)), screen_size_changed: false, - generation: per_doc_data.next_generation(), goal: ReflowGoal::ForScriptQuery, stylist: per_doc_data.stylist.clone(), running_animations: per_doc_data.running_animations.clone(), diff --git a/tests/unit/script/size_of.rs b/tests/unit/script/size_of.rs index 64a2f37e67d..a328bcbf6f5 100644 --- a/tests/unit/script/size_of.rs +++ b/tests/unit/script/size_of.rs @@ -38,3 +38,7 @@ sizeof_checker!(size_span, HTMLSpanElement, 336); sizeof_checker!(size_text, Text, 184); sizeof_checker!(size_characterdata, CharacterData, 184); sizeof_checker!(size_servothreadsafelayoutnode, ServoThreadSafeLayoutNode, 16); + +// We use these types in the parallel traversal. They should stay pointer-sized. +sizeof_checker!(size_sendelement, SendElement, 8); +sizeof_checker!(size_sendnode, SendNode, 8); |