Ignore:
Timestamp:
Feb 7, 2014, 9:06:33 PM (12 years ago)
Author:
[email protected]
Message:

GC should safepoint the DFG worklist in a smarter way rather than just waiting for everything to complete
https://bugs.webkit.org/show_bug.cgi?id=128297

Reviewed by Oliver Hunt.

This makes DFG worklist threads have a rightToRun lock that gives them the ability to
be safepointed by the GC in much the same way as you'd expect from a fully
multithreaded VM.

The idea is that the worklist threads's roots are the DFG::Plan. They only touch those
roots when holding the rightToRun lock. They currently grab that lock to run the
compiler, but relinquish it when accessing - and waiting on - the worklist.

  • bytecode/CodeBlock.h:

(JSC::CodeBlockSet::mark):

  • dfg/DFGCompilationKey.cpp:

(JSC::DFG::CompilationKey::visitChildren):

  • dfg/DFGCompilationKey.h:
  • dfg/DFGDesiredStructureChains.cpp:

(JSC::DFG::DesiredStructureChains::visitChildren):

  • dfg/DFGDesiredStructureChains.h:
  • dfg/DFGDesiredTransitions.cpp:

(JSC::DFG::DesiredTransition::visitChildren):
(JSC::DFG::DesiredTransitions::visitChildren):

  • dfg/DFGDesiredTransitions.h:
  • dfg/DFGDesiredWeakReferences.cpp:

(JSC::DFG::DesiredWeakReferences::visitChildren):

  • dfg/DFGDesiredWeakReferences.h:
  • dfg/DFGDesiredWriteBarriers.cpp:

(JSC::DFG::DesiredWriteBarrier::visitChildren):
(JSC::DFG::DesiredWriteBarriers::visitChildren):

  • dfg/DFGDesiredWriteBarriers.h:
  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::visitChildren):

  • dfg/DFGPlan.h:
  • dfg/DFGWorklist.cpp:

(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::suspendAllThreads):
(JSC::DFG::Worklist::resumeAllThreads):
(JSC::DFG::Worklist::visitChildren):
(JSC::DFG::Worklist::runThread):
(JSC::DFG::Worklist::threadFunction):

  • dfg/DFGWorklist.h:

(JSC::DFG::numberOfWorklists):
(JSC::DFG::worklistForIndexOrNull):

  • heap/CodeBlockSet.h:
  • heap/Heap.cpp:

(JSC::Heap::markRoots):
(JSC::Heap::collect):

  • runtime/IntendedStructureChain.cpp:

(JSC::IntendedStructureChain::visitChildren):

  • runtime/IntendedStructureChain.h:
  • runtime/VM.cpp:

(JSC::VM::~VM):
(JSC::VM::prepareToDiscardCode):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.h

    r163027 r163691  
    4747
    4848class CodeBlock;
     49class CodeBlockSet;
     50class SlotVisitor;
    4951
    5052namespace DFG {
     
    6971   
    7072    CompilationKey key();
     73   
     74    void visitChildren(SlotVisitor&, CodeBlockSet&);
    7175   
    7276    VM& vm;
Note: See TracChangeset for help on using the changeset viewer.