Changeset 145933 in webkit


Ignore:
Timestamp:
Mar 15, 2013 1:24:39 PM (11 years ago)
Author:
msaboff@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r145931 r145933  
     12013-03-15  Michael Saboff  <msaboff@apple.com>
     2
     3        Cleanup of DFG and Baseline JIT debugging code
     4        https://bugs.webkit.org/show_bug.cgi?id=111871
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Fixed various debug related issue in baseline and DFG JITs. See below.
     9
     10        * dfg/DFGRepatch.cpp:
     11        (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
     12        * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
     13        pointer to scratch register length.
     14        (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
     15        (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
     16        * dfg/DFGSpeculativeJIT.cpp:
     17        (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
     18        DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
     19        * jit/JITCall.cpp:
     20        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
     21        * jit/JITCall32_64.cpp:
     22        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
     23        * runtime/JSGlobalData.h:
     24        (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
     25        be on a double boundary.
     26        (JSC::ScratchBuffer::setActiveLength):
     27        (JSC::ScratchBuffer::activeLength):
     28        (JSC::ScratchBuffer::activeLengthPtr):
     29
    1302013-03-15  Michael Saboff  <msaboff@apple.com>
    231
  • trunk/Source/JavaScriptCore/dfg/DFGRepatch.cpp

    r141951 r145933  
    12351235            ("DFG closure call stub for %s, return point %p, target %p (%s)",
    12361236                toCString(*callerCodeBlock).data(), callLinkInfo.callReturnLocation.labelAtOffset(0).executableAddress(),
    1237                 codePtr.executableAddress(), toCString(*calleeCodeBlock).data())),
     1237                codePtr.executableAddress(), toCString(pointerDump(calleeCodeBlock)).data())),
    12381238        *globalData, callerCodeBlock->ownerExecutable(), structure, executable, callLinkInfo.codeOrigin));
    12391239   
  • trunk/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h

    r140619 r145933  
    147147        RELEASE_ASSERT(count * sizeof(JSValue) == desiredScratchBufferSize());
    148148       
    149         jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
     149        jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratchGPR);
    150150        jit.storePtr(MacroAssembler::TrustedImmPtr(static_cast<size_t>(count * sizeof(JSValue))), scratchGPR);
    151151    }
     
    164164        RELEASE_ASSERT(scratchGPR != InvalidGPRReg);
    165165       
    166         jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
     166        jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratchGPR);
    167167        jit.storePtr(MacroAssembler::TrustedImmPtr(0), scratchGPR);
    168168
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r145329 r145933  
    11491149            break;
    11501150        }
     1151        case DataFormatOSRMarker:
     1152        case DataFormatDead:
     1153        case DataFormatArguments:
     1154            RELEASE_ASSERT_NOT_REACHED();
     1155            break;
    11511156        }
    11521157    }
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r144137 r145933  
    258258                callLinkInfo->hotPathOther.labelAtOffset(0).executableAddress(),
    259259                codePtr.executableAddress(),
    260                 toCString(*calleeCodeBlock).data())),
     260                toCString(pointerDump(calleeCodeBlock)).data())),
    261261        *m_globalData, m_codeBlock->ownerExecutable(), expectedStructure, expectedExecutable,
    262262        callLinkInfo->codeOrigin));
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r144137 r145933  
    338338                callLinkInfo->hotPathOther.labelAtOffset(0).executableAddress(),
    339339                codePtr.executableAddress(),
    340                 toCString(*calleeCodeBlock).data())),
     340                toCString(pointerDump(calleeCodeBlock)).data())),
    341341        *m_globalData, m_codeBlock->ownerExecutable(), expectedStructure, expectedExecutable,
    342342        callLinkInfo->codeOrigin));
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r145838 r145933  
    133133    struct ScratchBuffer {
    134134        ScratchBuffer()
    135             : m_activeLength(0)
    136         {
     135        {
     136            u.m_activeLength = 0;
    137137        }
    138138
     
    145145
    146146        static size_t allocationSize(size_t bufferSize) { return sizeof(ScratchBuffer) + bufferSize; }
    147         void setActiveLength(size_t activeLength) { m_activeLength = activeLength; }
    148         size_t activeLength() const { return m_activeLength; };
    149         size_t* activeLengthPtr() { return &m_activeLength; };
     147        void setActiveLength(size_t activeLength) { u.m_activeLength = activeLength; }
     148        size_t activeLength() const { return u.m_activeLength; };
     149        size_t* activeLengthPtr() { return &u.m_activeLength; };
    150150        void* dataBuffer() { return m_buffer; }
    151151
    152         size_t m_activeLength;
     152        union {
     153            size_t m_activeLength;
     154            double pad; // Make sure m_buffer is double aligned.
     155        } u;
    153156#if CPU(MIPS) && (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == 2)
    154157        void* m_buffer[0] __attribute__((aligned(8)));
Note: See TracChangeset for help on using the changeset viewer.