Changeset 108681 in webkit
- Timestamp:
- Feb 23, 2012 3:18:05 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r108677 r108681 1 2012-02-23 Oliver Hunt <oliver@apple.com> 2 3 Make Interpreter::getStackTrace be able to generate the line number for the top callframe if none is provided 4 https://bugs.webkit.org/show_bug.cgi?id=79407 5 6 Reviewed by Gavin Barraclough. 7 8 Outside of exception handling, we don't know what our source line number is. This 9 change allows us to pass -1 is as the initial line number, and get the correct line 10 number in the resultant stack trace. We can't completely elide the initial line 11 number (yet) due to some idiosyncrasies of the exception handling machinery. 12 13 * interpreter/Interpreter.cpp: 14 (JSC::getLineNumberForCallFrame): 15 (JSC): 16 (JSC::Interpreter::getStackTrace): 17 1 18 2012-02-22 Filip Pizlo <fpizlo@apple.com> 2 19 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r108444 r108681 818 818 } 819 819 820 static int getLineNumberForCallFrame(CallFrame* callFrame) 821 { 822 callFrame = callFrame->removeHostCallFrameFlag(); 823 CodeBlock* codeBlock = callFrame->codeBlock(); 824 if (!codeBlock) 825 return -1; 826 #if ENABLE(INTERPRETER) 827 if (!globalData->canUseJIT()) 828 return codeBlock->lineNumberForBytecodeOffset(callFrame->bytecodeOffsetForNonDFGCode() - 1); 829 #endif 830 #if ENABLE(JIT) 831 #if ENABLE(DFG_JIT) 832 if (codeBlock->getJITType() == JITCode::DFGJIT) 833 return codeBlock->lineNumberForBytecodeOffset(codeBlock->codeOrigin(callFrame->codeOriginIndexForDFG()).bytecodeIndex); 834 #endif 835 return codeBlock->lineNumberForBytecodeOffset(callFrame->bytecodeOffsetForNonDFGCode()); 836 #endif 837 } 838 820 839 static CallFrame* getCallerInfo(JSGlobalData* globalData, CallFrame* callFrame, int& lineNumber) 821 840 { … … 930 949 return; 931 950 951 if (line == -1) 952 line = getLineNumberForCallFrame(callFrame); 953 932 954 while (callFrame && callFrame != CallFrame::noCaller()) { 933 955 UString sourceURL;
Note: See TracChangeset
for help on using the changeset viewer.