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/compiler/qv4isel_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/compiler/qv4isel_moth.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_moth.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index d354bf66a5..2e31aa10a0 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -684,22 +684,6 @@ void InstructionSelection::visitRet(V4IR::Ret *s) addInstruction(ret); } -void InstructionSelection::visitTry(V4IR::Try *t) -{ - Instruction::EnterTry enterTry; - enterTry.tryOffset = 0; - enterTry.catchOffset = 0; - enterTry.exceptionVarName = registerString(*t->exceptionVarName); - enterTry.exceptionVar = getParam(t->exceptionVar); - ptrdiff_t enterTryLoc = addInstruction(enterTry); - - ptrdiff_t tryLoc = enterTryLoc + (((const char *)&enterTry.tryOffset) - ((const char *)&enterTry)); - _patches[t->tryBlock].append(tryLoc); - - ptrdiff_t catchLoc = enterTryLoc + (((const char *)&enterTry.catchOffset) - ((const char *)&enterTry)); - _patches[t->catchBlock].append(catchLoc); -} - void InstructionSelection::callBuiltinInvalid(V4IR::Name *func, V4IR::ExprList *args, V4IR::Temp *result) { Instruction::CallActivationProperty call; @@ -788,10 +772,15 @@ void InstructionSelection::callBuiltinThrow(V4IR::Expr *arg) addInstruction(call); } -void InstructionSelection::callBuiltinFinishTry() +void InstructionSelection::callBuiltinReThrow() { - Instruction::CallBuiltinFinishTry call; - addInstruction(call); + // ### +} + + +void InstructionSelection::callBuiltinPushCatchScope(const QString &exceptionName) +{ + // #### } void InstructionSelection::callBuiltinForeachIteratorObject(V4IR::Temp *arg, V4IR::Temp *result) |