summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit/JITExceptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/jit/JITExceptions.cpp')
-rw-r--r--Source/JavaScriptCore/jit/JITExceptions.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/jit/JITExceptions.cpp b/Source/JavaScriptCore/jit/JITExceptions.cpp
index cf2ea28af..8084f773b 100644
--- a/Source/JavaScriptCore/jit/JITExceptions.cpp
+++ b/Source/JavaScriptCore/jit/JITExceptions.cpp
@@ -27,53 +27,38 @@
#include "JITExceptions.h"
#include "CallFrame.h"
+#include "CallFrameInlines.h"
#include "CodeBlock.h"
#include "Interpreter.h"
+#include "JITStubs.h"
#include "JSCJSValue.h"
#include "LLIntData.h"
#include "LLIntOpcode.h"
#include "LLIntThunks.h"
#include "Opcode.h"
-#include "JSCInlines.h"
+#include "Operations.h"
#include "VM.h"
namespace JSC {
-void genericUnwind(VM* vm, ExecState* callFrame, UnwindStart unwindStart)
+void genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue)
{
- if (Options::breakOnThrow()) {
- CodeBlock* codeBlock = callFrame->codeBlock();
- if (codeBlock)
- dataLog("In call frame ", RawPointer(callFrame), " for code block ", *codeBlock, "\n");
- else
- dataLog("In call frame ", RawPointer(callFrame), " with null CodeBlock\n");
- CRASH();
- }
-
- Exception* exception = vm->exception();
- RELEASE_ASSERT(exception);
- HandlerInfo* handler = vm->interpreter->unwind(*vm, callFrame, exception, unwindStart); // This may update callFrame.
+ RELEASE_ASSERT(exceptionValue);
+ HandlerInfo* handler = vm->interpreter->unwind(callFrame, exceptionValue); // This may update callFrame.
void* catchRoutine;
Instruction* catchPCForInterpreter = 0;
if (handler) {
- // handler->target is meaningless for getting a code offset when catching
- // the exception in a DFG/FTL frame. This bytecode target offset could be
- // something that's in an inlined frame, which means an array access
- // with this bytecode offset in the machine frame is utterly meaningless
- // and can cause an overflow. OSR exit properly exits to handler->target
- // in the proper frame.
- if (!JITCode::isOptimizingJIT(callFrame->codeBlock()->jitType()))
- catchPCForInterpreter = &callFrame->codeBlock()->instructions()[handler->target];
+ catchPCForInterpreter = &callFrame->codeBlock()->instructions()[handler->target];
#if ENABLE(JIT)
catchRoutine = handler->nativeCode.executableAddress();
#else
catchRoutine = catchPCForInterpreter->u.pointer;
#endif
} else
- catchRoutine = LLInt::getCodePtr(handleUncaughtException);
+ catchRoutine = LLInt::getCodePtr(returnFromJavaScript);
- vm->callFrameForCatch = callFrame;
+ vm->callFrameForThrow = callFrame;
vm->targetMachinePCForThrow = catchRoutine;
vm->targetInterpreterPCForThrow = catchPCForInterpreter;