Commit 60eeb9a2 authored by kmccullough@apple.com's avatar kmccullough@apple.com

2009-06-16 Sam Weinig <sam@webkit.org>

        Reviewed by Oliver Hunt.

        Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
        it for each type of stub using the return address to find the correct
        offset.

        * jit/JIT.cpp:
        (JSC::JIT::JIT):
        * jit/JIT.h:
        (JSC::JIT::compileGetByIdProto):
        (JSC::JIT::compileGetByIdSelfList):
        (JSC::JIT::compileGetByIdProtoList):
        (JSC::JIT::compileGetByIdChainList):
        (JSC::JIT::compileGetByIdChain):
        (JSC::JIT::compilePutByIdTransition):
        (JSC::JIT::compileCTIMachineTrampolines):
        (JSC::JIT::compilePatchGetArrayLength):
        * jit/JITStubCall.h:
        (JSC::JITStubCall::call):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b8a3200f
2009-06-16 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
it for each type of stub using the return address to find the correct
offset.
* jit/JIT.cpp:
(JSC::JIT::JIT):
* jit/JIT.h:
(JSC::JIT::compileGetByIdProto):
(JSC::JIT::compileGetByIdSelfList):
(JSC::JIT::compileGetByIdProtoList):
(JSC::JIT::compileGetByIdChainList):
(JSC::JIT::compileGetByIdChain):
(JSC::JIT::compilePutByIdTransition):
(JSC::JIT::compileCTIMachineTrampolines):
(JSC::JIT::compilePatchGetArrayLength):
* jit/JITStubCall.h:
(JSC::JITStubCall::call):
== Rolled over to ChangeLog-2009-06-16 ==
......@@ -71,6 +71,7 @@ JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock)
, m_labels(codeBlock ? codeBlock->instructions().size() : 0)
, m_propertyAccessCompilationInfo(codeBlock ? codeBlock->numberOfStructureStubInfos() : 0)
, m_callStructureStubCompilationInfo(codeBlock ? codeBlock->numberOfCallLinkInfos() : 0)
, m_bytecodeIndex(-1)
, m_lastResultBytecodeRegister(std::numeric_limits<int>::max())
, m_jumpTargetsPosition(0)
{
......
......@@ -337,40 +337,61 @@ namespace JSC {
static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, cachedOffset, returnAddress, callFrame);
}
static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, cachedOffset);
}
static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, cachedOffset, callFrame);
}
static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, cachedOffset, callFrame);
}
static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, cachedOffset, returnAddress, callFrame);
}
static void compilePutByIdTransition(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompilePutByIdTransition(stubInfo, oldStructure, newStructure, cachedOffset, chain, returnAddress);
}
static void compileCTIMachineTrampolines(JSGlobalData* globalData, RefPtr<ExecutablePool>* executablePool, CodePtr* ctiArrayLengthTrampoline, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCallPreLink, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk)
{
JIT jit(globalData);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
jit.privateCompileCTIMachineTrampolines(executablePool, globalData, ctiArrayLengthTrampoline, ctiStringLengthTrampoline, ctiVirtualCallPreLink, ctiVirtualCallLink, ctiVirtualCall, ctiNativeCallThunk);
}
......@@ -381,6 +402,9 @@ namespace JSC {
static void compilePatchGetArrayLength(JSGlobalData* globalData, CodeBlock* codeBlock, ReturnAddressPtr returnAddress)
{
JIT jit(globalData, codeBlock);
#if ENABLE(OPCODE_SAMPLING)
jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value());
#endif
return jit.privateCompilePatchGetArrayLength(returnAddress);
}
......
......@@ -107,9 +107,8 @@ namespace JSC {
JIT::Call call()
{
ASSERT(m_jit->m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
#if ENABLE(OPCODE_SAMPLING)
ASSERT(m_jit->m_bytecodeIndex != (unsigned)-1);
m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, true);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment