Air should be powerful enough to support Tmp-splitting
https://bugs.webkit.org/show_bug.cgi?id=169515
Reviewed by Saam Barati.
Source/JavaScriptCore:
In the process of implementing the Tmp-splitting optimization, I made some small
clean-ups. They don't affect anything - it's basically moving code around and adding
utility functions.
- CMakeLists.txt:
- JavaScriptCore.xcodeproj/project.pbxproj:
- assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation.
- b3/air/AirAllocateRegistersByGraphColoring.cpp:
- b3/air/AirAllocateRegistersByGraphColoring.h:
(JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using.
(WTF::printInternal):
(JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out.
- b3/air/AirBreakCriticalEdges.cpp: Added.
(JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility.
- b3/air/AirBreakCriticalEdges.h: Added.
- b3/air/AirGenerate.cpp:
- b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>.
(JSC::B3::Air::InsertionSet::InsertionSet):
(JSC::B3::Air::InsertionSet::code):
- b3/air/AirLiveness.h: Teach Liveness to track only warm liveness.
(JSC::B3::Air::TmpLivenessAdapter::acceptsRole):
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole):
(JSC::B3::Air::RegLivenessAdapter::acceptsRole):
(JSC::B3::Air::AbstractLiveness::AbstractLiveness):
(JSC::B3::Air::AbstractLiveness::LocalCalc::execute):
Source/WTF:
Teach IndexMap how to handle types that don't have a default constructor. This makes it
easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful
construct.
(WTF::IndexMap::IndexMap):
(WTF::IndexMap::resize):
(WTF::IndexMap::clear):