Commit d932bcae authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Move SelectorFilter to oilpan's heap

This CL moves SelectorFilter::ParentStackFrame from a private section to a public section to use a WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS macro.

BUG=340522

Review URL: https://codereview.chromium.org/422143005

git-svn-id: svn://svn.chromium.org/blink/trunk@179079 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0cfa7b79
...@@ -170,4 +170,14 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign ...@@ -170,4 +170,14 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign
*hash = 0; *hash = 0;
} }
void SelectorFilter::ParentStackFrame::trace(Visitor* visitor)
{
visitor->trace(element);
}
void SelectorFilter::trace(Visitor* visitor)
{
visitor->trace(m_parentStack);
}
} }
...@@ -38,7 +38,20 @@ namespace blink { ...@@ -38,7 +38,20 @@ namespace blink {
class CSSSelector; class CSSSelector;
class SelectorFilter { class SelectorFilter {
DISALLOW_ALLOCATION();
public: public:
class ParentStackFrame {
ALLOW_ONLY_INLINE_ALLOCATION();
public:
ParentStackFrame() : element(nullptr) { }
explicit ParentStackFrame(Element& element) : element(&element) { }
void trace(Visitor*);
RawPtrWillBeMember<Element> element;
Vector<unsigned, 4> identifierHashes;
};
void pushParentStackFrame(Element& parent); void pushParentStackFrame(Element& parent);
void popParentStackFrame(); void popParentStackFrame();
...@@ -52,14 +65,10 @@ public: ...@@ -52,14 +65,10 @@ public:
inline bool fastRejectSelector(const unsigned* identifierHashes) const; inline bool fastRejectSelector(const unsigned* identifierHashes) const;
static void collectIdentifierHashes(const CSSSelector&, unsigned* identifierHashes, unsigned maximumIdentifierCount); static void collectIdentifierHashes(const CSSSelector&, unsigned* identifierHashes, unsigned maximumIdentifierCount);
void trace(Visitor*);
private: private:
struct ParentStackFrame { WillBeHeapVector<ParentStackFrame> m_parentStack;
ParentStackFrame() : element(0) { }
ParentStackFrame(Element& element) : element(&element) { }
Element* element;
Vector<unsigned, 4> identifierHashes;
};
Vector<ParentStackFrame> m_parentStack;
// With 100 unique strings in the filter, 2^12 slot table has false positive rate of ~0.2%. // With 100 unique strings in the filter, 2^12 slot table has false positive rate of ~0.2%.
static const unsigned bloomFilterKeyBits = 12; static const unsigned bloomFilterKeyBits = 12;
...@@ -79,4 +88,6 @@ inline bool SelectorFilter::fastRejectSelector(const unsigned* identifierHashes) ...@@ -79,4 +88,6 @@ inline bool SelectorFilter::fastRejectSelector(const unsigned* identifierHashes)
} }
WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame);
#endif #endif
...@@ -1556,6 +1556,7 @@ void StyleResolver::trace(Visitor* visitor) ...@@ -1556,6 +1556,7 @@ void StyleResolver::trace(Visitor* visitor)
visitor->trace(m_keyframesRuleMap); visitor->trace(m_keyframesRuleMap);
visitor->trace(m_matchedPropertiesCache); visitor->trace(m_matchedPropertiesCache);
visitor->trace(m_viewportDependentMediaQueryResults); visitor->trace(m_viewportDependentMediaQueryResults);
visitor->trace(m_selectorFilter);
visitor->trace(m_viewportStyleResolver); visitor->trace(m_viewportStyleResolver);
visitor->trace(m_features); visitor->trace(m_features);
visitor->trace(m_siblingRuleSet); visitor->trace(m_siblingRuleSet);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment