Changeset 39156 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Dec 9, 2008, 4:26:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39123 r39156 1195 1195 } 1196 1196 1197 bool CodeBlock::getHandlerForVPC(const Instruction* vPC, Instruction*& target, int& scopeDepth)1197 HandlerInfo* CodeBlock::handlerForVPC(const Instruction* vPC) 1198 1198 { 1199 1199 if (!m_rareData) 1200 return false; 1201 1202 Vector<HandlerInfo>::iterator ptr = m_rareData->m_exceptionHandlers.begin(); 1203 Vector<HandlerInfo>::iterator end = m_rareData->m_exceptionHandlers.end(); 1200 return 0; 1201 1204 1202 unsigned addressOffset = vPC - m_instructions.begin(); 1205 1203 ASSERT(addressOffset < m_instructions.size()); 1206 1204 1207 for (; ptr != end; ++ptr) { 1205 Vector<HandlerInfo>& exceptionHandlers = m_rareData->m_exceptionHandlers; 1206 for (size_t i = 0; i < exceptionHandlers.size(); ++i) { 1208 1207 // Handlers are ordered innermost first, so the first handler we encounter 1209 1208 // that contains the source address is the correct handler to use. 1210 if (ptr->start <= addressOffset && ptr->end >= addressOffset) { 1211 scopeDepth = ptr->scopeDepth; 1212 target = m_instructions.begin() + ptr->target; 1213 return true; 1214 } 1215 } 1216 return false; 1217 } 1218 1219 void* CodeBlock::nativeExceptionCodeForHandlerVPC(const Instruction* handlerVPC) 1220 { 1221 if (!m_rareData) 1222 return 0; 1223 1224 Vector<HandlerInfo>::iterator ptr = m_rareData->m_exceptionHandlers.begin(); 1225 Vector<HandlerInfo>::iterator end = m_rareData->m_exceptionHandlers.end(); 1226 1227 for (; ptr != end; ++ptr) { 1228 Instruction*target = m_instructions.begin() + ptr->target; 1229 if (handlerVPC == target) 1230 return ptr->nativeCode; 1209 if (exceptionHandlers[i].start <= addressOffset && exceptionHandlers[i].end >= addressOffset) 1210 return &exceptionHandlers[i]; 1231 1211 } 1232 1212
Note:
See TracChangeset
for help on using the changeset viewer.