Ignore:
Timestamp:
Apr 29, 2022, 1:05:32 PM (3 years ago)
Author:
[email protected]
Message:

[JSC] Use FixedVector in JumpReplacements and VariableEventStream
https://bugs.webkit.org/show_bug.cgi?id=239892

Reviewed by Mark Lam.

  1. Introduce DFG::VariableEventStreamBuilder. And construct DFG::VariableEventStream from that

builder when finailizing code generation. We also make it FixedVector.

  1. Use FixedVector for JumpReplacements.
  • Source/JavaScriptCore/dfg/DFGCommonData.cpp:

(JSC::DFG::CommonData::shrinkToFit):

  • Source/JavaScriptCore/dfg/DFGCommonData.h:
  • Source/JavaScriptCore/dfg/DFGGenerationInfo.h:

(JSC::DFG::GenerationInfo::noticeOSRBirth):
(JSC::DFG::GenerationInfo::use):
(JSC::DFG::GenerationInfo::spill):
(JSC::DFG::GenerationInfo::setSpilled):
(JSC::DFG::GenerationInfo::fillGPR):
(JSC::DFG::GenerationInfo::fillJSValue):
(JSC::DFG::GenerationInfo::fillCell):
(JSC::DFG::GenerationInfo::fillInt32):
(JSC::DFG::GenerationInfo::fillInt52):
(JSC::DFG::GenerationInfo::fillStrictInt52):
(JSC::DFG::GenerationInfo::fillBoolean):
(JSC::DFG::GenerationInfo::fillDouble):
(JSC::DFG::GenerationInfo::fillStorage):
(JSC::DFG::GenerationInfo::appendBirth):
(JSC::DFG::GenerationInfo::appendFill):
(JSC::DFG::GenerationInfo::appendSpill):

  • Source/JavaScriptCore/dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::shrinkToFit):
(JSC::DFG::JITCode::reconstruct):

  • Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::exceptionCheck):

  • Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h:

(JSC::DFG::SlowPathGenerator::SlowPathGenerator):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::speculationCheck):
(JSC::DFG::SpeculativeJIT::emitInvalidationPoint):
(JSC::DFG::SpeculativeJIT::addSlowPathGeneratorLambda):
(JSC::DFG::SpeculativeJIT::fillStorage):
(JSC::DFG::SpeculativeJIT::compileDeleteById):
(JSC::DFG::SpeculativeJIT::compileDeleteByVal):
(JSC::DFG::SpeculativeJIT::compileInById):
(JSC::DFG::SpeculativeJIT::compileInByVal):
(JSC::DFG::SpeculativeJIT::compileHasPrivate):
(JSC::DFG::SpeculativeJIT::noticeOSRBirth):
(JSC::DFG::SpeculativeJIT::compileMovHint):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compilePutByVal):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::finalizeEventStream):
(JSC::DFG::SpeculativeJIT::use):
(JSC::DFG::SpeculativeJIT::spill):
(JSC::DFG::SpeculativeJIT::recordSetLocal):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compileGetByVal):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::fillSpeculateBigInt32):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compile):

  • Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp:

(JSC::DFG::VariableEventStreamBuilder::logEvent):
(JSC::DFG::VariableEventStream::reconstruct const):
(JSC::DFG::VariableEventStream::logEvent): Deleted.

  • Source/JavaScriptCore/dfg/DFGVariableEventStream.h:

(JSC::DFG::VariableEventStream::VariableEventStream):
(JSC::DFG::VariableEventStreamBuilder::appendAndLog):
(JSC::DFG::VariableEventStreamBuilder::size const):
(JSC::DFG::VariableEventStreamBuilder::finalize):
(JSC::DFG::VariableEventStream::appendAndLog): Deleted.

  • Source/JavaScriptCore/ftl/FTLLink.cpp:

(JSC::FTL::link):

  • Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • Source/JavaScriptCore/ftl/FTLState.h:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp

    r261755 r293629  
    3939namespace JSC { namespace DFG {
    4040
    41 void VariableEventStream::logEvent(const VariableEvent& event)
    42 {
    43     dataLogF("seq#%u:", static_cast<unsigned>(size()));
     41void VariableEventStreamBuilder::logEvent(const VariableEvent& event)
     42{
     43    dataLogF("seq#%u:", static_cast<unsigned>(m_stream.size()));
    4444    event.dump(WTF::dataFile());
    4545    dataLogLn(" ");
     
    175175    // Step 1: Find the last checkpoint, and figure out the number of virtual registers as we go.
    176176    unsigned startIndex = index - 1;
    177     while (at(startIndex).kind() != Reset)
     177    while (m_stream.at(startIndex).kind() != Reset)
    178178        startIndex--;
    179179   
     
    184184    HashMap<MinifiedID, MinifiedGenerationInfo> generationInfos;
    185185    for (unsigned i = startIndex; i < index; ++i) {
    186         const VariableEvent& event = at(i);
     186        const VariableEvent& event = m_stream.at(i);
    187187        dataLogLnIf(verbose, "Processing event ", event);
    188188        switch (event.kind()) {
Note: See TracChangeset for help on using the changeset viewer.