Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ff53b2cbf74de112c510f533ab39366ca1366606
      
https://github.com/WebKit/WebKit/commit/ff53b2cbf74de112c510f533ab39366ca1366606
  Author: Yusuke Suzuki <[email protected]>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M Source/JavaScriptCore/bytecode/Repatch.cpp
    M Source/JavaScriptCore/bytecode/StructureStubInfo.h
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/dfg/DFGOperations.h
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
    M Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp
    M Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
    M Source/JavaScriptCore/jit/JITOperations.cpp
    M Source/JavaScriptCore/jit/JITOperations.h

  Log Message:
  -----------
  [JSC] Refactor and restrict IC operations are only called from IC
https://bugs.webkit.org/show_bug.cgi?id=260937
rdar://114736570

Reviewed by Keith Miller and Justin Michaud.

In this patch, we refactor operations used by IC and others. The goal of this 
patch is that we ensure that
IC operations are called only from IC. We would like to make these operations 
assuming more, like, it always
has StructureStubInfo so that it does not need to set CallSiteIndex in the 
caller side in the future.
This is really nice since we can remove get_by_id's Slow path in Baseline JIT 
code for example later, and
making slow path of get_by_id one shared one, this will be set up later for 
handler IC. So, handler IC can
just always call this slow path handler which calls operations, and operations 
are aware that they are called
from IC, and CallSiteIndex etc. are appropriately set up from passed 
StructureStubInfo*. So we can make this
entrance similar to the fast path IC, which removes a lot of weird stub code 
necessary for handler IC.

We also resolve many naming inconsistencies in these operations. We have solid 
rule now about Optimize, Generic,
Megamorphic, MegamorphicGeneric, and GaveUp suffixes.

* Source/JavaScriptCore/bytecode/Repatch.cpp:
(JSC::appropriateGetByOptimizeFunction):
(JSC::appropriateGetByGaveUpFunction):
(JSC::tryCacheGetBy):
(JSC::repatchGetBy):
(JSC::repatchGetBySlowPathCall):
(JSC::repatchArrayGetByVal):
(JSC::appropriatePutByGaveUpFunction):
(JSC::repatchPutBySlowPathCall):
(JSC::appropriatePutByOptimizeFunction):
(JSC::tryCachePutBy):
(JSC::repatchPutBy):
(JSC::repatchArrayPutByVal):
(JSC::repatchDeleteBy):
(JSC::appropriateInByOptimizeFunction):
(JSC::appropriateInByGaveUpFunction):
(JSC::repatchInBy):
(JSC::repatchHasPrivateBrand):
(JSC::repatchCheckPrivateBrand):
(JSC::repatchSetPrivateBrand):
(JSC::repatchInstanceOf):
(JSC::resetGetBy):
(JSC::resetInBy):
(JSC::appropriateOptimizingGetByFunction): Deleted.
(JSC::appropriateGetByFunction): Deleted.
(JSC::appropriateGenericPutByFunction): Deleted.
(JSC::appropriateOptimizingPutByFunction): Deleted.
(JSC::appropriateOptimizingInByFunction): Deleted.
(JSC::appropriateGenericInByFunction): Deleted.
* Source/JavaScriptCore/bytecode/StructureStubInfo.h:
(JSC::appropriateGetByIdOptimizeFunction):
(JSC::appropriateGetByIdGenericFunction):
(JSC::appropriatePutByIdOptimizeFunction):
(JSC::appropriateOptimizingGetByIdFunction): Deleted.
(JSC::appropriateGenericGetByIdFunction): Deleted.
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::putByVal): Deleted.
(JSC::DFG::putByValInternal): Deleted.
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileDeleteById):
(JSC::DFG::SpeculativeJIT::compileDeleteByVal):
(JSC::DFG::SpeculativeJIT::compilePutByVal):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compileGetByValWithThis):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compileGetByIdMegamorphic):
(JSC::DFG::SpeculativeJIT::compileGetByIdWithThisMegamorphic):
(JSC::DFG::SpeculativeJIT::compileGetByValMegamorphic):
(JSC::DFG::SpeculativeJIT::compileGetByValWithThisMegamorphic):
(JSC::DFG::SpeculativeJIT::compilePutByIdMegamorphic):
(JSC::DFG::SpeculativeJIT::compilePutByValMegamorphic):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByIdMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByValMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByIdWithThisMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByValWithThisMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compileGetPrivateName):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByValMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compilePutPrivateName):
(JSC::FTL::DFG::LowerDFGToB3::cachedPutById):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByIdMegamorphic):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByValImpl):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileDeleteById):
(JSC::FTL::DFG::LowerDFGToB3::compileDeleteByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp:
(JSC::JITPutByIdGenerator::slowPathFunction): Deleted.
* Source/JavaScriptCore/jit/JITInlineCacheGenerator.h:
* Source/JavaScriptCore/jit/JITOperations.cpp:
(JSC::JSC_DEFINE_JIT_OPERATION):
(JSC::putByVal):
* Source/JavaScriptCore/jit/JITOperations.h:

Canonical link: https://commits.webkit.org/267520@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to