Changeset 39366 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- Dec 17, 2008, 1:25:40 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39354 r39366 35 35 #include "Interpreter.h" 36 36 #include "Debugger.h" 37 #include "BytecodeGenerator.h" 37 38 #include <stdio.h> 38 39 #include <wtf/StringExtras.h> … … 323 324 void CodeBlock::dump(ExecState* exec) const 324 325 { 326 if (m_instructions.isEmpty()) { 327 printf("No instructions available.\n"); 328 return; 329 } 330 325 331 size_t instructionCount = 0; 326 332 … … 1173 1179 , m_ownerNode(ownerNode) 1174 1180 , m_globalData(0) 1181 #ifndef NDEBUG 1182 , m_instructionCount(0) 1183 #endif 1175 1184 , m_needsFullScopeChain(ownerNode->needsActivation()) 1176 1185 , m_usesEval(ownerNode->usesEval()) … … 1330 1339 HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset) 1331 1340 { 1341 ASSERT(bytecodeOffset < m_instructionCount); 1342 1332 1343 if (!m_rareData) 1333 1344 return 0; 1334 1335 ASSERT(bytecodeOffset < m_instructions.size());1336 1345 1337 1346 Vector<HandlerInfo>& exceptionHandlers = m_rareData->m_exceptionHandlers; … … 1348 1357 int CodeBlock::lineNumberForBytecodeOffset(unsigned bytecodeOffset) 1349 1358 { 1350 ASSERT(bytecodeOffset < m_instruction s.size());1359 ASSERT(bytecodeOffset < m_instructionCount); 1351 1360 1352 1361 if (!m_lineInfo.size()) … … 1370 1379 int CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) 1371 1380 { 1372 ASSERT(bytecodeOffset < m_instruction s.size());1381 ASSERT(bytecodeOffset < m_instructionCount); 1373 1382 1374 1383 if (!m_expressionInfo.size()) { … … 1406 1415 bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(unsigned bytecodeOffset, OpcodeID& opcodeID) 1407 1416 { 1408 ASSERT(bytecodeOffset < m_instruction s.size());1417 ASSERT(bytecodeOffset < m_instructionCount); 1409 1418 1410 1419 if (!m_getByIdExceptionInfo.size()) … … 1431 1440 bool CodeBlock::functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex) 1432 1441 { 1433 ASSERT(bytecodeOffset < m_instruction s.size());1442 ASSERT(bytecodeOffset < m_instructionCount); 1434 1443 1435 1444 if (!m_rareData || !m_rareData->m_functionRegisterInfos.size()) … … 1451 1460 functionRegisterIndex = m_rareData->m_functionRegisterInfos[low - 1].functionRegisterIndex; 1452 1461 return true; 1462 } 1463 1464 void CodeBlock::setJITCode(JITCodeRef& jitCode) 1465 { 1466 m_jitCode = jitCode; 1467 #if !ENABLE(OPCODE_SAMPLING) 1468 if (!BytecodeGenerator::dumpsGeneratedCode()) 1469 m_instructions.clear(); 1470 #endif 1453 1471 } 1454 1472 #endif -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r39354 r39366 307 307 308 308 Vector<Instruction>& instructions() { return m_instructions; } 309 310 #if ENABLE(JIT) 311 void setJITCode(JITCodeRef& jitCode) { m_jitCode = jitCode; } 309 #ifndef NDEBUG 310 void setInstructionCount(unsigned instructionCount) { m_instructionCount = instructionCount; } 311 #endif 312 313 #if ENABLE(JIT) 314 void setJITCode(JITCodeRef& jitCode); 312 315 void* jitCode() { return m_jitCode.code; } 313 316 ExecutablePool* executablePool() { return m_jitCode.executablePool.get(); } … … 440 443 441 444 Vector<Instruction> m_instructions; 445 #ifndef NDEBUG 446 unsigned m_instructionCount; 447 #endif 442 448 #if ENABLE(JIT) 443 449 JITCodeRef m_jitCode;
Note:
See TracChangeset
for help on using the changeset viewer.