Changeset 72360 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Nov 18, 2010, 6:35:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note:
See TracChangeset
for help on using the changeset viewer.