Title: [145933] trunk/Source/_javascript_Core
Revision
145933
Author
[email protected]
Date
2013-03-15 13:24:39 -0700 (Fri, 15 Mar 2013)

Log Message

Cleanup of DFG and Baseline JIT debugging code
https://bugs.webkit.org/show_bug.cgi?id=111871

Reviewed by Geoffrey Garen.

Fixed various debug related issue in baseline and DFG JITs. See below.

* dfg/DFGRepatch.cpp:
(JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
pointer to scratch register length.
(JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
* jit/JITCall.cpp:
(JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* jit/JITCall32_64.cpp:
(JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* runtime/JSGlobalData.h:
(JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
be on a double boundary.
(JSC::ScratchBuffer::setActiveLength):
(JSC::ScratchBuffer::activeLength):
(JSC::ScratchBuffer::activeLengthPtr):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (145932 => 145933)


--- trunk/Source/_javascript_Core/ChangeLog	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-03-15 20:24:39 UTC (rev 145933)
@@ -1,5 +1,34 @@
 2013-03-15  Michael Saboff  <[email protected]>
 
+        Cleanup of DFG and Baseline JIT debugging code
+        https://bugs.webkit.org/show_bug.cgi?id=111871
+
+        Reviewed by Geoffrey Garen.
+
+        Fixed various debug related issue in baseline and DFG JITs. See below.
+
+        * dfg/DFGRepatch.cpp:
+        (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
+        * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
+        pointer to scratch register length.
+        (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
+        (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
+        DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
+        * jit/JITCall.cpp:
+        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
+        * jit/JITCall32_64.cpp:
+        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
+        * runtime/JSGlobalData.h:
+        (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
+        be on a double boundary.
+        (JSC::ScratchBuffer::setActiveLength):
+        (JSC::ScratchBuffer::activeLength):
+        (JSC::ScratchBuffer::activeLengthPtr):
+
+2013-03-15  Michael Saboff  <[email protected]>
+
         Add runtime check for improper register allocations in DFG
         https://bugs.webkit.org/show_bug.cgi?id=112380
 

Modified: trunk/Source/_javascript_Core/dfg/DFGRepatch.cpp (145932 => 145933)


--- trunk/Source/_javascript_Core/dfg/DFGRepatch.cpp	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/dfg/DFGRepatch.cpp	2013-03-15 20:24:39 UTC (rev 145933)
@@ -1234,7 +1234,7 @@
             patchBuffer,
             ("DFG closure call stub for %s, return point %p, target %p (%s)",
                 toCString(*callerCodeBlock).data(), callLinkInfo.callReturnLocation.labelAtOffset(0).executableAddress(),
-                codePtr.executableAddress(), toCString(*calleeCodeBlock).data())),
+                codePtr.executableAddress(), toCString(pointerDump(calleeCodeBlock)).data())),
         *globalData, callerCodeBlock->ownerExecutable(), structure, executable, callLinkInfo.codeOrigin));
     
     RepatchBuffer repatchBuffer(callerCodeBlock);

Modified: trunk/Source/_javascript_Core/dfg/DFGScratchRegisterAllocator.h (145932 => 145933)


--- trunk/Source/_javascript_Core/dfg/DFGScratchRegisterAllocator.h	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/dfg/DFGScratchRegisterAllocator.h	2013-03-15 20:24:39 UTC (rev 145933)
@@ -146,7 +146,7 @@
         }
         RELEASE_ASSERT(count * sizeof(JSValue) == desiredScratchBufferSize());
         
-        jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
+        jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratchGPR);
         jit.storePtr(MacroAssembler::TrustedImmPtr(static_cast<size_t>(count * sizeof(JSValue))), scratchGPR);
     }
     
@@ -163,7 +163,7 @@
         }
         RELEASE_ASSERT(scratchGPR != InvalidGPRReg);
         
-        jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
+        jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratchGPR);
         jit.storePtr(MacroAssembler::TrustedImmPtr(0), scratchGPR);
 
         // Restore double registers first.

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (145932 => 145933)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2013-03-15 20:24:39 UTC (rev 145933)
@@ -1148,6 +1148,11 @@
             }
             break;
         }
+        case DataFormatOSRMarker:
+        case DataFormatDead:
+        case DataFormatArguments:
+            RELEASE_ASSERT_NOT_REACHED();
+            break;
         }
     }
 

Modified: trunk/Source/_javascript_Core/jit/JITCall.cpp (145932 => 145933)


--- trunk/Source/_javascript_Core/jit/JITCall.cpp	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/jit/JITCall.cpp	2013-03-15 20:24:39 UTC (rev 145933)
@@ -257,7 +257,7 @@
                 toCString(*m_codeBlock).data(),
                 callLinkInfo->hotPathOther.labelAtOffset(0).executableAddress(),
                 codePtr.executableAddress(),
-                toCString(*calleeCodeBlock).data())),
+                toCString(pointerDump(calleeCodeBlock)).data())),
         *m_globalData, m_codeBlock->ownerExecutable(), expectedStructure, expectedExecutable,
         callLinkInfo->codeOrigin));
     

Modified: trunk/Source/_javascript_Core/jit/JITCall32_64.cpp (145932 => 145933)


--- trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-03-15 20:24:39 UTC (rev 145933)
@@ -337,7 +337,7 @@
                 toCString(*m_codeBlock).data(),
                 callLinkInfo->hotPathOther.labelAtOffset(0).executableAddress(),
                 codePtr.executableAddress(),
-                toCString(*calleeCodeBlock).data())),
+                toCString(pointerDump(calleeCodeBlock)).data())),
         *m_globalData, m_codeBlock->ownerExecutable(), expectedStructure, expectedExecutable,
         callLinkInfo->codeOrigin));
     

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (145932 => 145933)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2013-03-15 20:12:15 UTC (rev 145932)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2013-03-15 20:24:39 UTC (rev 145933)
@@ -132,8 +132,8 @@
 #endif
     struct ScratchBuffer {
         ScratchBuffer()
-            : m_activeLength(0)
         {
+            u.m_activeLength = 0;
         }
 
         static ScratchBuffer* create(size_t size)
@@ -144,12 +144,15 @@
         }
 
         static size_t allocationSize(size_t bufferSize) { return sizeof(ScratchBuffer) + bufferSize; }
-        void setActiveLength(size_t activeLength) { m_activeLength = activeLength; }
-        size_t activeLength() const { return m_activeLength; };
-        size_t* activeLengthPtr() { return &m_activeLength; };
+        void setActiveLength(size_t activeLength) { u.m_activeLength = activeLength; }
+        size_t activeLength() const { return u.m_activeLength; };
+        size_t* activeLengthPtr() { return &u.m_activeLength; };
         void* dataBuffer() { return m_buffer; }
 
-        size_t m_activeLength;
+        union {
+            size_t m_activeLength;
+            double pad; // Make sure m_buffer is double aligned.
+        } u;
 #if CPU(MIPS) && (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == 2)
         void* m_buffer[0] __attribute__((aligned(8)));
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to