Changeset 39577 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 3, 2009, 10:19:44 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r39572 r39577 1 2009-01-03 Sam Weinig <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 Change the pcVector from storing native code pointers to storing offsets 6 from the base pointer. This will allow us to generate the pcVector on demand 7 for exceptions. 8 9 * bytecode/CodeBlock.h: 10 (JSC::PC::PC): 11 (JSC::getNativePCOffset): 12 (JSC::CodeBlock::getBytecodeIndex): 13 * jit/JIT.cpp: 14 (JSC::JIT::privateCompile): 15 1 16 2009-01-02 Oliver Hunt <[email protected]> 2 17 -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r39366 r39577 152 152 153 153 struct PC { 154 PC( void* nativePC, unsigned bytecodeIndex)155 : nativePC (nativePC)154 PC(ptrdiff_t nativePCOffset, unsigned bytecodeIndex) 155 : nativePCOffset(nativePCOffset) 156 156 , bytecodeIndex(bytecodeIndex) 157 157 { 158 158 } 159 160 void* nativePC;159 160 ptrdiff_t nativePCOffset; 161 161 unsigned bytecodeIndex; 162 162 }; … … 174 174 } 175 175 176 inline void* getNativePC(PC* pc)176 inline ptrdiff_t getNativePCOffset(PC* pc) 177 177 { 178 return pc->nativePC ;178 return pc->nativePCOffset; 179 179 } 180 180 … … 300 300 unsigned getBytecodeIndex(void* nativePC) 301 301 { 302 return binaryChop<PC, void*, getNativePC>(m_pcVector.begin(), m_pcVector.size(), nativePC)->bytecodeIndex; 302 ptrdiff_t nativePCOffset = reinterpret_cast<void**>(nativePC) - reinterpret_cast<void**>(m_jitCode.code); 303 return binaryChop<PC, ptrdiff_t, getNativePCOffset>(m_pcVector.begin(), m_pcVector.size(), nativePCOffset)->bytecodeIndex; 303 304 } 304 305 -
trunk/JavaScriptCore/jit/JIT.cpp
r39540 r39577 1639 1639 if (iter->to) 1640 1640 patchBuffer.link(iter->from, iter->to); 1641 m_codeBlock->pcVector().append(PC( patchBuffer.addressOf(iter->from), iter->bytecodeIndex));1641 m_codeBlock->pcVector().append(PC(reinterpret_cast<void**>(patchBuffer.addressOf(iter->from)) - reinterpret_cast<void**>(code), iter->bytecodeIndex)); 1642 1642 } 1643 1643
Note:
See TracChangeset
for help on using the changeset viewer.