Changeset 39156 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Dec 9, 2008, 4:26:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r39141 r39156 793 793 } 794 794 795 NEVER_INLINE Instruction* Interpreter::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)795 NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow) 796 796 { 797 797 // Set up the exception object … … 853 853 // Calculate an exception handler vPC, unwinding call frames as necessary. 854 854 855 int scopeDepth; 856 Instruction* handlerVPC; 857 858 while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) { 855 HandlerInfo* handler = 0; 856 while (!(handler = codeBlock->handlerForVPC(vPC))) { 859 857 if (!unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) 860 858 return 0; … … 864 862 865 863 ScopeChain sc(callFrame->scopeChain()); 866 int scopeDelta = depth(codeBlock, sc) - scopeDepth;864 int scopeDelta = depth(codeBlock, sc) - handler->scopeDepth; 867 865 ASSERT(scopeDelta >= 0); 868 866 while (scopeDelta--) … … 870 868 callFrame->setScopeChain(sc.node()); 871 869 872 return handler VPC;870 return handler; 873 871 } 874 872 … … 1481 1479 JSGlobalData* globalData = &callFrame->globalData(); 1482 1480 JSValue* exceptionValue = noValue(); 1483 Instruction* handlerVPC= 0;1481 HandlerInfo* handler = 0; 1484 1482 1485 1483 Instruction* vPC = callFrame->codeBlock()->instructions().begin(); … … 3794 3792 exceptionValue = callFrame[ex].jsValue(callFrame); 3795 3793 3796 handler VPC= throwException(callFrame, exceptionValue, vPC, true);3797 if (!handler VPC) {3794 handler = throwException(callFrame, exceptionValue, vPC, true); 3795 if (!handler) { 3798 3796 *exception = exceptionValue; 3799 3797 return jsNull(); 3800 3798 } 3801 3799 3802 vPC = handlerVPC;3800 vPC = callFrame->codeBlock()->instructions().begin() + handler->target; 3803 3801 NEXT_INSTRUCTION(); 3804 3802 } … … 3970 3968 exceptionValue = createInterruptedExecutionException(globalData); 3971 3969 } 3972 handler VPC= throwException(callFrame, exceptionValue, vPC, false);3973 if (!handler VPC) {3970 handler = throwException(callFrame, exceptionValue, vPC, false); 3971 if (!handler) { 3974 3972 *exception = exceptionValue; 3975 3973 return jsNull(); 3976 3974 } 3977 vPC = handlerVPC; 3975 3976 vPC = callFrame->codeBlock()->instructions().begin() + handler->target; 3978 3977 NEXT_INSTRUCTION(); 3979 3978 } … … 5754 5753 ASSERT(exceptionValue); 5755 5754 5756 Instruction* handlerVPC= ARG_globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, true);5757 5758 if (!handler VPC) {5755 HandlerInfo* handler = ARG_globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, true); 5756 5757 if (!handler) { 5759 5758 *ARG_exception = exceptionValue; 5760 5759 return JSImmediate::nullImmediate(); … … 5762 5761 5763 5762 ARG_setCallFrame(callFrame); 5764 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);5763 void* catchRoutine = handler->nativeCode; 5765 5764 ASSERT(catchRoutine); 5766 5765 CTI_SET_RETURN_ADDRESS(catchRoutine); … … 6100 6099 globalData->exception = noValue(); 6101 6100 6102 Instruction* handlerVPC= globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, false);6103 6104 if (!handler VPC) {6101 HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, false); 6102 6103 if (!handler) { 6105 6104 *ARG_exception = exceptionValue; 6106 6105 return JSImmediate::nullImmediate(); … … 6108 6107 6109 6108 ARG_setCallFrame(callFrame); 6110 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC);6109 void* catchRoutine = handler->nativeCode; 6111 6110 ASSERT(catchRoutine); 6112 6111 CTI_SET_RETURN_ADDRESS(catchRoutine);
Note:
See TracChangeset
for help on using the changeset viewer.