Ignore:
Timestamp:
Sep 30, 2020, 12:19:47 AM (5 years ago)
Author:
[email protected]
Message:

Always use OperationPtrTag for all operations and annotate operations in CSS JIT
https://bugs.webkit.org/show_bug.cgi?id=217117

Reviewed by Mark Lam.

Source/JavaScriptCore:

For JIT-caging, we would like to annotate all operations consistently with OperationPtrTag.
This patch replaces B3CCallPtrTag and CSSOperationPtrTag with OperationPtrTag and handle these
operations as Operation in JIT-caging.

We also collect and annotate all the operations called in CSS JIT and define them with JSC_DEFINE_JIT_OPERATION.

  • b3/B3LowerMacros.cpp:
  • b3/B3LowerMacrosAfterOptimizations.cpp:
  • b3/B3MathExtras.cpp:
  • b3/B3ReduceLoopStrength.cpp:

(JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy):

  • b3/B3ReduceStrength.cpp:
  • b3/air/AirCCallSpecial.cpp:

(JSC::B3::Air::CCallSpecial::generate):

  • b3/testb3_5.cpp:

(testCallSimple):
(testCallRare):
(testCallRareLive):
(testCallSimplePure):
(testCallFunctionWithHellaArguments):
(testCallFunctionWithHellaArguments2):
(testCallFunctionWithHellaArguments3):
(testCallSimpleDouble):
(testCallSimpleFloat):
(testCallFunctionWithHellaDoubleArguments):
(testCallFunctionWithHellaFloatArguments):
(testLinearScanWithCalleeOnStack):

  • b3/testb3_6.cpp:

(testInterpreter):

  • b3/testb3_7.cpp:

(testLICMPure):
(testLICMPureSideExits):
(testLICMPureWritesPinned):
(testLICMPureWrites):
(testLICMReadsLocalState):
(testLICMReadsPinned):
(testLICMReads):
(testLICMPureNotBackwardsDominant):
(testLICMPureFoiledByChild):
(testLICMPureNotBackwardsDominantFoiledByChild):
(testLICMExitsSideways):
(testLICMWritesLocalState):
(testLICMWrites):
(testLICMFence):
(testLICMWritesPinned):
(testLICMControlDependent):
(testLICMControlDependentNotBackwardsDominant):
(testLICMControlDependentSideExits):
(testLICMReadsPinnedWritesPinned):
(testLICMReadsWritesDifferentHeaps):
(testLICMReadsWritesOverlappingHeaps):
(testLICMDefaultCall):
(testShuffleDoesntTrashCalleeSaves):

  • ftl/FTLOutput.h:

(JSC::FTL::Output::callWithoutSideEffects):
(JSC::FTL::Output::operation):

  • runtime/JSCPtrTag.h:
  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::emitCCall):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::addTableGet):
(JSC::Wasm::B3IRGenerator::addTableSet):
(JSC::Wasm::B3IRGenerator::addRefFunc):
(JSC::Wasm::B3IRGenerator::addTableSize):
(JSC::Wasm::B3IRGenerator::addTableGrow):
(JSC::Wasm::B3IRGenerator::addTableFill):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::setGlobal):
(JSC::Wasm::B3IRGenerator::emitWriteBarrierForJSWrapper):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):

Source/WebCore:

  • css/SelectorChecker.cpp:

(WebCore::isFrameFocused): Deleted.
(WebCore::doesShadowTreeContainFocusedElement): Deleted.
(WebCore::SelectorChecker::matchesFocusPseudoClass): Deleted.
(WebCore::SelectorChecker::matchesDirectFocusPseudoClass): Deleted.

  • css/SelectorChecker.h:
  • css/SelectorCheckerTestFunctions.h:

(WebCore::isFrameFocused):
(WebCore::matchesDirectFocusPseudoClass):
(WebCore::doesShadowTreeContainFocusedElement):
(WebCore::matchesFocusPseudoClass):

  • cssjit/CSSPtrTag.h:
  • cssjit/FunctionCall.h:

(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::prepareAndCall):

  • cssjit/SelectorCompiler.cpp:

(WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
(WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeStyleAttribute):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeAllAnimatedSVGAttribute):
(WebCore::SelectorCompiler::attributeValueSpaceSeparatedListContains):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
(WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext): Deleted.
(WebCore::SelectorCompiler::addStyleRelationFunction): Deleted.
(WebCore::SelectorCompiler::moduloHelper): Deleted.
(WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains): Deleted.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest): Deleted.
(WebCore::SelectorCompiler::elementIsActive): Deleted.
(WebCore::SelectorCompiler::elementIsHovered): Deleted.
(WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown): Deleted.
(WebCore::SelectorCompiler::isPlaceholderShown): Deleted.

  • dom/StyledElement.cpp:

(WebCore::StyledElement::synchronizeStyleAttributeInternalImpl):
(WebCore::StyledElement::synchronizeStyleAttributeInternal): Deleted.

  • dom/StyledElement.h:

(WebCore::StyledElement::synchronizeStyleAttributeInternal const):

  • style/ElementRuleCollector.cpp:

(WebCore::Style::ElementRuleCollector::collectMatchingRules):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): Deleted.

  • svg/SVGElement.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLOutput.h

    r267754 r267783  
    396396        static_assert(!std::is_same<Function, LValue>::value);
    397397        return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), B3::Effects::none(),
    398             constIntPtr(tagCFunctionPtr<void*>(function, B3CCallPtrTag)), arg1, args...);
     398            constIntPtr(tagCFunctionPtr<void*>(function, OperationPtrTag)), arg1, args...);
    399399    }
    400400
     
    402402    // https://bugs.webkit.org/show_bug.cgi?id=184324
    403403    template<typename FunctionType>
    404     LValue operation(FunctionType function) { return constIntPtr(tagCFunctionPtr<void*>(function, B3CCallPtrTag)); }
     404    LValue operation(FunctionType function) { return constIntPtr(tagCFunctionPtr<void*>(function, OperationPtrTag)); }
    405405
    406406    void jump(LBasicBlock);
Note: See TracChangeset for help on using the changeset viewer.