Record the HashSet/HashMap operations in DFG/FTL/B3 and replay them in a benchmark
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Mar 2017 21:37:41 +0000 (21:37 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Mar 2017 21:37:41 +0000 (21:37 +0000)
commite6ade3af2ecc4bbaae6162e0bcf45ca2918b2514
treec9ce5e3c7ecdfca25d8ae8afe8c448127edd157c
parent5ce1d78020b94efff22adac6178add009ff94568
Record the HashSet/HashMap operations in DFG/FTL/B3 and replay them in a benchmark
https://bugs.webkit.org/show_bug.cgi?id=169590

Reviewed by Saam Barati.

Source/JavaScriptCore:

Adds code to support logging some hashtable stuff in the DFG.

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::pruneHeap):
* dfg/DFGCombinedLiveness.cpp:
(JSC::DFG::liveNodesAtHead):
(JSC::DFG::CombinedLiveness::CombinedLiveness):
* dfg/DFGCombinedLiveness.h:
* dfg/DFGLivenessAnalysisPhase.cpp:
(JSC::DFG::LivenessAnalysisPhase::run):
(JSC::DFG::LivenessAnalysisPhase::processBlock):
* dfg/DFGNode.cpp:
* dfg/DFGNode.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:

Source/WTF:

This adds LoggingHashSet and LoggingHashMap, which are drop-in replacements for HashSet and
HashMap that log everything that they do, so that you can replay it later.

This also adds a benchmark (HashSetDFGReplay) based on doing a recording of some of the HashSets
in the DFG compiler.

* WTF.xcodeproj/project.pbxproj:
* benchmarks/HashSetDFGReplay.cpp: Added.
(benchmark):
(main):
* wtf/CMakeLists.txt:
* wtf/GlobalVersion.cpp: Added.
(WTF::newGlobalVersion):
* wtf/GlobalVersion.h: Added.
* wtf/HashMap.h:
(WTF::X>::swap):
* wtf/HashSet.h:
(WTF::V>::addVoid):
* wtf/LoggingHashID.h: Added.
(WTF::LoggingHashID::LoggingHashID):
(WTF::LoggingHashID::dump):
* wtf/LoggingHashMap.h: Added.
* wtf/LoggingHashSet.h: Added.
* wtf/LoggingHashTraits.h: Added.
(WTF::LoggingHashKeyTraits::print):
(WTF::LoggingHashValueTraits::print):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAvailabilityMap.cpp
Source/JavaScriptCore/dfg/DFGCombinedLiveness.cpp
Source/JavaScriptCore/dfg/DFGCombinedLiveness.h
Source/JavaScriptCore/dfg/DFGLivenessAnalysisPhase.cpp
Source/JavaScriptCore/dfg/DFGNode.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/benchmarks/HashSetDFGReplay.cpp [new file with mode: 0644]
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/GlobalVersion.cpp [new file with mode: 0644]
Source/WTF/wtf/GlobalVersion.h [new file with mode: 0644]
Source/WTF/wtf/HashMap.h
Source/WTF/wtf/HashSet.h
Source/WTF/wtf/LoggingHashID.h [new file with mode: 0644]
Source/WTF/wtf/LoggingHashMap.h [new file with mode: 0644]
Source/WTF/wtf/LoggingHashSet.h [new file with mode: 0644]
Source/WTF/wtf/LoggingHashTraits.h [new file with mode: 0644]