Ignore:
Timestamp:
May 7, 2018, 5:07:20 PM (7 years ago)
Author:
[email protected]
Message:

InPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
https://bugs.webkit.org/show_bug.cgi?id=185365

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch does three things to improve compile times:

  • Fixes some inlining goofs.


  • Adds the ability to measure compile times with run-jsc-benchmarks.


  • Dramatically improves the performance of InPlaceAbstractState::beginBasicBlock by removing the code that clears abstract values. It turns out that on constant folding "needed" this, in the sense that this was the only thing protecting it from loading the abstract value of a no-result node and then concluding that because it had a non-empty m_value, it could be constant-folded. Any node that produces a result will explicitly set its abstract value, so this problem can also be guarded by just having constant folding check if the node it wants to fold returns any result.


Solid 0.96% compile time speed-up across SunSpider-CompileTime and V8Spider-CompileTime.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGAbstractValue.cpp:

(JSC::DFG::AbstractValue::set):

  • dfg/DFGAbstractValue.h:

(JSC::DFG::AbstractValue::merge):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::foldConstants):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::doToChildrenWithNode):
(JSC::DFG::Graph::doToChildren):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::beginBasicBlock):

  • jit/JIT.cpp:

(JSC::JIT::totalCompileTime):

  • jit/JIT.h:
  • jsc.cpp:

(GlobalObject::finishCreation):
(functionTotalCompileTime):

Source/WTF:

Fix some inlining goof-ups.

  • wtf/TinyPtrSet.h:

(WTF::TinyPtrSet::add):
(WTF::TinyPtrSet::merge):
(WTF::TinyPtrSet::addOutOfLine):
(WTF::TinyPtrSet::mergeOtherOutOfLine):

Tools:

Make it possible to measure compile times.

  • Scripts/run-jsc-benchmarks:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r231339 r231468  
    348348static EncodedJSValue JSC_HOST_CALL functionDisableRichSourceInfo(ExecState*);
    349349static EncodedJSValue JSC_HOST_CALL functionMallocInALoop(ExecState*);
     350static EncodedJSValue JSC_HOST_CALL functionTotalCompileTime(ExecState*);
    350351
    351352struct Script {
     
    607608        addFunction(vm, "disableRichSourceInfo", functionDisableRichSourceInfo, 0);
    608609        addFunction(vm, "mallocInALoop", functionMallocInALoop, 0);
     610        addFunction(vm, "totalCompileTime", functionTotalCompileTime, 0);
    609611    }
    610612   
     
    18101812}
    18111813
     1814EncodedJSValue JSC_HOST_CALL functionTotalCompileTime(ExecState*)
     1815{
     1816    return JSValue::encode(jsNumber(JIT::totalCompileTime().milliseconds()));
     1817}
     1818
    18121819template<typename ValueType>
    18131820typename std::enable_if<!std::is_fundamental<ValueType>::value>::type addOption(VM&, JSObject*, Identifier, ValueType) { }
Note: See TracChangeset for help on using the changeset viewer.