Title: [107126] trunk/Source/_javascript_Core
Revision
107126
Author
[email protected]
Date
2012-02-08 13:22:49 -0800 (Wed, 08 Feb 2012)

Log Message

updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs
https://bugs.webkit.org/show_bug.cgi?id=78145

Reviewed by Gavin Barraclough.

Fix the updateTopCallFrame helper to store additional information
that becomes necessary when we are trying to provide more stack
frame information.

* interpreter/CallFrame.h:
(JSC::ExecState::bytecodeOffsetForBaselineJIT):
(ExecState):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JIT.h:
(JSC::JIT::compileGetByIdProto):
(JSC::JIT::compileGetByIdSelfList):
(JSC::JIT::compileGetByIdProtoList):
(JSC::JIT::compileGetByIdChainList):
(JSC::JIT::compileGetByIdChain):
(JSC::JIT::compilePutByIdTransition):
(JIT):
* jit/JITInlineMethods.h:
(JSC::JIT::updateTopCallFrame):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (107125 => 107126)


--- trunk/Source/_javascript_Core/ChangeLog	2012-02-08 21:12:58 UTC (rev 107125)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-02-08 21:22:49 UTC (rev 107126)
@@ -1,3 +1,30 @@
+2012-02-08  Oliver Hunt  <[email protected]>
+
+        updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs
+        https://bugs.webkit.org/show_bug.cgi?id=78145
+
+        Reviewed by Gavin Barraclough.
+
+        Fix the updateTopCallFrame helper to store additional information
+        that becomes necessary when we are trying to provide more stack
+        frame information.
+
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::bytecodeOffsetForBaselineJIT):
+        (ExecState):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompile):
+        * jit/JIT.h:
+        (JSC::JIT::compileGetByIdProto):
+        (JSC::JIT::compileGetByIdSelfList):
+        (JSC::JIT::compileGetByIdProtoList):
+        (JSC::JIT::compileGetByIdChainList):
+        (JSC::JIT::compileGetByIdChain):
+        (JSC::JIT::compilePutByIdTransition):
+        (JIT):
+        * jit/JITInlineMethods.h:
+        (JSC::JIT::updateTopCallFrame):
+
 2012-02-07  Robert Kroeger  <[email protected]>
 
         [chromium] Remove the enable marcro for the no longer necessary Chromium

Modified: trunk/Source/_javascript_Core/interpreter/CallFrame.h (107125 => 107126)


--- trunk/Source/_javascript_Core/interpreter/CallFrame.h	2012-02-08 21:12:58 UTC (rev 107125)
+++ trunk/Source/_javascript_Core/interpreter/CallFrame.h	2012-02-08 21:22:49 UTC (rev 107126)
@@ -106,6 +106,8 @@
         ReturnAddressPtr returnPC() const { return ReturnAddressPtr(this[RegisterFile::ReturnPC].vPC()); }
 #endif
         AbstractPC abstractReturnPC(JSGlobalData& globalData) { return AbstractPC(globalData, this); }
+        unsigned bytecodeOffsetForBaselineJIT() { return this[RegisterFile::ArgumentCount].tag(); }
+
 #if ENABLE(DFG_JIT)
         InlineCallFrame* inlineCallFrame() const { return this[RegisterFile::ReturnPC].asInlineCallFrame(); }
         unsigned codeOriginIndexForDFGWithInlining() const { return this[RegisterFile::ArgumentCount].tag(); }

Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (107125 => 107126)


--- trunk/Source/_javascript_Core/jit/JIT.cpp	2012-02-08 21:12:58 UTC (rev 107125)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp	2012-02-08 21:22:49 UTC (rev 107126)
@@ -606,7 +606,11 @@
         load32(payloadFor(RegisterFile::ArgumentCount), regT1);
         branch32(AboveOrEqual, regT1, TrustedImm32(m_codeBlock->m_numParameters)).linkTo(beginLabel, this);
 
+        m_bytecodeOffset = 0;
         JITStubCall(this, m_codeBlock->m_isConstructor ? cti_op_construct_arityCheck : cti_op_call_arityCheck).call(callFrameRegister);
+#if !ASSERT_DISABLED
+        m_bytecodeOffset = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
+#endif
 
         jump(beginLabel);
     }

Modified: trunk/Source/_javascript_Core/jit/JIT.h (107125 => 107126)


--- trunk/Source/_javascript_Core/jit/JIT.h	2012-02-08 21:12:58 UTC (rev 107125)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2012-02-08 21:22:49 UTC (rev 107126)
@@ -207,34 +207,40 @@
         static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, ident, slot, cachedOffset, returnAddress, callFrame);
         }
 
         static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, ident, slot, cachedOffset);
         }
         static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, ident, slot, cachedOffset, callFrame);
         }
         static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, ident, slot, cachedOffset, callFrame);
         }
 
         static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, ident, slot, cachedOffset, returnAddress, callFrame);
         }
         
         static void compilePutByIdTransition(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct)
         {
             JIT jit(globalData, codeBlock);
+            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
             jit.privateCompilePutByIdTransition(stubInfo, oldStructure, newStructure, cachedOffset, chain, returnAddress, direct);
         }
 
@@ -398,9 +404,9 @@
         static const int patchOffsetGetByIdPropertyMapOffset2 = 22;
         static const int patchOffsetGetByIdPutResult = 22;
 #if ENABLE(OPCODE_SAMPLING)
-        static const int patchOffsetGetByIdSlowCaseCall = 37;
+        static const int patchOffsetGetByIdSlowCaseCall = 44;
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 33;
+        static const int patchOffsetGetByIdSlowCaseCall = 40;
 #endif
         static const int patchOffsetOpCallCompareToJump = 6;
 
@@ -421,7 +427,7 @@
 #if ENABLE(OPCODE_SAMPLING)
         #error "OPCODE_SAMPLING is not yet supported"
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 40;
+        static const int patchOffsetGetByIdSlowCaseCall = 48;
 #endif
         static const int patchOffsetOpCallCompareToJump = 12;
 
@@ -458,7 +464,7 @@
 #if ENABLE(OPCODE_SAMPLING)
         #error "OPCODE_SAMPLING is not yet supported"
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 40;
+        static const int patchOffsetGetByIdSlowCaseCall = 48;
 #endif
         static const int patchOffsetOpCallCompareToJump = 16;
 
@@ -634,9 +640,9 @@
         static const int patchOffsetGetByIdPropertyMapOffset = 28;
         static const int patchOffsetGetByIdPutResult = 28;
 #if ENABLE(OPCODE_SAMPLING)
-        static const int patchOffsetGetByIdSlowCaseCall = 64;
+        static const int patchOffsetGetByIdSlowCaseCall = 72;
 #else
-        static const int patchOffsetGetByIdSlowCaseCall = 54;
+        static const int patchOffsetGetByIdSlowCaseCall = 62;
 #endif
         static const int patchOffsetOpCallCompareToJump = 9;
 

Modified: trunk/Source/_javascript_Core/jit/JITInlineMethods.h (107125 => 107126)


--- trunk/Source/_javascript_Core/jit/JITInlineMethods.h	2012-02-08 21:12:58 UTC (rev 107125)
+++ trunk/Source/_javascript_Core/jit/JITInlineMethods.h	2012-02-08 21:22:49 UTC (rev 107126)
@@ -264,6 +264,9 @@
 
 ALWAYS_INLINE void JIT::updateTopCallFrame()
 {
+    ASSERT(static_cast<int>(m_bytecodeOffset) >= 0);
+    if (m_bytecodeOffset)
+        store32(Imm32(m_bytecodeOffset + 1), intTagFor(RegisterFile::ArgumentCount));
     storePtr(callFrameRegister, &m_globalData->topCallFrame);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to