Changeset 39252 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Dec 12, 2008, 1:31:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39229 r39252 209 209 while (i < instructions.size()) { 210 210 OpcodeID currentOpcode = exec->interpreter()->getOpcodeID(instructions[i].u.opcode); 211 if (predicate( exec->interpreter()->getOpcodeID(instructions[i].u.opcode))) {211 if (predicate(currentOpcode)) { 212 212 if (!--nth) 213 213 return i; … … 1331 1331 } 1332 1332 1333 HandlerInfo* CodeBlock::handlerFor VPC(const Instruction* vPC)1333 HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset) 1334 1334 { 1335 1335 if (!m_rareData) 1336 1336 return 0; 1337 1337 1338 unsigned addressOffset = vPC - m_instructions.begin(); 1339 ASSERT(addressOffset < m_instructions.size()); 1338 ASSERT(bytecodeOffset < m_instructions.size()); 1340 1339 1341 1340 Vector<HandlerInfo>& exceptionHandlers = m_rareData->m_exceptionHandlers; … … 1343 1342 // Handlers are ordered innermost first, so the first handler we encounter 1344 1343 // that contains the source address is the correct handler to use. 1345 if (exceptionHandlers[i].start <= addressOffset && exceptionHandlers[i].end >= addressOffset)1344 if (exceptionHandlers[i].start <= bytecodeOffset && exceptionHandlers[i].end >= bytecodeOffset) 1346 1345 return &exceptionHandlers[i]; 1347 1346 } … … 1350 1349 } 1351 1350 1352 int CodeBlock::lineNumberForVPC(const Instruction* vPC) 1353 { 1354 unsigned instructionOffset = vPC - m_instructions.begin(); 1355 ASSERT(instructionOffset < m_instructions.size()); 1351 int CodeBlock::lineNumberForBytecodeOffset(unsigned bytecodeOffset) 1352 { 1353 ASSERT(bytecodeOffset < m_instructions.size()); 1356 1354 1357 1355 if (!m_lineInfo.size()) … … 1362 1360 while (low < high) { 1363 1361 int mid = low + (high - low) / 2; 1364 if (m_lineInfo[mid].instructionOffset <= instructionOffset)1362 if (m_lineInfo[mid].instructionOffset <= bytecodeOffset) 1365 1363 low = mid + 1; 1366 1364 else … … 1373 1371 } 1374 1372 1375 int CodeBlock::expressionRangeForVPC(const Instruction* vPC, int& divot, int& startOffset, int& endOffset) 1376 { 1377 unsigned instructionOffset = vPC - m_instructions.begin(); 1378 ASSERT(instructionOffset < m_instructions.size()); 1373 int CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) 1374 { 1375 ASSERT(bytecodeOffset < m_instructions.size()); 1379 1376 1380 1377 if (!m_expressionInfo.size()) { … … 1383 1380 endOffset = 0; 1384 1381 divot = 0; 1385 return lineNumberFor VPC(vPC);1382 return lineNumberForBytecodeOffset(bytecodeOffset); 1386 1383 } 1387 1384 … … 1390 1387 while (low < high) { 1391 1388 int mid = low + (high - low) / 2; 1392 if (m_expressionInfo[mid].instructionOffset <= instructionOffset)1389 if (m_expressionInfo[mid].instructionOffset <= bytecodeOffset) 1393 1390 low = mid + 1; 1394 1391 else … … 1401 1398 endOffset = 0; 1402 1399 divot = 0; 1403 return lineNumberFor VPC(vPC);1400 return lineNumberForBytecodeOffset(bytecodeOffset); 1404 1401 } 1405 1402 … … 1407 1404 endOffset = m_expressionInfo[low - 1].endOffset; 1408 1405 divot = m_expressionInfo[low - 1].divotPoint + m_sourceOffset; 1409 return lineNumberFor VPC(vPC);1406 return lineNumberForBytecodeOffset(bytecodeOffset); 1410 1407 } 1411 1408
Note:
See TracChangeset
for help on using the changeset viewer.