From 4c9a1fd0ddf9a3aec956cb074f4cbf578fab1f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 4 Jun 2018 21:46:22 +0200 Subject: [PATCH] No bug - Sprinkle some inline in methods that are just pointer-chasing or function calls. r=me MozReview-Commit-ID: 8G2NQPBVuXn --- servo/components/style/gecko/wrapper.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servo/components/style/gecko/wrapper.rs b/servo/components/style/gecko/wrapper.rs index 4eae24a2bfa8..f85bffaaac6d 100644 --- a/servo/components/style/gecko/wrapper.rs +++ b/servo/components/style/gecko/wrapper.rs @@ -615,31 +615,37 @@ impl<'le> GeckoElement<'le> { // GeckoNode is a raw reference. // // We can use a Cell, but that's a bit of a pain. + #[inline] fn set_flags(&self, flags: u32) { unsafe { Gecko_SetNodeFlags(self.as_node().0, flags) } } + #[inline] unsafe fn unset_flags(&self, flags: u32) { Gecko_UnsetNodeFlags(self.as_node().0, flags) } /// Returns true if this element has descendants for lazy frame construction. + #[inline] pub fn descendants_need_frames(&self) -> bool { self.flags() & (NODE_DESCENDANTS_NEED_FRAMES as u32) != 0 } /// Returns true if this element needs lazy frame construction. + #[inline] pub fn needs_frame(&self) -> bool { self.flags() & (NODE_NEEDS_FRAME as u32) != 0 } /// Returns a reference to the DOM slots for this Element, if they exist. + #[inline] fn dom_slots(&self) -> Option<&structs::FragmentOrElement_nsDOMSlots> { let slots = self.as_node().0.mSlots as *const structs::FragmentOrElement_nsDOMSlots; unsafe { slots.as_ref() } } /// Returns a reference to the extended DOM slots for this Element. + #[inline] fn extended_slots(&self) -> Option<&structs::FragmentOrElement_nsExtendedDOMSlots> { self.dom_slots().and_then(|s| unsafe { (s._base.mExtendedSlots.mPtr as *const structs::FragmentOrElement_nsExtendedDOMSlots) @@ -697,6 +703,7 @@ impl<'le> GeckoElement<'le> { } } + #[inline] fn non_xul_xbl_binding_parent_raw_content(&self) -> *mut nsIContent { debug_assert!(!self.is_xul_element()); self.extended_slots()