Ignore:
Timestamp:
Feb 9, 2014, 11:21:09 PM (12 years ago)
Author:
[email protected]
Message:

GC blocks on FTL and then badness
https://bugs.webkit.org/show_bug.cgi?id=128291

Reviewed by Oliver Hunt.

Introduce the notion of a DFG::Safepoint, which allows you to unlock the rightToRun
mutex for your JIT thread, while supplying the GC with all of the information it would
need to scan you at that moment in time. The default way of using this is
DFG::GraphSafepoint, where you just supply the Graph. There's a lot of machinery in
this patch just to make the Graph scannable.

We then use DFG::GraphSafepoint in just two places for now: (1) while initializing LLVM
and (2) while invoking LLVM' optimizer and backend.

This is a 30% speed-up on Octane/typescript and a 10% speed-up on Octane/gbemu. 2-3%
speed-up overall on Octane.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • dfg/DFGDriver.cpp:

(JSC::DFG::compileImpl):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::visitChildren):

  • dfg/DFGGraph.h:
  • dfg/DFGGraphSafepoint.cpp: Added.

(JSC::DFG::GraphSafepoint::GraphSafepoint):
(JSC::DFG::GraphSafepoint::~GraphSafepoint):

  • dfg/DFGGraphSafepoint.h: Added.
  • dfg/DFGOperations.h:
  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):

  • dfg/DFGPlan.h:
  • dfg/DFGSafepoint.cpp: Added.

(JSC::DFG::Safepoint::Safepoint):
(JSC::DFG::Safepoint::~Safepoint):
(JSC::DFG::Safepoint::add):
(JSC::DFG::Safepoint::begin):
(JSC::DFG::Safepoint::visitChildren):

  • dfg/DFGSafepoint.h: Added.
  • dfg/DFGScannable.h: Added.

(JSC::DFG::Scannable::Scannable):
(JSC::DFG::Scannable::~Scannable):

  • dfg/DFGThreadData.cpp: Added.

(JSC::DFG::ThreadData::ThreadData):
(JSC::DFG::ThreadData::~ThreadData):

  • dfg/DFGThreadData.h: Added.
  • dfg/DFGWorklist.cpp:

(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::visitChildren):
(JSC::DFG::Worklist::runThread):

  • dfg/DFGWorklist.h:
  • ftl/FTLCompile.cpp:

(JSC::FTL::compile):

  • heap/SlotVisitor.h:
  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::appendUnbarrieredReadOnlyPointer):
(JSC::SlotVisitor::appendUnbarrieredReadOnlyValue):

File:
1 edited

Legend:

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

    r163223 r163765  
    4141#include "DFGNodeAllocator.h"
    4242#include "DFGPlan.h"
     43#include "DFGScannable.h"
    4344#include "DFGVariadicFunction.h"
    4445#include "InlineCallFrameSet.h"
     
    7980// The order may be significant for nodes with side-effects (property accesses, value conversions).
    8081// Nodes that are 'dead' remain in the vector with refCount 0.
    81 class Graph {
     82class Graph : public virtual Scannable {
    8283public:
    8384    Graph(VM&, Plan&, LongLivedState&);
     
    799800    JSArrayBufferView* tryGetFoldableView(Node*, ArrayMode);
    800801    JSArrayBufferView* tryGetFoldableViewForChild1(Node*);
     802   
     803    virtual void visitChildren(SlotVisitor&) override;
    801804   
    802805    VM& m_vm;
Note: See TracChangeset for help on using the changeset viewer.