Changeset 72360 in webkit
- Timestamp:
- Nov 18, 2010 6:35:25 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r72359 r72360 1 2010-11-18 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 49708 - Stop recompiling functions to regenerate exception info. 6 7 Instead only hold info as necessary – keep divot info is the inspector 8 is enabled, line number info is debugging or profiling, and handler 9 info for functions with try/catch. 10 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::dumpStatistics): 13 (JSC::CodeBlock::CodeBlock): 14 (JSC::CodeBlock::lineNumberForBytecodeOffset): 15 (JSC::CodeBlock::expressionRangeForBytecodeOffset): 16 (JSC::CodeBlock::shrinkToFit): 17 * bytecode/CodeBlock.h: 18 (JSC::CodeBlock::bytecodeOffset): 19 (JSC::CodeBlock::addExpressionInfo): 20 (JSC::CodeBlock::addLineInfo): 21 (JSC::CodeBlock::hasExpressionInfo): 22 (JSC::CodeBlock::hasLineInfo): 23 (JSC::CodeBlock::needsCallReturnIndices): 24 (JSC::CodeBlock::callReturnIndexVector): 25 * bytecode/SamplingTool.cpp: 26 (JSC::SamplingTool::dump): 27 * bytecompiler/BytecodeGenerator.cpp: 28 (JSC::BytecodeGenerator::generate): 29 (JSC::BytecodeGenerator::BytecodeGenerator): 30 * bytecompiler/BytecodeGenerator.h: 31 (JSC::BytecodeGenerator::emitNode): 32 (JSC::BytecodeGenerator::emitNodeInConditionContext): 33 (JSC::BytecodeGenerator::emitExpressionInfo): 34 (JSC::BytecodeGenerator::addLineInfo): 35 * interpreter/Interpreter.cpp: 36 (JSC::Interpreter::unwindCallFrame): 37 (JSC::appendSourceToError): 38 (JSC::Interpreter::throwException): 39 (JSC::Interpreter::privateExecute): 40 (JSC::Interpreter::retrieveLastCaller): 41 * interpreter/Interpreter.h: 42 * jit/JIT.cpp: 43 (JSC::JIT::privateCompile): 44 * jit/JITStubs.cpp: 45 (JSC::jitThrow): 46 (JSC::DEFINE_STUB_FUNCTION): 47 * runtime/Collector.cpp: 48 (JSC::Heap::markRoots): 49 * runtime/Executable.cpp: 50 (JSC::EvalExecutable::compileInternal): 51 (JSC::ProgramExecutable::compileInternal): 52 (JSC::FunctionExecutable::compileForCallInternal): 53 (JSC::FunctionExecutable::compileForConstructInternal): 54 * runtime/Executable.h: 55 * runtime/JSGlobalData.cpp: 56 (JSC::JSGlobalData::JSGlobalData): 57 * runtime/JSGlobalData.h: 58 (JSC::JSGlobalData::usingAPI): 59 * runtime/JSGlobalObject.h: 60 (JSC::JSGlobalObject::supportsRichSourceInfo): 61 (JSC::JSGlobalObject::globalData): 62 1 63 2010-11-18 Adam Roben <aroben@apple.com> 2 64 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r72351 r72360 1262 1262 macro(characterSwitchJumpTables) \ 1263 1263 macro(stringSwitchJumpTables) \ 1264 macro(functionRegisterInfos) 1265 1266 #define FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(macro) \ 1264 macro(evalCodeCache) \ 1267 1265 macro(expressionInfo) \ 1268 1266 macro(lineInfo) \ 1269 macro(getByIdExceptionInfo) \ 1270 macro(pcVector) 1267 macro(callReturnIndexVector) 1271 1268 1272 1269 template<typename T> … … 1282 1279 FOR_EACH_MEMBER_VECTOR(DEFINE_VARS) 1283 1280 FOR_EACH_MEMBER_VECTOR_RARE_DATA(DEFINE_VARS) 1284 FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(DEFINE_VARS)1285 1281 #undef DEFINE_VARS 1286 1282 … … 1291 1287 size_t symbolTableTotalSize = 0; 1292 1288 1293 size_t hasExceptionInfo = 0;1294 1289 size_t hasRareData = 0; 1295 1290 … … 1309 1304 symbolTableIsNotEmpty++; 1310 1305 symbolTableTotalSize += (codeBlock->m_symbolTable.capacity() * (sizeof(SymbolTable::KeyType) + sizeof(SymbolTable::MappedType))); 1311 }1312 1313 if (codeBlock->m_exceptionInfo) {1314 hasExceptionInfo++;1315 #define GET_STATS(name) if (!codeBlock->m_exceptionInfo->m_##name.isEmpty()) { name##IsNotEmpty++; name##TotalSize += sizeInBytes(codeBlock->m_exceptionInfo->m_##name); }1316 FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(GET_STATS)1317 #undef GET_STATS1318 1306 } 1319 1307 … … 1346 1334 FOR_EACH_MEMBER_VECTOR(GET_TOTAL_SIZE) 1347 1335 FOR_EACH_MEMBER_VECTOR_RARE_DATA(GET_TOTAL_SIZE) 1348 FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(GET_TOTAL_SIZE)1349 1336 #undef GET_TOTAL_SIZE 1350 1337 … … 1361 1348 printf("Number of EvalCode CodeBlocks: %zu (%.3f%%)\n", isEvalCode, static_cast<double>(isEvalCode) * 100.0 / liveCodeBlockSet.size()); 1362 1349 1363 printf("Number of CodeBlocks with exception info: %zu (%.3f%%)\n", hasExceptionInfo, static_cast<double>(hasExceptionInfo) * 100.0 / liveCodeBlockSet.size());1364 1350 printf("Number of CodeBlocks with rare data: %zu (%.3f%%)\n", hasRareData, static_cast<double>(hasRareData) * 100.0 / liveCodeBlockSet.size()); 1365 1351 … … 1367 1353 FOR_EACH_MEMBER_VECTOR(PRINT_STATS) 1368 1354 FOR_EACH_MEMBER_VECTOR_RARE_DATA(PRINT_STATS) 1369 FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(PRINT_STATS)1370 1355 #undef PRINT_STATS 1371 1356 … … 1400 1385 , m_sourceOffset(sourceOffset) 1401 1386 , m_symbolTable(symTab) 1402 , m_exceptionInfo(adoptPtr(new ExceptionInfo))1403 1387 { 1404 1388 ASSERT(m_source); … … 1559 1543 } 1560 1544 1561 bool CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)1562 {1563 if (m_exceptionInfo)1564 return true;1565 1566 ASSERT(!m_rareData || !m_rareData->m_exceptionHandlers.size());1567 ScopeChainNode* scopeChain = callFrame->scopeChain();1568 if (m_needsFullScopeChain) {1569 if (codeType() == FunctionCode && !callFrame->r(activationRegister()).jsValue()) {1570 createActivation(callFrame);1571 scopeChain = callFrame->scopeChain();1572 }1573 ScopeChain sc(scopeChain);1574 int scopeDelta = sc.localDepth();1575 if (m_codeType == EvalCode)1576 scopeDelta -= static_cast<EvalCodeBlock*>(this)->baseScopeDepth();1577 else if (m_codeType == FunctionCode)1578 scopeDelta++; // Compilation of function code assumes activation is not on the scope chain yet.1579 ASSERT(scopeDelta >= 0);1580 while (scopeDelta--)1581 scopeChain = scopeChain->next;1582 }1583 1584 m_exceptionInfo = m_ownerExecutable->reparseExceptionInfo(scopeChain, this);1585 return m_exceptionInfo;1586 }1587 1588 1545 HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset) 1589 1546 { … … 1604 1561 } 1605 1562 1606 int CodeBlock::lineNumberForBytecodeOffset( CallFrame* callFrame,unsigned bytecodeOffset)1563 int CodeBlock::lineNumberForBytecodeOffset(unsigned bytecodeOffset) 1607 1564 { 1608 1565 ASSERT(bytecodeOffset < m_instructionCount); 1609 1566 1610 if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_lineInfo.size()) 1611 return m_ownerExecutable->source().firstLine(); // Empty function or unable to reparse 1567 if (!m_rareData) 1568 return m_ownerExecutable->source().firstLine(); 1569 1570 Vector<LineInfo>& lineInfo = m_rareData->m_lineInfo; 1612 1571 1613 1572 int low = 0; 1614 int high = m_exceptionInfo->m_lineInfo.size();1573 int high = lineInfo.size(); 1615 1574 while (low < high) { 1616 1575 int mid = low + (high - low) / 2; 1617 if ( m_exceptionInfo->m_lineInfo[mid].instructionOffset <= bytecodeOffset)1576 if (lineInfo[mid].instructionOffset <= bytecodeOffset) 1618 1577 low = mid + 1; 1619 1578 else 1620 1579 high = mid; 1621 1580 } 1622 1581 1623 1582 if (!low) 1624 1583 return m_ownerExecutable->source().firstLine(); 1625 return m_exceptionInfo->m_lineInfo[low - 1].lineNumber;1626 } 1627 1628 void CodeBlock::expressionRangeForBytecodeOffset( CallFrame* callFrame,unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset)1584 return lineInfo[low - 1].lineNumber; 1585 } 1586 1587 void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) 1629 1588 { 1630 1589 ASSERT(bytecodeOffset < m_instructionCount); 1631 1590 1632 if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_expressionInfo.size()) { 1633 // We didn't think anything could throw. Apparently we were wrong. 1634 // Alternatively something went wrong when trying to reparse 1591 if (!m_rareData) { 1635 1592 startOffset = 0; 1636 1593 endOffset = 0; … … 1639 1596 } 1640 1597 1598 Vector<ExpressionRangeInfo>& expressionInfo = m_rareData->m_expressionInfo; 1599 1641 1600 int low = 0; 1642 int high = m_exceptionInfo->m_expressionInfo.size();1601 int high = expressionInfo.size(); 1643 1602 while (low < high) { 1644 1603 int mid = low + (high - low) / 2; 1645 if ( m_exceptionInfo->m_expressionInfo[mid].instructionOffset <= bytecodeOffset)1604 if (expressionInfo[mid].instructionOffset <= bytecodeOffset) 1646 1605 low = mid + 1; 1647 1606 else … … 1657 1616 } 1658 1617 1659 startOffset = m_exceptionInfo->m_expressionInfo[low - 1].startOffset;1660 endOffset = m_exceptionInfo->m_expressionInfo[low - 1].endOffset;1661 divot = m_exceptionInfo->m_expressionInfo[low - 1].divotPoint + m_sourceOffset;1618 startOffset = expressionInfo[low - 1].startOffset; 1619 endOffset = expressionInfo[low - 1].endOffset; 1620 divot = expressionInfo[low - 1].divotPoint + m_sourceOffset; 1662 1621 return; 1663 1622 } … … 1726 1685 m_constantRegisters.shrinkToFit(); 1727 1686 1728 if (m_exceptionInfo) {1729 m_exceptionInfo->m_expressionInfo.shrinkToFit();1730 m_exceptionInfo->m_lineInfo.shrinkToFit();1731 }1732 1733 1687 if (m_rareData) { 1734 1688 m_rareData->m_exceptionHandlers.shrinkToFit(); … … 1737 1691 m_rareData->m_characterSwitchJumpTables.shrinkToFit(); 1738 1692 m_rareData->m_stringSwitchJumpTables.shrinkToFit(); 1693 m_rareData->m_expressionInfo.shrinkToFit(); 1694 m_rareData->m_lineInfo.shrinkToFit(); 1739 1695 } 1740 1696 } -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r72351 r72360 103 103 } 104 104 105 unsigned bytecodeOffset;106 105 CodeLocationNearCall callReturnLocation; 107 106 CodeLocationDataLabelPtr hotPathBegin; … … 155 154 Structure* cachedStructure; 156 155 Structure* cachedPrototypeStructure; 157 };158 159 struct FunctionRegisterInfo {160 FunctionRegisterInfo(unsigned bytecodeOffset, int functionRegisterIndex)161 : bytecodeOffset(bytecodeOffset)162 , functionRegisterIndex(functionRegisterIndex)163 {164 }165 166 unsigned bytecodeOffset;167 int functionRegisterIndex;168 156 }; 169 157 … … 255 243 #endif 256 244 257 struct ExceptionInfo : FastAllocBase {258 Vector<ExpressionRangeInfo> m_expressionInfo;259 Vector<LineInfo> m_lineInfo;260 261 #if ENABLE(JIT)262 Vector<CallReturnOffsetToBytecodeOffset> m_callReturnIndexVector;263 #endif264 };265 266 245 class CodeBlock : public FastAllocBase { 267 246 friend class JIT; … … 308 287 309 288 HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset); 310 int lineNumberForBytecodeOffset( CallFrame*,unsigned bytecodeOffset);311 void expressionRangeForBytecodeOffset( CallFrame*,unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset);289 int lineNumberForBytecodeOffset(unsigned bytecodeOffset); 290 void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset); 312 291 313 292 #if ENABLE(JIT) … … 346 325 } 347 326 348 unsigned bytecodeOffset( CallFrame* callFrame,ReturnAddressPtr returnAddress)349 { 350 if (! reparseForExceptionInfoIfNecessary(callFrame))327 unsigned bytecodeOffset(ReturnAddressPtr returnAddress) 328 { 329 if (!m_rareData) 351 330 return 1; 352 return binaryChop<CallReturnOffsetToBytecodeOffset, unsigned, getCallReturnOffset>(callReturnIndexVector().begin(), callReturnIndexVector().size(), getJITCode().offsetOf(returnAddress.value()))->bytecodeOffset; 331 Vector<CallReturnOffsetToBytecodeOffset>& callIndices = m_rareData->m_callReturnIndexVector; 332 if (!callIndices.size()) 333 return 1; 334 return binaryChop<CallReturnOffsetToBytecodeOffset, unsigned, getCallReturnOffset>(callIndices.begin(), callIndices.size(), getJITCode().offsetOf(returnAddress.value()))->bytecodeOffset; 353 335 } 354 336 #endif … … 450 432 HandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; } 451 433 452 bool hasExceptionInfo() const { return m_exceptionInfo; } 453 void clearExceptionInfo() { m_exceptionInfo.clear(); } 454 PassOwnPtr<ExceptionInfo> extractExceptionInfo(); 455 456 void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_expressionInfo.append(expressionInfo); } 457 458 size_t numberOfLineInfos() const { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.size(); } 459 void addLineInfo(const LineInfo& lineInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_lineInfo.append(lineInfo); } 460 LineInfo& lastLineInfo() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.last(); } 461 462 #if ENABLE(JIT) 463 Vector<CallReturnOffsetToBytecodeOffset>& callReturnIndexVector() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_callReturnIndexVector; } 434 void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) 435 { 436 createRareDataIfNecessary(); 437 m_rareData->m_expressionInfo.append(expressionInfo); 438 } 439 440 void addLineInfo(unsigned bytecodeOffset, int lineNo) 441 { 442 createRareDataIfNecessary(); 443 Vector<LineInfo>& lineInfo = m_rareData->m_lineInfo; 444 if (!lineInfo.size() || lineInfo.last().lineNumber != lineNo) { 445 LineInfo info = { bytecodeOffset, lineNo }; 446 lineInfo.append(info); 447 } 448 } 449 450 bool hasExpressionInfo() { return m_rareData && m_rareData->m_expressionInfo.size(); } 451 bool hasLineInfo() { return m_rareData && m_rareData->m_lineInfo.size(); } 452 bool needsCallReturnIndices() 453 { 454 return m_rareData && 455 (m_rareData->m_expressionInfo.size() || m_rareData->m_lineInfo.size() || m_rareData->m_exceptionHandlers.size()); 456 } 457 458 #if ENABLE(JIT) 459 Vector<CallReturnOffsetToBytecodeOffset>& callReturnIndexVector() 460 { 461 createRareDataIfNecessary(); 462 return m_rareData->m_callReturnIndexVector; 463 } 464 464 #endif 465 465 … … 529 529 #endif 530 530 531 bool reparseForExceptionInfoIfNecessary(CallFrame*) WARN_UNUSED_RETURN;532 533 531 void createRareDataIfNecessary() 534 532 { … … 581 579 SymbolTable* m_symbolTable; 582 580 583 OwnPtr<ExceptionInfo> m_exceptionInfo;584 585 581 struct RareData : FastAllocBase { 586 582 Vector<HandlerInfo> m_exceptionHandlers; … … 595 591 596 592 EvalCodeCache m_evalCodeCache; 593 594 // Expression info - present if debugging. 595 Vector<ExpressionRangeInfo> m_expressionInfo; 596 // Line info - present if profiling or debugging. 597 Vector<LineInfo> m_lineInfo; 598 #if ENABLE(JIT) 599 Vector<CallReturnOffsetToBytecodeOffset> m_callReturnIndexVector; 600 #endif 597 601 }; 598 602 OwnPtr<RareData> m_rareData; … … 669 673 }; 670 674 671 inline PassOwnPtr<ExceptionInfo> CodeBlock::extractExceptionInfo()672 {673 ASSERT(m_exceptionInfo);674 return m_exceptionInfo.release();675 }676 677 675 inline Register& ExecState::r(int index) 678 676 { -
trunk/JavaScriptCore/bytecode/SamplingTool.cpp
r65344 r72360 338 338 if (blockPercent >= 1) { 339 339 //Instruction* code = codeBlock->instructions().begin(); 340 printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().utf8().data(), codeBlock->lineNumberForBytecodeOffset( exec,0), record->m_sampleCount, m_sampleCount, blockPercent);340 printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().utf8().data(), codeBlock->lineNumberForBytecodeOffset(0), record->m_sampleCount, m_sampleCount, blockPercent); 341 341 if (i < 10) { 342 342 HashMap<unsigned,unsigned> lineCounts; … … 348 348 if (count) { 349 349 printf(" [% 4d] has sample count: % 4d\n", op, count); 350 unsigned line = codeBlock->lineNumberForBytecodeOffset( exec,op);350 unsigned line = codeBlock->lineNumberForBytecodeOffset(op); 351 351 lineCounts.set(line, (lineCounts.contains(line) ? lineCounts.get(line) : 0) + count); 352 352 } -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r72351 r72360 154 154 symbolTable().clear(); 155 155 156 #if !ENABLE(OPCODE_SAMPLING)157 if (!m_regeneratingForExceptionInfo && !m_usesExceptions && (m_codeType == FunctionCode || m_codeType == EvalCode))158 m_codeBlock->clearExceptionInfo();159 #endif160 161 156 m_codeBlock->shrinkToFit(); 162 157 } … … 200 195 } 201 196 202 BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* debugger, constScopeChain& scopeChain, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock)203 : m_shouldEmitDebugHooks( !!debugger)197 BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const ScopeChain& scopeChain, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock) 198 : m_shouldEmitDebugHooks(scopeChain.globalObject()->debugger()) 204 199 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 200 , m_shouldEmitRichSourceInfo(scopeChain.globalObject()->supportsRichSourceInfo()) 205 201 , m_scopeChain(&scopeChain) 206 202 , m_symbolTable(symbolTable) … … 218 214 , m_firstLazyFunction(0) 219 215 , m_lastLazyFunction(0) 220 , m_globalData(&scopeChain.globalObject()->global Exec()->globalData())216 , m_globalData(&scopeChain.globalObject()->globalData()) 221 217 , m_lastOpcodeID(op_end) 222 218 #ifndef NDEBUG … … 294 290 } 295 291 296 BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debugger* debugger, constScopeChain& scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock)297 : m_shouldEmitDebugHooks( !!debugger)292 BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const ScopeChain& scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock) 293 : m_shouldEmitDebugHooks(scopeChain.globalObject()->debugger()) 298 294 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 295 , m_shouldEmitRichSourceInfo(scopeChain.globalObject()->supportsRichSourceInfo()) 299 296 , m_scopeChain(&scopeChain) 300 297 , m_symbolTable(symbolTable) … … 311 308 , m_firstLazyFunction(0) 312 309 , m_lastLazyFunction(0) 313 , m_globalData(&scopeChain.globalObject()->global Exec()->globalData())310 , m_globalData(&scopeChain.globalObject()->globalData()) 314 311 , m_lastOpcodeID(op_end) 315 312 #ifndef NDEBUG … … 388 385 } 389 386 } 390 bool canLazilyCreateFunctions = !functionBody->needsActivationForMoreThanVariables() && ! debugger;387 bool canLazilyCreateFunctions = !functionBody->needsActivationForMoreThanVariables() && !m_shouldEmitDebugHooks; 391 388 if (!canLazilyCreateFunctions && !m_hasCreatedActivation) { 392 389 m_hasCreatedActivation = true; … … 420 417 } 421 418 422 if ( debugger)419 if (m_shouldEmitDebugHooks) 423 420 codeBlock->m_numCapturedVars = codeBlock->m_numVars; 424 421 … … 458 455 } 459 456 460 BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugger, constScopeChain& scopeChain, SymbolTable* symbolTable, EvalCodeBlock* codeBlock)461 : m_shouldEmitDebugHooks( !!debugger)457 BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const ScopeChain& scopeChain, SymbolTable* symbolTable, EvalCodeBlock* codeBlock) 458 : m_shouldEmitDebugHooks(scopeChain.globalObject()->debugger()) 462 459 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 460 , m_shouldEmitRichSourceInfo(scopeChain.globalObject()->supportsRichSourceInfo()) 463 461 , m_scopeChain(&scopeChain) 464 462 , m_symbolTable(symbolTable) … … 475 473 , m_firstLazyFunction(0) 476 474 , m_lastLazyFunction(0) 477 , m_globalData(&scopeChain.globalObject()->global Exec()->globalData())475 , m_globalData(&scopeChain.globalObject()->globalData()) 478 476 , m_lastOpcodeID(op_end) 479 477 #ifndef NDEBUG -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r72176 r72360 94 94 static bool dumpsGeneratedCode(); 95 95 96 BytecodeGenerator(ProgramNode*, const Debugger*, constScopeChain&, SymbolTable*, ProgramCodeBlock*);97 BytecodeGenerator(FunctionBodyNode*, const Debugger*, constScopeChain&, SymbolTable*, CodeBlock*);98 BytecodeGenerator(EvalNode*, const Debugger*, constScopeChain&, SymbolTable*, EvalCodeBlock*);96 BytecodeGenerator(ProgramNode*, const ScopeChain&, SymbolTable*, ProgramCodeBlock*); 97 BytecodeGenerator(FunctionBodyNode*, const ScopeChain&, SymbolTable*, CodeBlock*); 98 BytecodeGenerator(EvalNode*, const ScopeChain&, SymbolTable*, EvalCodeBlock*); 99 99 100 100 JSGlobalData* globalData() const { return m_globalData; } … … 208 208 // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary. 209 209 ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount()); 210 if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { 211 LineInfo info = { instructions().size(), n->lineNo() }; 212 m_codeBlock->addLineInfo(info); 213 } 210 addLineInfo(n->lineNo()); 211 214 212 if (m_emitNodeDepth >= s_maxEmitNodeDepth) 215 213 return emitThrowExpressionTooDeepException(); … … 227 225 void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue) 228 226 { 229 if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { 230 LineInfo info = { instructions().size(), n->lineNo() }; 231 m_codeBlock->addLineInfo(info); 232 } 227 addLineInfo(n->lineNo()); 233 228 if (m_emitNodeDepth >= s_maxEmitNodeDepth) { 234 229 emitThrowExpressionTooDeepException(); … … 241 236 242 237 void emitExpressionInfo(unsigned divot, unsigned startOffset, unsigned endOffset) 243 { 238 { 239 if (!m_shouldEmitRichSourceInfo) 240 return; 241 244 242 divot -= m_codeBlock->sourceOffset(); 245 243 if (divot > ExpressionRangeInfo::MaxDivot) { … … 505 503 } 506 504 505 void addLineInfo(unsigned lineNo) 506 { 507 #if !ENABLE(OPCODE_SAMPLING) 508 if (m_shouldEmitRichSourceInfo) 509 #endif 510 m_codeBlock->addLineInfo(instructions().size(), lineNo); 511 } 512 507 513 RegisterID* emitInitLazyRegister(RegisterID*); 508 514 … … 521 527 bool m_shouldEmitDebugHooks; 522 528 bool m_shouldEmitProfileHooks; 529 bool m_shouldEmitRichSourceInfo; 523 530 524 531 const ScopeChain* m_scopeChain; -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r72351 r72360 588 588 #if ENABLE(JIT) && ENABLE(INTERPRETER) 589 589 if (callerFrame->globalData().canUseJIT()) 590 bytecodeOffset = codeBlock->bytecodeOffset(call erFrame, callFrame->returnPC());590 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnPC()); 591 591 else 592 bytecodeOffset = codeBlock->bytecodeOffset(call erFrame, callFrame->returnVPC());592 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()); 593 593 #elif ENABLE(JIT) 594 bytecodeOffset = codeBlock->bytecodeOffset(call erFrame, callFrame->returnPC());594 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnPC()); 595 595 #else 596 bytecodeOffset = codeBlock->bytecodeOffset(call erFrame, callFrame->returnVPC());596 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()); 597 597 #endif 598 598 … … 605 605 exception->clearAppendSourceToMessage(); 606 606 607 if (!callFrame->codeBlock()->hasExpressionInfo()) 608 return; 609 607 610 int startOffset = 0; 608 611 int endOffset = 0; … … 610 613 611 614 CodeBlock* codeBlock = callFrame->codeBlock(); 612 codeBlock->expressionRangeForBytecodeOffset( callFrame,bytecodeOffset, divotPoint, startOffset, endOffset);615 codeBlock->expressionRangeForBytecodeOffset(bytecodeOffset, divotPoint, startOffset, endOffset); 613 616 614 617 int expressionStart = divotPoint - startOffset; … … 649 652 } 650 653 651 NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset , bool explicitThrow)654 NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset) 652 655 { 653 656 CodeBlock* codeBlock = callFrame->codeBlock(); … … 657 660 if (exceptionValue.isObject()) { 658 661 JSObject* exception = asObject(exceptionValue); 659 if (!explicitThrow && exception->isErrorInstance() && static_cast<ErrorInstance*>(exception)->appendSourceToMessage()) 662 663 if (exception->isErrorInstance() && static_cast<ErrorInstance*>(exception)->appendSourceToMessage()) 660 664 appendSourceToError(callFrame, static_cast<ErrorInstance*>(exception), bytecodeOffset); 661 665 662 // FIXME: should only really be adding these properties to VM generated exceptions, 663 // but the inspector currently requires these for all thrown objects. 664 if (!hasErrorInfo(callFrame, exception)) 665 addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset), codeBlock->ownerExecutable()->source()); 666 // Using hasExpressionInfo to imply we are interested in rich exception info. 667 if (codeBlock->hasExpressionInfo() && !hasErrorInfo(callFrame, exception)) { 668 ASSERT(codeBlock->hasLineInfo()); 669 670 // FIXME: should only really be adding these properties to VM generated exceptions, 671 // but the inspector currently requires these for all thrown objects. 672 addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), codeBlock->ownerExecutable()->source()); 673 } 666 674 667 675 ComplType exceptionType = exception->exceptionType(); … … 672 680 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 673 681 bool hasHandler = codeBlock->handlerForBytecodeOffset(bytecodeOffset); 674 debugger->exception(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->lineNumberForBytecodeOffset( callFrame,bytecodeOffset), hasHandler);682 debugger->exception(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), hasHandler); 675 683 } 676 684 … … 4604 4612 exceptionValue = callFrame->r(ex).jsValue(); 4605 4613 4606 handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin() , true);4614 handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin()); 4607 4615 if (!handler) 4608 4616 return throwError(callFrame, exceptionValue); … … 4775 4783 exceptionValue = createInterruptedExecutionException(globalData); 4776 4784 } 4777 handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin() , false);4785 handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin()); 4778 4786 if (!handler) 4779 4787 return throwError(callFrame, exceptionValue); … … 4850 4858 #if ENABLE(INTERPRETER) 4851 4859 if (!callerFrame->globalData().canUseJIT()) 4852 bytecodeOffset = callerCodeBlock->bytecodeOffset(call erFrame, callFrame->returnVPC());4860 bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnVPC()); 4853 4861 #if ENABLE(JIT) 4854 4862 else 4855 bytecodeOffset = callerCodeBlock->bytecodeOffset(call erFrame, callFrame->returnPC());4863 bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC()); 4856 4864 #endif 4857 4865 #else 4858 bytecodeOffset = callerCodeBlock->bytecodeOffset(call erFrame, callFrame->returnPC());4859 #endif 4860 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset( callerFrame,bytecodeOffset - 1);4866 bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC()); 4867 #endif 4868 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(bytecodeOffset - 1); 4861 4869 sourceID = callerCodeBlock->ownerExecutable()->sourceID(); 4862 4870 sourceURL = callerCodeBlock->ownerExecutable()->sourceURL(); -
trunk/JavaScriptCore/interpreter/Interpreter.h
r70703 r72360 109 109 110 110 NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset); 111 NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset , bool);111 NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset); 112 112 NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine); 113 113 -
trunk/JavaScriptCore/jit/JIT.cpp
r72176 r72360 553 553 } 554 554 555 if (m_codeBlock-> hasExceptionInfo()) {555 if (m_codeBlock->needsCallReturnIndices()) { 556 556 m_codeBlock->callReturnIndexVector().reserveCapacity(m_calls.size()); 557 557 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) -
trunk/JavaScriptCore/jit/JITStubs.cpp
r72176 r72360 1068 1068 CallFrame* callFrame; 1069 1069 }; 1070 static ExceptionHandler jitThrow(JSGlobalData* globalData, CallFrame* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation , bool explicitThrow)1070 static ExceptionHandler jitThrow(JSGlobalData* globalData, CallFrame* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation) 1071 1071 { 1072 1072 ASSERT(exceptionValue); 1073 1073 1074 unsigned vPCIndex = callFrame->codeBlock()->bytecodeOffset( callFrame,faultLocation);1074 unsigned vPCIndex = callFrame->codeBlock()->bytecodeOffset(faultLocation); 1075 1075 globalData->exception = JSValue(); 1076 HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex , explicitThrow); // This may update callFrame & exceptionValue!1076 HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex); // This may update callFrame & exceptionValue! 1077 1077 globalData->exception = exceptionValue; 1078 1078 … … 1385 1385 // moved the call frame forward. 1386 1386 CallFrame* oldCallFrame = callFrame->callerFrame(); 1387 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), ReturnAddressPtr(oldCallFrame->returnPC()) , false);1387 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), ReturnAddressPtr(oldCallFrame->returnPC())); 1388 1388 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 1389 1389 callFrame = handler.callFrame; … … 2007 2007 // Rewind to the previous call frame because op_call already optimistically 2008 2008 // moved the call frame forward. 2009 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc , false);2009 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc); 2010 2010 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 2011 2011 return handler.callFrame; … … 2022 2022 // Rewind to the previous call frame because op_call already optimistically 2023 2023 // moved the call frame forward. 2024 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc , false);2024 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc); 2025 2025 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 2026 2026 return handler.callFrame; … … 2066 2066 // Rewind to the previous call frame because op_call already optimistically 2067 2067 // moved the call frame forward. 2068 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc , false);2068 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc); 2069 2069 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 2070 2070 return handler.callFrame; … … 2081 2081 // Rewind to the previous call frame because op_call already optimistically 2082 2082 // moved the call frame forward. 2083 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc , false);2083 ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc); 2084 2084 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 2085 2085 return handler.callFrame; … … 3239 3239 { 3240 3240 STUB_INIT_STACK_FRAME(stackFrame); 3241 ExceptionHandler handler = jitThrow(stackFrame.globalData, stackFrame.callFrame, stackFrame.args[0].jsValue(), STUB_RETURN_ADDRESS , true);3241 ExceptionHandler handler = jitThrow(stackFrame.globalData, stackFrame.callFrame, stackFrame.args[0].jsValue(), STUB_RETURN_ADDRESS); 3242 3242 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 3243 3243 return handler.callFrame; … … 3596 3596 STUB_INIT_STACK_FRAME(stackFrame); 3597 3597 JSGlobalData* globalData = stackFrame.globalData; 3598 ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception, globalData->exceptionLocation , false);3598 ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception, globalData->exceptionLocation); 3599 3599 STUB_SET_RETURN_ADDRESS(handler.catchRoutine); 3600 3600 return handler.callFrame; -
trunk/JavaScriptCore/runtime/Collector.cpp
r70111 r72360 1052 1052 if (m_globalData->exception) 1053 1053 markStack.append(m_globalData->exception); 1054 if (m_globalData->functionCodeBlockBeingReparsed)1055 m_globalData->functionCodeBlockBeingReparsed->markAggregate(markStack);1056 1054 if (m_globalData->firstStringifierToMark) 1057 1055 JSONObject::markStringifiers(markStack, m_globalData->firstStringifierToMark); -
trunk/JavaScriptCore/runtime/Executable.cpp
r70008 r72360 109 109 ASSERT(!m_evalCodeBlock); 110 110 m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scopeChain.localDepth())); 111 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), globalObject->debugger(),scopeChain, m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get())));111 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), scopeChain, m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get()))); 112 112 generator->generate(); 113 113 … … 157 157 158 158 m_programCodeBlock = adoptPtr(new ProgramCodeBlock(this, GlobalCode, globalObject, source().provider())); 159 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), globalObject->debugger(),scopeChain, &globalObject->symbolTable(), m_programCodeBlock.get())));159 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), scopeChain, &globalObject->symbolTable(), m_programCodeBlock.get()))); 160 160 generator->generate(); 161 161 … … 194 194 ASSERT(!m_codeBlockForCall); 195 195 m_codeBlockForCall = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), false)); 196 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), globalObject->debugger(),scopeChain, m_codeBlockForCall->symbolTable(), m_codeBlockForCall.get())));196 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChain, m_codeBlockForCall->symbolTable(), m_codeBlockForCall.get()))); 197 197 generator->generate(); 198 198 m_numParametersForCall = m_codeBlockForCall->m_numParameters; … … 235 235 ASSERT(!m_codeBlockForConstruct); 236 236 m_codeBlockForConstruct = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), true)); 237 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), globalObject->debugger(),scopeChain, m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct.get())));237 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChain, m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct.get()))); 238 238 generator->generate(); 239 239 m_numParametersForConstruct = m_codeBlockForConstruct->m_numParameters; … … 263 263 if (m_codeBlockForConstruct) 264 264 m_codeBlockForConstruct->markAggregate(markStack); 265 }266 267 PassOwnPtr<ExceptionInfo> FunctionExecutable::reparseExceptionInfo(ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)268 {269 JSObject* exception = 0;270 JSGlobalData* globalData = scopeChainNode->globalData;271 RefPtr<FunctionBodyNode> newFunctionBody = globalData->parser->parse<FunctionBodyNode>(scopeChainNode->globalObject, 0, 0, m_source, m_parameters.get(), isStrictMode() ? JSParseStrict : JSParseNormal, &exception);272 if (!newFunctionBody)273 return PassOwnPtr<ExceptionInfo>();274 ASSERT(newFunctionBody->isStrictMode() == isStrictMode());275 if (m_forceUsesArguments)276 newFunctionBody->setUsesArguments();277 newFunctionBody->finishParsing(m_parameters, m_name);278 279 ScopeChain scopeChain(scopeChainNode);280 JSGlobalObject* globalObject = scopeChain.globalObject();281 282 OwnPtr<CodeBlock> newCodeBlock(adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), codeBlock->m_isConstructor)));283 globalData->functionCodeBlockBeingReparsed = newCodeBlock.get();284 285 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(newFunctionBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get())));286 generator->setRegeneratingForExceptionInfo(static_cast<FunctionCodeBlock*>(codeBlock));287 generator->generate();288 289 ASSERT(newCodeBlock->instructionCount() == codeBlock->instructionCount());290 291 #if ENABLE(JIT)292 if (globalData->canUseJIT()) {293 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get(), 0, codeBlock->m_isConstructor ? generatedJITCodeForConstruct().start() : generatedJITCodeForCall().start());294 ASSERT(codeBlock->m_isConstructor ? newJITCode.size() == generatedJITCodeForConstruct().size() : newJITCode.size() == generatedJITCodeForCall().size());295 }296 #endif297 298 globalData->functionCodeBlockBeingReparsed = 0;299 300 return newCodeBlock->extractExceptionInfo();301 }302 303 PassOwnPtr<ExceptionInfo> EvalExecutable::reparseExceptionInfo(ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)304 {305 JSObject* exception = 0;306 JSGlobalData* globalData = scopeChainNode->globalData;307 RefPtr<EvalNode> newEvalBody = globalData->parser->parse<EvalNode>(scopeChainNode->globalObject, 0, 0, m_source, 0, isStrictMode() ? JSParseStrict : JSParseNormal, &exception);308 ASSERT(newEvalBody->isStrictMode() == isStrictMode());309 if (!newEvalBody)310 return PassOwnPtr<ExceptionInfo>();311 312 ScopeChain scopeChain(scopeChainNode);313 JSGlobalObject* globalObject = scopeChain.globalObject();314 315 OwnPtr<EvalCodeBlock> newCodeBlock(adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scopeChain.localDepth())));316 317 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(newEvalBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get())));318 generator->setRegeneratingForExceptionInfo(static_cast<EvalCodeBlock*>(codeBlock));319 generator->generate();320 321 ASSERT(newCodeBlock->instructionCount() == codeBlock->instructionCount());322 323 #if ENABLE(JIT)324 if (globalData->canUseJIT()) {325 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get(), 0, generatedJITCodeForCall().start());326 ASSERT(newJITCode.size() == generatedJITCodeForCall().size());327 }328 #endif329 330 return newCodeBlock->extractExceptionInfo();331 265 } 332 266 … … 377 311 } 378 312 379 PassOwnPtr<ExceptionInfo> ProgramExecutable::reparseExceptionInfo(ScopeChainNode*, CodeBlock*) 380 { 381 // CodeBlocks for program code are transient and therefore do not gain from from throwing out their exception information. 382 return PassOwnPtr<ExceptionInfo>(); 383 } 384 385 } 313 } -
trunk/JavaScriptCore/runtime/Executable.h
r69516 r72360 178 178 bool isStrictMode() const { return m_features & StrictModeFeature; } 179 179 180 virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(ScopeChainNode*, CodeBlock*) = 0;181 182 180 protected: 183 181 void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine) … … 230 228 JSObject* compileInternal(ExecState*, ScopeChainNode*); 231 229 232 virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(ScopeChainNode*, CodeBlock*);233 234 230 OwnPtr<EvalCodeBlock> m_evalCodeBlock; 235 231 }; … … 273 269 JSObject* compileInternal(ExecState*, ScopeChainNode*); 274 270 275 virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(ScopeChainNode*, CodeBlock*);276 277 271 OwnPtr<ProgramCodeBlock> m_programCodeBlock; 278 272 }; … … 366 360 JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*); 367 361 368 virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(ScopeChainNode*, CodeBlock*);369 370 362 unsigned m_numCapturedVariables : 31; 371 363 bool m_forceUsesArguments : 1; -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r72127 r72360 142 142 , head(0) 143 143 , dynamicGlobalObject(0) 144 , functionCodeBlockBeingReparsed(0)145 144 , firstStringifierToMark(0) 146 145 , markStack(jsArrayVPtr) -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r72207 r72360 117 117 118 118 bool isSharedInstance() { return globalDataType == APIShared; } 119 bool usingAPI() { return globalDataType != Default; } 119 120 static bool sharedInstanceExists(); 120 121 static JSGlobalData& sharedInstance(); … … 206 207 HashSet<JSObject*> arrayVisitedElements; 207 208 208 CodeBlock* functionCodeBlockBeingReparsed;209 209 Stringifier* firstStringifierToMark; 210 210 -
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r70406 r72360 255 255 Debugger* debugger() const { return d()->debugger; } 256 256 void setDebugger(Debugger* debugger) { d()->debugger = debugger; } 257 257 258 258 virtual bool supportsProfiling() const { return false; } 259 259 virtual bool supportsRichSourceInfo() const { return true; } 260 260 261 ScopeChain& globalScopeChain() { return d()->globalScopeChain; } 261 262 … … 277 278 void resetPrototype(JSValue prototype); 278 279 279 JSGlobalData& globalData() { return *d()->globalData.get(); }280 JSGlobalData& globalData() const { return *d()->globalData.get(); } 280 281 JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); } 281 282 -
trunk/WebCore/ChangeLog
r72358 r72360 1 2010-11-18 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 49708 - Stop recompiling functions to regenerate exception info. 6 7 Instead only hold info as necessary – keep divot info is the inspector 8 is enabled, line number info is debugging or profiling, and handler 9 info for functions with try/catch. 10 11 * bindings/js/JSDOMWindowBase.cpp: 12 (WebCore::JSDOMWindowBase::supportsRichSourceInfo): 13 - report to JSC whether the inspector is enabled - in which 14 case we will generate better error messages on exceptions. 15 * bindings/js/JSDOMWindowBase.h: 16 1 17 2010-11-18 Jian Li <jianli@chromium.org> 2 18 -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r69798 r72360 119 119 } 120 120 121 bool JSDOMWindowBase::supportsRichSourceInfo() const 122 { 123 #if !ENABLE(JAVASCRIPT_DEBUGGER) || !ENABLE(INSPECTOR) 124 return false; 125 #else 126 Frame* frame = impl()->frame(); 127 if (!frame) 128 return false; 129 130 Page* page = frame->page(); 131 if (!page) 132 return false; 133 134 bool enabled = page->inspectorController()->enabled(); 135 ASSERT(enabled || !debugger()); 136 ASSERT(enabled || !supportsProfiling()); 137 return enabled; 138 #endif 139 } 140 121 141 bool JSDOMWindowBase::shouldInterruptScript() const 122 142 { -
trunk/WebCore/bindings/js/JSDOMWindowBase.h
r69516 r72360 61 61 virtual JSC::ExecState* globalExec(); 62 62 virtual bool supportsProfiling() const; 63 virtual bool supportsRichSourceInfo() const; 63 64 virtual bool shouldInterruptScript() const; 64 65 -
trunk/WebKitTools/ChangeLog
r72357 r72360 1 2010-11-18 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 49708 - Stop recompiling functions to regenerate exception info. 6 7 Instead only hold info as necessary – keep divot info is the inspector 8 is enabled, line number info is debugging or profiling, and handler 9 info for functions with try/catch. 10 11 * DumpRenderTree/mac/DumpRenderTree.mm: 12 (shouldEnableDeveloperExtras): 13 - always enable the developer tools from DRT, to ensure we 14 produce rich error messages on JavaScript exceptions. 15 1 16 2010-11-18 Kinuko Yasuda <kinuko@chromium.org> 2 17 -
trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
r72164 r72360 990 990 static bool shouldEnableDeveloperExtras(const char* pathOrURL) 991 991 { 992 return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");992 return true; 993 993 } 994 994
Note: See TracChangeset
for help on using the changeset viewer.