Commit 4513333c authored by fpizlo@apple.com's avatar fpizlo@apple.com

Move DFG inline caching logic into jit/

https://bugs.webkit.org/show_bug.cgi?id=121749

Rubber stamped by Sam Weinig.
        
We want to get rid of the baseline JIT's inline caching machinery and have it use the
DFG's instead. But before we do that we need to move the DFG's inline caching machine
out from behind its ENABLE(DFG_JIT) guards and make it available to the whole system.
This patch does that:
        
- dfg/DFGRepatch becomes jit/Repatch.
        
- The thunks used by the DFG IC go into jit/ThunkGenerators, instead of dfg/DFGThunks.
        
- The operations used by the DFG IC go into jit/JITOperations, instead of
  dfg/DFGOperations.
        
- The old JIT's thunk generators for calls are renamed to reduce confusion. Previously
  it was easy to know which generators belong to which JIT because the old JIT used
  JSC::virtualCallBlah and the DFG used JSC::DFG::virtualCallBlah, but that's not the
  case anymore. Note that the old JIT's thunk generators will die in a future patch.
        
No functional changes beyond those moves.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::unlink):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::resetStubInternal):
* bytecode/StructureStubInfo.h:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
(JSC::DFG::CallArrayAllocatorSlowPathGenerator::CallArrayAllocatorSlowPathGenerator):
(JSC::DFG::CallArrayAllocatorWithVariableSizeSlowPathGenerator::CallArrayAllocatorWithVariableSizeSlowPathGenerator):
* dfg/DFGJITCompiler.h:
* dfg/DFGOSRExitCompiler.h:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* dfg/DFGOperations.h:
(JSC::DFG::operationNewTypedArrayWithSizeForType):
(JSC::DFG::operationNewTypedArrayWithOneArgumentForType):
* dfg/DFGRegisterSet.h: Removed.
* dfg/DFGRepatch.cpp: Removed.
* dfg/DFGRepatch.h: Removed.
* dfg/DFGScratchRegisterAllocator.h: Removed.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeCompare):
(JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
(JSC::DFG::SpeculativeJIT::compare):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
* dfg/DFGThunks.h:
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::writeBarrier):
* jit/JIT.cpp:
(JSC::JIT::linkFor):
(JSC::JIT::linkSlowCall):
* jit/JITCall.cpp:
(JSC::JIT::compileCallEval):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):
* jit/JITOperationWrappers.h: Added.
* jit/JITOperations.cpp: Added.
* jit/JITOperations.h: Added.
* jit/RegisterSet.h: Added.
(JSC::RegisterSet::RegisterSet):
(JSC::RegisterSet::asPOD):
(JSC::RegisterSet::copyInfo):
(JSC::RegisterSet::set):
(JSC::RegisterSet::setGPRByIndex):
(JSC::RegisterSet::clear):
(JSC::RegisterSet::get):
(JSC::RegisterSet::getGPRByIndex):
(JSC::RegisterSet::getFreeGPR):
(JSC::RegisterSet::setFPRByIndex):
(JSC::RegisterSet::getFPRByIndex):
(JSC::RegisterSet::setByIndex):
(JSC::RegisterSet::getByIndex):
(JSC::RegisterSet::numberOfSetGPRs):
(JSC::RegisterSet::numberOfSetFPRs):
(JSC::RegisterSet::numberOfSetRegisters):
(JSC::RegisterSet::setBit):
(JSC::RegisterSet::clearBit):
(JSC::RegisterSet::getBit):
* jit/Repatch.cpp: Added.
(JSC::repatchCall):
(JSC::repatchByIdSelfAccess):
(JSC::addStructureTransitionCheck):
(JSC::replaceWithJump):
(JSC::emitRestoreScratch):
(JSC::linkRestoreScratch):
(JSC::generateProtoChainAccessStub):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::getPolymorphicStructureList):
(JSC::patchJumpToGetByIdStub):
(JSC::tryBuildGetByIDList):
(JSC::buildGetByIDList):
(JSC::appropriateGenericPutByIdFunction):
(JSC::appropriateListBuildingPutByIdFunction):
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
(JSC::tryCachePutByID):
(JSC::repatchPutByID):
(JSC::tryBuildPutByIdList):
(JSC::buildPutByIdList):
(JSC::tryRepatchIn):
(JSC::repatchIn):
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::linkClosureCall):
(JSC::resetGetByID):
(JSC::resetPutByID):
(JSC::resetIn):
* jit/Repatch.h: Added.
(JSC::resetGetByID):
(JSC::resetPutByID):
(JSC::resetIn):
* jit/ScratchRegisterAllocator.h: Added.
(JSC::ScratchRegisterAllocator::ScratchRegisterAllocator):
(JSC::ScratchRegisterAllocator::lock):
(JSC::ScratchRegisterAllocator::allocateScratch):
(JSC::ScratchRegisterAllocator::allocateScratchGPR):
(JSC::ScratchRegisterAllocator::allocateScratchFPR):
(JSC::ScratchRegisterAllocator::didReuseRegisters):
(JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
(JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
(JSC::ScratchRegisterAllocator::desiredScratchBufferSize):
(JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
* jit/ThunkGenerators.cpp:
(JSC::oldStyleGenerateSlowCaseFor):
(JSC::oldStyleLinkForGenerator):
(JSC::oldStyleLinkCallGenerator):
(JSC::oldStyleLinkConstructGenerator):
(JSC::oldStyleLinkClosureCallGenerator):
(JSC::oldStyleVirtualForGenerator):
(JSC::oldStyleVirtualCallGenerator):
(JSC::oldStyleVirtualConstructGenerator):
(JSC::emitPointerValidation):
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::linkForThunkGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkConstructThunkGenerator):
(JSC::linkClosureCallThunkGenerator):
(JSC::virtualForThunkGenerator):
(JSC::virtualCallThunkGenerator):
(JSC::virtualConstructThunkGenerator):
* jit/ThunkGenerators.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f9f3e940
......@@ -145,7 +145,6 @@ set(JavaScriptCore_SOURCES
dfg/DFGPlan.cpp
dfg/DFGPredictionInjectionPhase.cpp
dfg/DFGPredictionPropagationPhase.cpp
dfg/DFGRepatch.cpp
dfg/DFGSSAConversionPhase.cpp
dfg/DFGSpeculativeJIT.cpp
dfg/DFGSpeculativeJIT32_64.cpp
......@@ -224,6 +223,7 @@ set(JavaScriptCore_SOURCES
jit/JITExceptions.cpp
jit/JITOpcodes.cpp
jit/JITOpcodes32_64.cpp
jit/JITOperations.cpp
jit/JITPropertyAccess.cpp
jit/JITPropertyAccess32_64.cpp
jit/JITStubRoutine.cpp
......@@ -231,6 +231,7 @@ set(JavaScriptCore_SOURCES
jit/JITThunks.cpp
jit/JITToDFGDeferredCompilationCallback.cpp
jit/JumpReplacementWatchpoint.cpp
jit/Repatch.cpp
jit/ThunkGenerators.cpp
parser/Lexer.cpp
......
2013-09-21 Filip Pizlo <fpizlo@apple.com>
Move DFG inline caching logic into jit/
https://bugs.webkit.org/show_bug.cgi?id=121749
Rubber stamped by Sam Weinig.
We want to get rid of the baseline JIT's inline caching machinery and have it use the
DFG's instead. But before we do that we need to move the DFG's inline caching machine
out from behind its ENABLE(DFG_JIT) guards and make it available to the whole system.
This patch does that:
- dfg/DFGRepatch becomes jit/Repatch.
- The thunks used by the DFG IC go into jit/ThunkGenerators, instead of dfg/DFGThunks.
- The operations used by the DFG IC go into jit/JITOperations, instead of
dfg/DFGOperations.
- The old JIT's thunk generators for calls are renamed to reduce confusion. Previously
it was easy to know which generators belong to which JIT because the old JIT used
JSC::virtualCallBlah and the DFG used JSC::DFG::virtualCallBlah, but that's not the
case anymore. Note that the old JIT's thunk generators will die in a future patch.
No functional changes beyond those moves.
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::unlink):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::resetStubInternal):
* bytecode/StructureStubInfo.h:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
(JSC::DFG::CallArrayAllocatorSlowPathGenerator::CallArrayAllocatorSlowPathGenerator):
(JSC::DFG::CallArrayAllocatorWithVariableSizeSlowPathGenerator::CallArrayAllocatorWithVariableSizeSlowPathGenerator):
* dfg/DFGJITCompiler.h:
* dfg/DFGOSRExitCompiler.h:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* dfg/DFGOperations.h:
(JSC::DFG::operationNewTypedArrayWithSizeForType):
(JSC::DFG::operationNewTypedArrayWithOneArgumentForType):
* dfg/DFGRegisterSet.h: Removed.
* dfg/DFGRepatch.cpp: Removed.
* dfg/DFGRepatch.h: Removed.
* dfg/DFGScratchRegisterAllocator.h: Removed.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeCompare):
(JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
(JSC::DFG::SpeculativeJIT::compare):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
* dfg/DFGThunks.h:
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::writeBarrier):
* jit/JIT.cpp:
(JSC::JIT::linkFor):
(JSC::JIT::linkSlowCall):
* jit/JITCall.cpp:
(JSC::JIT::compileCallEval):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):
* jit/JITOperationWrappers.h: Added.
* jit/JITOperations.cpp: Added.
* jit/JITOperations.h: Added.
* jit/RegisterSet.h: Added.
(JSC::RegisterSet::RegisterSet):
(JSC::RegisterSet::asPOD):
(JSC::RegisterSet::copyInfo):
(JSC::RegisterSet::set):
(JSC::RegisterSet::setGPRByIndex):
(JSC::RegisterSet::clear):
(JSC::RegisterSet::get):
(JSC::RegisterSet::getGPRByIndex):
(JSC::RegisterSet::getFreeGPR):
(JSC::RegisterSet::setFPRByIndex):
(JSC::RegisterSet::getFPRByIndex):
(JSC::RegisterSet::setByIndex):
(JSC::RegisterSet::getByIndex):
(JSC::RegisterSet::numberOfSetGPRs):
(JSC::RegisterSet::numberOfSetFPRs):
(JSC::RegisterSet::numberOfSetRegisters):
(JSC::RegisterSet::setBit):
(JSC::RegisterSet::clearBit):
(JSC::RegisterSet::getBit):
* jit/Repatch.cpp: Added.
(JSC::repatchCall):
(JSC::repatchByIdSelfAccess):
(JSC::addStructureTransitionCheck):
(JSC::replaceWithJump):
(JSC::emitRestoreScratch):
(JSC::linkRestoreScratch):
(JSC::generateProtoChainAccessStub):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::getPolymorphicStructureList):
(JSC::patchJumpToGetByIdStub):
(JSC::tryBuildGetByIDList):
(JSC::buildGetByIDList):
(JSC::appropriateGenericPutByIdFunction):
(JSC::appropriateListBuildingPutByIdFunction):
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
(JSC::tryCachePutByID):
(JSC::repatchPutByID):
(JSC::tryBuildPutByIdList):
(JSC::buildPutByIdList):
(JSC::tryRepatchIn):
(JSC::repatchIn):
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::linkClosureCall):
(JSC::resetGetByID):
(JSC::resetPutByID):
(JSC::resetIn):
* jit/Repatch.h: Added.
(JSC::resetGetByID):
(JSC::resetPutByID):
(JSC::resetIn):
* jit/ScratchRegisterAllocator.h: Added.
(JSC::ScratchRegisterAllocator::ScratchRegisterAllocator):
(JSC::ScratchRegisterAllocator::lock):
(JSC::ScratchRegisterAllocator::allocateScratch):
(JSC::ScratchRegisterAllocator::allocateScratchGPR):
(JSC::ScratchRegisterAllocator::allocateScratchFPR):
(JSC::ScratchRegisterAllocator::didReuseRegisters):
(JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
(JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
(JSC::ScratchRegisterAllocator::desiredScratchBufferSize):
(JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
* jit/ThunkGenerators.cpp:
(JSC::oldStyleGenerateSlowCaseFor):
(JSC::oldStyleLinkForGenerator):
(JSC::oldStyleLinkCallGenerator):
(JSC::oldStyleLinkConstructGenerator):
(JSC::oldStyleLinkClosureCallGenerator):
(JSC::oldStyleVirtualForGenerator):
(JSC::oldStyleVirtualCallGenerator):
(JSC::oldStyleVirtualConstructGenerator):
(JSC::emitPointerValidation):
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::linkForThunkGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkConstructThunkGenerator):
(JSC::linkClosureCallThunkGenerator):
(JSC::virtualForThunkGenerator):
(JSC::virtualCallThunkGenerator):
(JSC::virtualConstructThunkGenerator):
* jit/ThunkGenerators.h:
2013-09-21 Anders Carlsson <andersca@apple.com>
Fix the non-DFG build.
......
......@@ -337,13 +337,9 @@ javascriptcore_sources += \
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp \
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.h \
Source/JavaScriptCore/dfg/DFGRegisterBank.h \
Source/JavaScriptCore/dfg/DFGRegisterSet.h \
Source/JavaScriptCore/dfg/DFGRepatch.cpp \
Source/JavaScriptCore/dfg/DFGRepatch.h \
Source/JavaScriptCore/dfg/DFGSafeToExecute.h \
Source/JavaScriptCore/dfg/DFGSaneStringGetByValSlowPathGenerator.h \
Source/JavaScriptCore/dfg/DFGScoreBoard.h \
Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h \
Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h \
Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h \
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp \
......@@ -630,6 +626,9 @@ javascriptcore_sources += \
Source/JavaScriptCore/jit/JITInlines.h \
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp \
Source/JavaScriptCore/jit/JITOpcodes.cpp \
Source/JavaScriptCore/jit/JITOperationWrappers.h \
Source/JavaScriptCore/jit/JITOperations.cpp \
Source/JavaScriptCore/jit/JITOperations.h \
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp \
Source/JavaScriptCore/jit/JITPropertyAccess.cpp \
Source/JavaScriptCore/jit/JITStubCall.h \
......@@ -652,6 +651,9 @@ javascriptcore_sources += \
Source/JavaScriptCore/jit/JSInterfaceJIT.h \
Source/JavaScriptCore/jit/JumpReplacementWatchpoint.cpp \
Source/JavaScriptCore/jit/JumpReplacementWatchpoint.h \
Source/JavaScriptCore/jit/Repatch.cpp \
Source/JavaScriptCore/jit/Repatch.h \
Source/JavaScriptCore/jit/ScratchRegisterAllocator.h \
Source/JavaScriptCore/jit/SlowPathCall.h \
Source/JavaScriptCore/jit/SpecializedThunkJIT.h \
Source/JavaScriptCore/jit/ThunkGenerator.h \
......
......@@ -377,6 +377,7 @@
<ClCompile Include="..\jit\JITExceptions.cpp" />
<ClCompile Include="..\jit\JITOpcodes.cpp" />
<ClCompile Include="..\jit\JITOpcodes32_64.cpp" />
<ClCompile Include="..\jit\JITOperations.cpp" />
<ClCompile Include="..\jit\JITPropertyAccess.cpp" />
<ClCompile Include="..\jit\JITPropertyAccess32_64.cpp" />
<ClCompile Include="..\jit\JITStubRoutine.cpp" />
......@@ -384,6 +385,7 @@
<ClCompile Include="..\jit\JITThunks.cpp" />
<ClCompile Include="..\jit\JITToDFGDeferredCompilationCallback.cpp" />
<ClCompile Include="..\jit\JumpReplacementWatchpoint.cpp" />
<ClCompile Include="..\jit\Repatch.cpp" />
<ClCompile Include="..\jit\ThunkGenerators.cpp" />
<ClCompile Include="..\llint\LLIntCLoop.cpp" />
<ClCompile Include="..\llint\LLIntData.cpp" />
......@@ -767,6 +769,8 @@
<ClInclude Include="..\jit\JITDisassembler.h" />
<ClInclude Include="..\jit\JITExceptions.h" />
<ClInclude Include="..\jit\JITInlines.h" />
<ClInclude Include="..\jit\JITOperationWrappers.h" />
<ClInclude Include="..\jit\JITOperations.h" />
<ClInclude Include="..\jit\JITStubCall.h" />
<ClInclude Include="..\jit\JITStubRoutine.h" />
<ClInclude Include="..\jit\JITStubs.h" />
......@@ -778,6 +782,9 @@
<ClInclude Include="..\jit\JITWriteBarrier.h" />
<ClInclude Include="..\jit\JSInterfaceJIT.h" />
<ClInclude Include="..\jit\JumpReplacementWatchpoint.h" />
<ClInclude Include="..\jit\RegisterSet.h" />
<ClInclude Include="..\jit\Repatch.h" />
<ClInclude Include="..\jit\ScratchRegisterAllocator.h" />
<ClInclude Include="..\jit\SpecializedThunkJIT.h" />
<ClInclude Include="..\jit\ThunkGenerator.h" />
<ClInclude Include="..\jit\ThunkGenerators.h" />
......
......@@ -182,7 +182,6 @@ SOURCES += \
dfg/DFGPlan.cpp \
dfg/DFGPredictionPropagationPhase.cpp \
dfg/DFGPredictionInjectionPhase.cpp \
dfg/DFGRepatch.cpp \
dfg/DFGSSAConversionPhase.cpp \
dfg/DFGSpeculativeJIT.cpp \
dfg/DFGSpeculativeJIT32_64.cpp \
......@@ -221,6 +220,7 @@ SOURCES += \
jit/JITExceptions.cpp \
jit/JITOpcodes.cpp \
jit/JITOpcodes32_64.cpp \
jit/JITOperations.cpp \
jit/JITPropertyAccess.cpp \
jit/JITPropertyAccess32_64.cpp \
jit/JITStubRoutine.cpp \
......@@ -228,6 +228,7 @@ SOURCES += \
jit/JITThunks.cpp \
jit/JITToDFGDeferredCompilationCallback.cpp \
jit/JumpReplacementWatchpoint.cpp \
jit/Repatch.cpp \
jit/ThunkGenerators.cpp \
llint/LLIntCLoop.cpp \
llint/LLIntData.cpp \
......
......@@ -40,12 +40,12 @@ void CallLinkInfo::unlink(VM& vm, RepatchBuffer& repatchBuffer)
repatchBuffer.revertJumpReplacementToBranchPtrWithPatch(RepatchBuffer::startOfBranchPtrWithPatchOnRegister(hotPathBegin), static_cast<MacroAssembler::RegisterID>(calleeGPR), 0);
if (isDFG) {
#if ENABLE(DFG_JIT)
repatchBuffer.relink(callReturnLocation, (callType == Construct ? vm.getCTIStub(DFG::linkConstructThunkGenerator) : vm.getCTIStub(DFG::linkCallThunkGenerator)).code());
repatchBuffer.relink(callReturnLocation, (callType == Construct ? vm.getCTIStub(linkConstructThunkGenerator) : vm.getCTIStub(linkCallThunkGenerator)).code());
#else
RELEASE_ASSERT_NOT_REACHED();
#endif
} else
repatchBuffer.relink(callReturnLocation, callType == Construct ? vm.getCTIStub(linkConstructGenerator).code() : vm.getCTIStub(linkCallGenerator).code());
repatchBuffer.relink(callReturnLocation, callType == Construct ? vm.getCTIStub(oldStyleLinkConstructGenerator).code() : vm.getCTIStub(oldStyleLinkCallGenerator).code());
hasSeenShouldRepatch = false;
callee.clear();
stub.clear();
......
......@@ -36,7 +36,6 @@
#include "DFGCommon.h"
#include "DFGDriver.h"
#include "DFGNode.h"
#include "DFGRepatch.h"
#include "DFGWorklist.h"
#include "Debugger.h"
#include "Interpreter.h"
......@@ -51,6 +50,7 @@
#include "PolymorphicPutByIdList.h"
#include "ReduceWhitespace.h"
#include "RepatchBuffer.h"
#include "Repatch.h"
#include "SlotVisitorInlines.h"
#include <stdio.h>
#include <wtf/CommaPrinter.h>
......@@ -2382,12 +2382,12 @@ void CodeBlock::resetStubInternal(RepatchBuffer& repatchBuffer, StructureStubInf
break;
case JITCode::DFGJIT:
if (isGetByIdAccess(accessType))
DFG::resetGetByID(repatchBuffer, stubInfo);
resetGetByID(repatchBuffer, stubInfo);
else if (isPutByIdAccess(accessType))
DFG::resetPutByID(repatchBuffer, stubInfo);
resetPutByID(repatchBuffer, stubInfo);
else {
RELEASE_ASSERT(isInAccess(accessType));
DFG::resetIn(repatchBuffer, stubInfo);
resetIn(repatchBuffer, stubInfo);
}
break;
default:
......
......@@ -31,12 +31,12 @@
#if ENABLE(JIT)
#include "CodeOrigin.h"
#include "DFGRegisterSet.h"
#include "Instruction.h"
#include "JITStubRoutine.h"
#include "MacroAssembler.h"
#include "Opcode.h"
#include "PolymorphicAccessStructureList.h"
#include "RegisterSet.h"
#include "Structure.h"
#include "StructureStubClearingWatchpoint.h"
#include <wtf/OwnPtr.h>
......@@ -231,7 +231,7 @@ struct StructureStubInfo {
int8_t valueTagGPR;
#endif
int8_t valueGPR;
DFG::RegisterSetPOD usedRegisters;
RegisterSetPOD usedRegisters;
int32_t deltaCallToDone;
int32_t deltaCallToStorageLoad;
int32_t deltaCallToStructCheck;
......
......@@ -40,7 +40,7 @@ namespace JSC { namespace DFG {
class CallArrayAllocatorSlowPathGenerator : public JumpingSlowPathGenerator<MacroAssembler::JumpList> {
public:
CallArrayAllocatorSlowPathGenerator(
MacroAssembler::JumpList from, SpeculativeJIT* jit, P_DFGOperation_EStZ function,
MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_EStZ function,
GPRReg resultGPR, GPRReg storageGPR, Structure* structure, size_t size)
: JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
, m_function(function)
......@@ -68,7 +68,7 @@ protected:
}
private:
P_DFGOperation_EStZ m_function;
P_JITOperation_EStZ m_function;
GPRReg m_resultGPR;
GPRReg m_storageGPR;
Structure* m_structure;
......@@ -79,7 +79,7 @@ private:
class CallArrayAllocatorWithVariableSizeSlowPathGenerator : public JumpingSlowPathGenerator<MacroAssembler::JumpList> {
public:
CallArrayAllocatorWithVariableSizeSlowPathGenerator(
MacroAssembler::JumpList from, SpeculativeJIT* jit, P_DFGOperation_EStZ function,
MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_EStZ function,
GPRReg resultGPR, Structure* contiguousStructure, Structure* arrayStorageStructure, GPRReg sizeGPR)
: JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
, m_function(function)
......@@ -112,7 +112,7 @@ protected:
}
private:
P_DFGOperation_EStZ m_function;
P_JITOperation_EStZ m_function;
GPRReg m_resultGPR;
Structure* m_contiguousStructure;
Structure* m_arrayStorageStructure;
......
......@@ -36,12 +36,12 @@
#include "DFGJITCode.h"
#include "DFGOSRExitCompilationInfo.h"
#include "DFGRegisterBank.h"
#include "DFGRegisterSet.h"
#include "FPRInfo.h"
#include "GPRInfo.h"
#include "JITCode.h"
#include "LinkBuffer.h"
#include "MacroAssembler.h"
#include "RegisterSet.h"
namespace JSC {
......
......@@ -76,7 +76,7 @@ private:
};
extern "C" {
void DFG_OPERATION compileOSRExit(ExecState*) WTF_INTERNAL;
void JIT_OPERATION compileOSRExit(ExecState*) WTF_INTERNAL;
}
} } // namespace JSC::DFG
......
This diff is collapsed.
This diff is collapsed.
......@@ -895,22 +895,6 @@ void SpeculativeJIT::useChildren(Node* node)
}
}
void SpeculativeJIT::writeBarrier(MacroAssembler& jit, GPRReg owner, GPRReg scratch1, GPRReg scratch2, WriteBarrierUseKind useKind)
{
UNUSED_PARAM(jit);
UNUSED_PARAM(owner);
UNUSED_PARAM(scratch1);
UNUSED_PARAM(scratch2);
UNUSED_PARAM(useKind);
ASSERT(owner != scratch1);
ASSERT(owner != scratch2);
ASSERT(scratch1 != scratch2);
#if ENABLE(WRITE_BARRIER_PROFILING)
JITCompiler::emitCount(jit, WriteBarrierCounters::jitCounterFor(useKind));
#endif
}
void SpeculativeJIT::writeBarrier(GPRReg ownerGPR, GPRReg valueGPR, Edge valueUse, WriteBarrierUseKind useKind, GPRReg scratch1, GPRReg scratch2)
{
UNUSED_PARAM(ownerGPR);
......@@ -1017,7 +1001,7 @@ void SpeculativeJIT::compileIn(Node* node)
#endif
}
bool SpeculativeJIT::nonSpeculativeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_DFGOperation_EJJ helperFunction)
bool SpeculativeJIT::nonSpeculativeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_JITOperation_EJJ helperFunction)
{
unsigned branchIndexInBlock = detectPeepHoleBranch();
if (branchIndexInBlock != UINT_MAX) {
......@@ -1465,7 +1449,7 @@ void SpeculativeJIT::compilePeepHoleInt32Branch(Node* node, Node* branchNode, JI
}
// Returns true if the compare is fused with a subsequent branch.
bool SpeculativeJIT::compilePeepHoleBranch(Node* node, MacroAssembler::RelationalCondition condition, MacroAssembler::DoubleCondition doubleCondition, S_DFGOperation_EJJ operation)
bool SpeculativeJIT::compilePeepHoleBranch(Node* node, MacroAssembler::RelationalCondition condition, MacroAssembler::DoubleCondition doubleCondition, S_JITOperation_EJJ operation)
{
// Fused compare & branch.
unsigned branchIndexInBlock = detectPeepHoleBranch();
......@@ -3842,7 +3826,7 @@ void SpeculativeJIT::compileArithMod(Node* node)
}
// Returns true if the compare is fused with a subsequent branch.
bool SpeculativeJIT::compare(Node* node, MacroAssembler::RelationalCondition condition, MacroAssembler::DoubleCondition doubleCondition, S_DFGOperation_EJJ operation)
bool SpeculativeJIT::compare(Node* node, MacroAssembler::RelationalCondition condition, MacroAssembler::DoubleCondition doubleCondition, S_JITOperation_EJJ operation)
{
if (compilePeepHoleBranch(node, condition, doubleCondition, operation))
return true;
......
......@@ -32,6 +32,7 @@
#include "ArrayPrototype.h"
#include "DFGAbstractInterpreterInlines.h"
#include "DFGCallArrayAllocatorSlowPathGenerator.h"
#include "DFGOperations.h"
#include "DFGSlowPathGenerator.h"
#include "JSActivation.h"
#include "ObjectPrototype.h"
......@@ -261,7 +262,7 @@ void SpeculativeJIT::cachedPutById(CodeOrigin codeOrigin, GPRReg basePayloadGPR,
JITCompiler::DataLabel32 payloadStoreWithPatch = m_jit.store32WithAddressOffsetPatch(valuePayloadGPR, JITCompiler::Address(scratchGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
JITCompiler::Label doneLabel = m_jit.label();
V_DFGOperation_EJCI optimizedCall;
V_JITOperation_EJCI optimizedCall;
if (m_jit.strictModeFor(m_currentNode->codeOrigin)) {
if (putKind == Direct)
optimizedCall = operationPutByIdDirectStrictOptimize;
......@@ -440,7 +441,7 @@ bool SpeculativeJIT::nonSpeculativeCompareNull(Node* node, Edge operand, bool in
return false;
}
void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode, MacroAssembler::RelationalCondition cond, S_DFGOperation_EJJ helperFunction)
void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode, MacroAssembler::RelationalCondition cond, S_JITOperation_EJJ helperFunction)
{
BasicBlock* taken = branchNode->takenBlock();
BasicBlock* notTaken = branchNode->notTakenBlock();
......@@ -512,13 +513,13 @@ void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode,
template<typename JumpType>
class CompareAndBoxBooleanSlowPathGenerator
: public CallSlowPathGenerator<JumpType, S_DFGOperation_EJJ, GPRReg> {
: public CallSlowPathGenerator<JumpType, S_JITOperation_EJJ, GPRReg> {
public:
CompareAndBoxBooleanSlowPathGenerator(
JumpType from, SpeculativeJIT* jit,
S_DFGOperation_EJJ function, GPRReg result, GPRReg arg1Tag, GPRReg arg1Payload,
S_JITOperation_EJJ function, GPRReg result, GPRReg arg1Tag, GPRReg arg1Payload,
GPRReg arg2Tag, GPRReg arg2Payload)
: CallSlowPathGenerator<JumpType, S_DFGOperation_EJJ, GPRReg>(
: CallSlowPathGenerator<JumpType, S_JITOperation_EJJ, GPRReg>(
from, jit, function, NeedToSpill, result)
, m_arg1Tag(arg1Tag)
, m_arg1Payload(arg1Payload)
......@@ -546,7 +547,7 @@ private:
GPRReg m_arg2Payload;
};
void SpeculativeJIT::nonSpeculativeNonPeepholeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_DFGOperation_EJJ helperFunction)
void SpeculativeJIT::nonSpeculativeNonPeepholeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_JITOperation_EJJ helperFunction)
{
JSValueOperand arg1(this, node->child1());
JSValueOperand arg2(this, node->child2());
......@@ -3611,7 +3612,7 @@ void SpeculativeJIT::compile(Node* node)
TrustedImm32(FinalObjectType)));
m_jit.move(thisValuePayloadGPR, tempGPR);
m_jit.move(thisValueTagGPR, tempTagGPR);
J_DFGOperation_EJ function;
J_JITOperation_EJ function;
if (m_jit.graph().executableFor(node->codeOrigin)->isStrictMode())
function = operationToThisStrict;
else
......
......@@ -32,6 +32,7 @@
#include "ArrayPrototype.h"
#include "DFGAbstractInterpreterInlines.h"
#include "DFGCallArrayAllocatorSlowPathGenerator.h"
#include "DFGOperations.h"
#include "DFGSlowPathGenerator.h"
#include "JSCJSValueInlines.h"
#include "ObjectPrototype.h"
......@@ -253,7 +254,7 @@ void SpeculativeJIT::cachedPutById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
JITCompiler::Label doneLabel = m_jit.label();
V_DFGOperation_EJCI optimizedCall;
V_JITOperation_EJCI optimizedCall;
if (m_jit.strictModeFor(m_currentNode->codeOrigin)) {
if (putKind == Direct)
optimizedCall = operationPutByIdDirectStrictOptimize;
......@@ -428,7 +429,7 @@ bool SpeculativeJIT::nonSpeculativeCompareNull(Node* node, Edge operand, bool in
return false;
}
void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode, MacroAssembler::RelationalCondition cond, S_DFGOperation_EJJ helperFunction)
void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode, MacroAssembler::RelationalCondition cond, S_JITOperation_EJJ helperFunction)
{
BasicBlock* taken = branchNode->takenBlock();
BasicBlock* notTaken = branchNode->notTakenBlock();
......@@ -498,12 +499,12 @@ void SpeculativeJIT::nonSpeculativePeepholeBranch(Node* node, Node* branchNode,
template<typename JumpType>
class CompareAndBoxBooleanSlowPathGenerator
: public CallSlowPathGenerator<JumpType, S_DFGOperation_EJJ, GPRReg> {
: public CallSlowPathGenerator<JumpType, S_JITOperation_EJJ, GPRReg> {
public:
CompareAndBoxBooleanSlowPathGenerator(
JumpType from, SpeculativeJIT* jit,
S_DFGOperation_EJJ function, GPRReg result, GPRReg arg1, GPRReg arg2)
: CallSlowPathGenerator<JumpType, S_DFGOperation_EJJ, GPRReg>(
S_JITOperation_EJJ function, GPRReg result, GPRReg arg1, GPRReg arg2)
: CallSlowPathGenerator<JumpType, S_JITOperation_EJJ, GPRReg>(
from, jit, function, NeedToSpill, result)
, m_arg1(arg1)
, m_arg2(arg2)
......@@ -525,7 +526,7 @@ private:
GPRReg m_arg2;
};
void SpeculativeJIT::nonSpeculativeNonPeepholeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_DFGOperation_EJJ helperFunction)
void SpeculativeJIT::nonSpeculativeNonPeepholeCompare(Node* node, MacroAssembler::RelationalCondition cond, S_JITOperation_EJJ helperFunction)
{
JSValueOperand arg1(this, node->child1());
JSValueOperand arg2(this, node->child2());
......@@ -3906,7 +3907,7 @@ void SpeculativeJIT::compile(Node* node)
MacroAssembler::Address(tempGPR, Structure::typeInfoTypeOffset()),
TrustedImm32(FinalObjectType)));
m_jit.move(thisValueGPR, tempGPR);
J_DFGOperation_EJ function;
J_JITOperation_EJ function;
if (m_jit.graph().executableFor(node->codeOrigin)->isStrictMode())
function = operationToThisStrict;
else
......
......@@ -93,238 +93,6 @@ MacroAssemblerCodeRef osrExitGenerationThunkGenerator(VM* vm)
return FINALIZE_CODE(patchBuffer, ("DFG OSR exit generation thunk"));
}
inline void emitPointerValidation(CCallHelpers& jit, GPRReg pointerGPR)
{
#if !ASSERT_DISABLED
CCallHelpers::Jump isNonZero = jit.branchTestPtr(CCallHelpers::NonZero, pointerGPR);
jit.breakpoint();
isNonZero.link(&jit);
jit.push(pointerGPR);
jit.load8(pointerGPR, pointerGPR);
jit.pop(pointerGPR);
#else
UNUSED_PARAM(jit);
UNUSED_PARAM(pointerGPR);
#endif
}
MacroAssemblerCodeRef throwExceptionFromCallSlowPathGenerator(VM* vm)
{
CCallHelpers jit(vm);
// We will jump to here if the JIT code thinks it's making a call, but the
// linking helper (C++ code) decided to throw an exception instead. We will
// have saved the callReturnIndex in the first arguments of JITStackFrame.
// Note that the return address will be on the stack at this point, so we
// need to remove it and drop it on the floor, since we don't care about it.
// Finally note that the call frame register points at the callee frame, so
// we need to pop it.
jit.preserveReturnAddressAfterCall(GPRInfo::nonPreservedNonReturnGPR);
jit.loadPtr(
CCallHelpers::Address(
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::CallerFrame),
GPRInfo::callFrameRegister);
#if USE(JSVALUE64)
jit.peek64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
#else
jit.peek(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
#endif
jit.setupArgumentsWithExecState(GPRInfo::nonPreservedNonReturnGPR);
jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(lookupExceptionHandler)), GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::nonArgGPR0);
jit.call(GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::returnValueGPR2);
jit.jump(GPRInfo::returnValueGPR2);
LinkBuffer patchBuffer(*vm, &jit, GLOBAL_THUNK_ID);
return FINALIZE_CODE(patchBuffer, ("DFG throw exception from call slow path thunk"));
}
static void slowPathFor(
CCallHelpers& jit, VM* vm, P_DFGOperation_E slowPathFunction)
{
jit.preserveReturnAddressAfterCall(GPRInfo::nonArgGPR2);
emitPointerValidation(jit, GPRInfo::nonArgGPR2);
jit.storePtr(
GPRInfo::nonArgGPR2,
CCallHelpers::Address(
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ReturnPC));
jit.storePtr(GPRInfo::callFrameRegister, &vm->topCallFrame);