CSS JIT cleanup: move two utility functions out of the properties-matcher section
[WebKit-https.git] / Source / WebCore / cssjit / SelectorCompiler.cpp
index 725c4966a4a59a987f0d76ba1826804b2f8791bb..70f9b3039d9faa2fbc2013f1acbe08a35c0d7fcb 100644 (file)
@@ -210,11 +210,9 @@ private:
     void generateElementMatching(Assembler::JumpList& matchingTagNameFailureCases, Assembler::JumpList& matchingPostTagNameFailureCases, const SelectorFragment&);
     void generateElementDataMatching(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementFunctionCallTest(Assembler::JumpList& failureCases, JSC::FunctionPtr);
-    Assembler::JumpList jumpIfNoPreviousAdjacentElement();
     void generateElementIsActive(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementIsFirstChild(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementIsHovered(Assembler::JumpList& failureCases, const SelectorFragment&);
-    Assembler::JumpList jumpIfNoNextAdjacentElement();
     void generateElementIsLastChild(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementIsOnlyChild(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateSynchronizeStyleAttribute(Assembler::RegisterID elementDataArraySizeAndFlags);
@@ -234,6 +232,8 @@ private:
 
     // Helpers.
     void addFlagsToElementStyleFromContext(Assembler::RegisterID checkingContext, int64_t);
+    Assembler::JumpList jumpIfNoPreviousAdjacentElement();
+    Assembler::JumpList jumpIfNoNextAdjacentElement();
     Assembler::Jump jumpIfNotResolvingStyle(Assembler::RegisterID checkingContextRegister);
     void generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded(Assembler::JumpList& failureCases, const SelectorFragment&);
     Assembler::Jump modulo(JSC::MacroAssembler::ResultCondition, Assembler::RegisterID inputDividend, int divisor);
@@ -1235,6 +1235,24 @@ void SelectorCodeGenerator::addFlagsToElementStyleFromContext(Assembler::Registe
     m_assembler.store64(flags, flagAddress);
 }
 
+Assembler::JumpList SelectorCodeGenerator::jumpIfNoPreviousAdjacentElement()
+{
+    Assembler::JumpList successCase;
+    LocalRegister previousSibling(m_registerAllocator);
+    m_assembler.move(elementAddressRegister, previousSibling);
+    generateWalkToPreviousAdjacentElement(successCase, previousSibling);
+    return successCase;
+}
+
+Assembler::JumpList SelectorCodeGenerator::jumpIfNoNextAdjacentElement()
+{
+    Assembler::JumpList successCase;
+    LocalRegister nextSibling(m_registerAllocator);
+    m_assembler.move(elementAddressRegister, nextSibling);
+    generateWalkToNextAdjacentElement(successCase, nextSibling);
+    return successCase;
+}
+
 Assembler::Jump SelectorCodeGenerator::jumpIfNotResolvingStyle(Assembler::RegisterID checkingContext)
 {
     RELEASE_ASSERT(m_selectorContext == SelectorContext::RuleCollector);
@@ -1996,15 +2014,6 @@ static void setFirstChildState(Element* element)
         style->setFirstChildState();
 }
 
-inline Assembler::JumpList SelectorCodeGenerator::jumpIfNoPreviousAdjacentElement()
-{
-    Assembler::JumpList successCase;
-    LocalRegister previousSibling(m_registerAllocator);
-    m_assembler.move(elementAddressRegister, previousSibling);
-    generateWalkToPreviousAdjacentElement(successCase, previousSibling);
-    return successCase;
-}
-
 static bool elementIsActive(Element* element)
 {
     return element->active() || InspectorInstrumentation::forcePseudoState(element, CSSSelector::PseudoClassActive);
@@ -2146,15 +2155,6 @@ void SelectorCodeGenerator::generateElementIsHovered(Assembler::JumpList& failur
     }
 }
 
-Assembler::JumpList SelectorCodeGenerator::jumpIfNoNextAdjacentElement()
-{
-    Assembler::JumpList successCase;
-    LocalRegister nextSibling(m_registerAllocator);
-    m_assembler.move(elementAddressRegister, nextSibling);
-    generateWalkToNextAdjacentElement(successCase, nextSibling);
-    return successCase;
-}
-
 static void setLastChildState(Element* element)
 {
     if (RenderStyle* style = element->renderStyle())