Ignore:
Timestamp:
Jan 31, 2020, 10:18:18 PM (6 years ago)
Author:
[email protected]
Message:

[JSC] Hold StructureID instead of Structure* in PolyProtoAccessChain and DFG::CommonData
https://bugs.webkit.org/show_bug.cgi?id=207086

Reviewed by Mark Lam.

PolyProtoAccessChain and DFG::CommonData are kept alive so long as associated AccessCase / DFG/FTL CodeBlock
is alive. They hold Vector<Structure*> / Vector<WriteBarrier<Structure*>>, but access frequency is low. And
We should hold Vector<StructureID> instead to cut 50% of the size.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::commit):
(JSC::AccessCase::forEachDependentCell const):
(JSC::AccessCase::doesCalls const):
(JSC::AccessCase::visitWeak const):
(JSC::AccessCase::propagateTransitions const):
(JSC::AccessCase::generateWithGuard):

  • bytecode/AccessCase.h:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
(JSC::CodeBlock::stronglyVisitWeakReferences):

  • bytecode/GetByStatus.cpp:

(JSC::GetByStatus::computeForStubInfoWithoutExitSiteFeedback):

  • bytecode/InByIdStatus.cpp:

(JSC::InByIdStatus::computeFor):
(JSC::InByIdStatus::computeForStubInfo):
(JSC::InByIdStatus::computeForStubInfoWithoutExitSiteFeedback):

  • bytecode/InByIdStatus.h:
  • bytecode/InstanceOfStatus.cpp:

(JSC::InstanceOfStatus::computeFor):
(JSC::InstanceOfStatus::computeForStubInfo):

  • bytecode/InstanceOfStatus.h:
  • bytecode/PolyProtoAccessChain.cpp:

(JSC::PolyProtoAccessChain::create):
(JSC::PolyProtoAccessChain::needImpurePropertyWatchpoint const):
(JSC::PolyProtoAccessChain::dump const):

  • bytecode/PolyProtoAccessChain.h:

(JSC::PolyProtoAccessChain::chain const):
(JSC::PolyProtoAccessChain::forEach const):
(JSC::PolyProtoAccessChain::slotBaseStructure const):
(JSC::PolyProtoAccessChain:: const): Deleted.

  • bytecode/PolymorphicAccess.cpp:

(JSC::PolymorphicAccess::regenerate):

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeForStubInfo):

  • bytecode/StructureStubInfo.cpp:

(JSC::StructureStubInfo::summary const):
(JSC::StructureStubInfo::summary):

  • bytecode/StructureStubInfo.h:
  • dfg/DFGCommonData.h:
  • dfg/DFGDesiredWeakReferences.cpp:

(JSC::DFG::DesiredWeakReferences::reallyAdd):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):

  • jit/Repatch.cpp:

(JSC::tryCacheGetBy):
(JSC::tryCachePutByID):
(JSC::tryCacheInByID):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r255541 r255542  
    11341134        dfgCommon->recordedStatuses.markIfCheap(visitor);
    11351135       
    1136         for (auto& weakReference : dfgCommon->weakStructureReferences)
    1137             weakReference->markIfCheap(visitor);
     1136        for (StructureID structureID : dfgCommon->weakStructureReferences)
     1137            vm.getStructure(structureID)->markIfCheap(visitor);
    11381138
    11391139        for (auto& transition : dfgCommon->transitions) {
     
    11941194    }
    11951195    if (allAreLiveSoFar) {
    1196         for (unsigned i = 0; i < dfgCommon->weakStructureReferences.size(); ++i) {
    1197             if (!vm.heap.isMarked(dfgCommon->weakStructureReferences[i].get())) {
     1196        for (StructureID structureID : dfgCommon->weakStructureReferences) {
     1197            Structure* structure = vm.getStructure(structureID);
     1198            if (!vm.heap.isMarked(structure)) {
    11981199                allAreLiveSoFar = false;
    11991200                break;
     
    17211722        visitor.append(weakReference);
    17221723
    1723     for (auto& weakStructureReference : dfgCommon->weakStructureReferences)
    1724         visitor.append(weakStructureReference);
     1724    for (StructureID structureID : dfgCommon->weakStructureReferences)
     1725        visitor.appendUnbarriered(visitor.vm().getStructure(structureID));
    17251726
    17261727    dfgCommon->livenessHasBeenProved = true;
Note: See TracChangeset for help on using the changeset viewer.