StructureStubInfo's usedRegisters set should be able to track all registers, not...
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 04:48:29 +0000 (04:48 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 04:48:29 +0000 (04:48 +0000)
commitd674ef4093a0347601e501245c28ed501a425eab
tree1566e9c8d39d99cdacc594e8b09111bbde5980aa
parentcebd99023c43556363826e1a1bc06e3a07ec1c0f
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries
https://bugs.webkit.org/show_bug.cgi?id=123076

Source/JavaScriptCore:

Reviewed by Sam Weinig.

Start preparing for a world in which we are patching code generated by LLVM, which may have
very different register usage conventions than our JITs. This requires us being more explicit
about the registers we are using. For example, the repatching code shouldn't take for granted
that tagMaskRegister holds the TagMask or that the register is even in use.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::numberOfRegisters):
(JSC::MacroAssembler::registerIndex):
(JSC::MacroAssembler::numberOfFPRegisters):
(JSC::MacroAssembler::fpRegisterIndex):
(JSC::MacroAssembler::totalNumberOfRegisters):
* bytecode/StructureStubInfo.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::usedRegisters):
* dfg/DFGSpeculativeJIT.h:
* ftl/FTLSaveRestore.cpp:
(JSC::FTL::bytesForGPRs):
(JSC::FTL::bytesForFPRs):
(JSC::FTL::offsetOfGPR):
(JSC::FTL::offsetOfFPR):
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITPutByIdGenerator::JITPutByIdGenerator):
* jit/JITInlineCacheGenerator.h:
(JSC::JITGetByIdGenerator::JITGetByIdGenerator):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_put_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_put_by_id):
* jit/RegisterSet.cpp: Added.
(JSC::RegisterSet::specialRegisters):
* jit/RegisterSet.h: Added.
(JSC::RegisterSet::RegisterSet):
(JSC::RegisterSet::set):
(JSC::RegisterSet::clear):
(JSC::RegisterSet::get):
(JSC::RegisterSet::merge):
* jit/Repatch.cpp:
(JSC::generateProtoChainAccessStub):
(JSC::tryCacheGetByID):
(JSC::tryBuildGetByIDList):
(JSC::emitPutReplaceStub):
(JSC::tryRepatchIn):
(JSC::linkClosureCall):
* jit/TempRegisterSet.cpp: Added.
(JSC::TempRegisterSet::TempRegisterSet):
* jit/TempRegisterSet.h:

Source/WTF:

Reviewed by Sam Weinig.

Teach BitVector how to efficiently merge (i.e. bitvector |=).

* wtf/BitVector.cpp:
(WTF::BitVector::mergeSlow):
* wtf/BitVector.h:
(WTF::BitVector::merge):
(WTF::BitVector::cleanseInlineBits):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/assembler/MacroAssembler.h
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/ftl/FTLSaveRestore.cpp
Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp
Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
Source/JavaScriptCore/jit/RegisterSet.cpp [new file with mode: 0644]
Source/JavaScriptCore/jit/RegisterSet.h [new file with mode: 0644]
Source/JavaScriptCore/jit/Repatch.cpp
Source/JavaScriptCore/jit/TempRegisterSet.cpp [new file with mode: 0644]
Source/JavaScriptCore/jit/TempRegisterSet.h
Source/WTF/ChangeLog
Source/WTF/wtf/BitVector.cpp
Source/WTF/wtf/BitVector.h