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

reuse the bloom filter and style sharing cache across traversals #17701

Merged
merged 4 commits into from Jul 13, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Stop using SendElement in StyleSharingCandiate.

MozReview-Commit-ID: AuNPDsq8bgk
  • Loading branch information
bholley committed Jul 12, 2017
commit 3bce0c7652c74f0703bc1ac51fdb26c35c6e990b
@@ -221,9 +221,8 @@ impl ValidationData {
/// FakeCandidate below.
#[derive(Debug)]
pub struct StyleSharingCandidate<E: TElement> {
/// The element. We use SendElement here so that the cache may live in
/// ScopedTLS.
element: SendElement<E>,
/// The element.
element: E,
validation_data: ValidationData,
}

@@ -244,12 +243,12 @@ impl<E: TElement> Deref for StyleSharingCandidate<E> {
impl<E: TElement> StyleSharingCandidate<E> {
/// Get the classlist of this candidate.
fn class_list(&mut self) -> &[Atom] {
self.validation_data.class_list(*self.element)
self.validation_data.class_list(self.element)
}

/// Get the pres hints of this candidate.
fn pres_hints(&mut self) -> &[ApplicableDeclarationBlock] {
self.validation_data.pres_hints(*self.element)
self.validation_data.pres_hints(self.element)
}

/// Compute the bit vector of revalidation selector match results
@@ -260,7 +259,7 @@ impl<E: TElement> StyleSharingCandidate<E> {
bloom: &StyleBloom<E>,
) -> &BitVec {
self.validation_data.revalidation_match_results(
*self.element,
self.element,
stylist,
bloom,
/* bloom_known_valid = */ false,
@@ -590,7 +589,7 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
self.dom_depth = dom_depth;
}
self.cache_mut().insert(StyleSharingCandidate {
element: unsafe { SendElement::new(*element) },
element: *element,
validation_data: validation_data,
});
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.