Changeset 40813 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.h
- Timestamp:
- Feb 10, 2009, 12:43:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.h
r40046 r40813 33 33 #include "EvalCodeCache.h" 34 34 #include "Instruction.h" 35 #include "JITCode.h" 35 36 #include "JSGlobalObject.h" 36 37 #include "JumpTable.h" … … 66 67 // The code, and the associated pool from which it was allocated. 67 68 struct JITCodeRef { 68 void*code;69 JITCode code; 69 70 #ifndef NDEBUG 70 71 unsigned codeSize; … … 162 163 }; 163 164 164 struct PC { 165 PC(ptrdiff_t nativePCOffset, unsigned bytecodeIndex) 166 : nativePCOffset(nativePCOffset) 165 // This structure is used to map from a call return location 166 // (given as an offset in bytes into the JIT code) back to 167 // the bytecode index of the corresponding bytecode operation. 168 // This is then used to look up the corresponding handler. 169 struct CallReturnOffsetToBytecodeIndex { 170 CallReturnOffsetToBytecodeIndex(unsigned callReturnOffset, unsigned bytecodeIndex) 171 : callReturnOffset(callReturnOffset) 167 172 , bytecodeIndex(bytecodeIndex) 168 173 { 169 174 } 170 175 171 ptrdiff_t nativePCOffset;176 unsigned callReturnOffset; 172 177 unsigned bytecodeIndex; 173 178 }; … … 185 190 } 186 191 187 inline ptrdiff_t getNativePCOffset(PC* pc)192 inline unsigned getCallReturnOffset(CallReturnOffsetToBytecodeIndex* pc) 188 193 { 189 return pc-> nativePCOffset;194 return pc->callReturnOffset; 190 195 } 191 196 … … 312 317 { 313 318 reparseForExceptionInfoIfNecessary(callFrame); 314 ptrdiff_t nativePCOffset = reinterpret_cast<void**>(nativePC) - reinterpret_cast<void**>(m_jitCode.code); 315 return binaryChop<PC, ptrdiff_t, getNativePCOffset>(m_exceptionInfo->m_pcVector.begin(), m_exceptionInfo->m_pcVector.size(), nativePCOffset)->bytecodeIndex; 319 return binaryChop<CallReturnOffsetToBytecodeIndex, unsigned, getCallReturnOffset>(m_exceptionInfo->m_callReturnIndexVector.begin(), m_exceptionInfo->m_callReturnIndexVector.size(), m_jitCode.code.offsetOf(nativePC))->bytecodeIndex; 316 320 } 317 321 … … 326 330 #if ENABLE(JIT) 327 331 void setJITCode(JITCodeRef& jitCode); 328 void*jitCode() { return m_jitCode.code; }332 JITCode jitCode() { return m_jitCode.code; } 329 333 ExecutablePool* executablePool() { return m_jitCode.executablePool.get(); } 330 334 #endif … … 391 395 392 396 #if ENABLE(JIT) 393 Vector< PC>& pcVector() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_pcVector; }397 Vector<CallReturnOffsetToBytecodeIndex>& callReturnIndexVector() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_callReturnIndexVector; } 394 398 #endif 395 399 … … 511 515 512 516 #if ENABLE(JIT) 513 Vector< PC> m_pcVector;517 Vector<CallReturnOffsetToBytecodeIndex> m_callReturnIndexVector; 514 518 #endif 515 519 };
Note:
See TracChangeset
for help on using the changeset viewer.