diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-18 15:42:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-29 10:38:45 +0100 |
commit | 5229a8b259286c9ea61036fd6b4bd0039104a206 (patch) | |
tree | 277d62ecedeaf703ce778d86f8cbcb94b9a57fe2 /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | 570686d42176af193b15abfe4b7bc17d831f4cf6 (diff) |
Rework exception handling
Start the work to remove c++ exceptions from our JS
exception handling. Rather rely on engine->hasException.
Check the flag after we return from any runtime call in the
JIT.
Implement new try/catch handling code in qv4codegen and
for the JIT that doesn't rely on exceptions. As an added
bonus, we can remove the Try statement in the IR.
Change-Id: Ic95addd6ae03371c43c47e04cac26afdce23a061
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 64b49f9a05..04a07093c1 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -365,40 +365,6 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *&code, __qmljs_throw(context, VALUEPTR(instr.arg)); MOTH_END_INSTR(CallBuiltinThrow) - MOTH_BEGIN_INSTR(EnterTry) - VALUE(instr.exceptionVar) = QV4::Primitive::undefinedValue(); - bool caughtException = false; - try { - const uchar *tryCode = ((uchar *)&instr.tryOffset) + instr.tryOffset; - run(context, tryCode, stack, stackSize); - code = tryCode; - context->interpreterInstructionPointer = &code; - } catch (...) { - STOREVALUE(instr.exceptionVar, context->catchException()); - caughtException = true; - } - if (caughtException) { - try { - QV4::ExecutionContext *catchContext = __qmljs_builtin_push_catch_scope(runtimeStrings[instr.exceptionVarName], VALUEPTR(instr.exceptionVar), context); - const uchar *catchCode = ((uchar *)&instr.catchOffset) + instr.catchOffset; - run(catchContext, catchCode, stack, stackSize); - code = catchCode; - context->interpreterInstructionPointer = &code; - context = __qmljs_builtin_pop_scope(catchContext); - } catch (...) { - STOREVALUE(instr.exceptionVar, context->catchException()); - const uchar *catchCode = ((uchar *)&instr.catchOffset) + instr.catchOffset; - run(context, catchCode, stack, stackSize); - code = catchCode; - context->interpreterInstructionPointer = &code; - } - } - MOTH_END_INSTR(EnterTry) - - MOTH_BEGIN_INSTR(CallBuiltinFinishTry) - return QV4::ReturnedValue(0); - MOTH_END_INSTR(CallBuiltinFinishTry) - MOTH_BEGIN_INSTR(CallBuiltinPushScope) context = __qmljs_builtin_push_with_scope(VALUEPTR(instr.arg), context); MOTH_END_INSTR(CallBuiltinPushScope) |