InPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 00:07:20 +0000 (00:07 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 00:07:20 +0000 (00:07 +0000)
commitde9c26e123e0d35a015b14cb06ce64a91ac92272
tree27dff5ba7689ce07c2a6496ad41970b619b25180
parentc61822d2f2d1d15e7c12dab48c2a4887947b601f
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
Source/JavaScriptCore/dfg/DFGAbstractValue.h
Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/JavaScriptCore/dfg/DFGInPlaceAbstractState.cpp
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jsc.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/TinyPtrSet.h
Tools/ChangeLog
Tools/Scripts/run-jsc-benchmarks