aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-18 15:42:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 10:38:45 +0100
commit5229a8b259286c9ea61036fd6b4bd0039104a206 (patch)
tree277d62ecedeaf703ce778d86f8cbcb94b9a57fe2 /src/qml/compiler/qv4codegen_p.h
parent570686d42176af193b15abfe4b7bc17d831f4cf6 (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/qv4codegen_p.h')
-rw-r--r--src/qml/compiler/qv4codegen_p.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 66b80c377b..652f395a88 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -272,6 +272,22 @@ protected:
return it->groupStartBlock;
return 0;
}
+ V4IR::BasicBlock *exceptionHandler() const
+ {
+ if (_exceptionHandlers.isEmpty())
+ return 0;
+ return _exceptionHandlers.top();
+ }
+ void pushExceptionHandler(V4IR::BasicBlock *handler)
+ {
+ handler->isExceptionHandler = true;
+ _exceptionHandlers.push(handler);
+ }
+ void popExceptionHandler()
+ {
+ Q_ASSERT(!_exceptionHandlers.isEmpty());
+ _exceptionHandlers.pop();
+ }
V4IR::Expr *member(V4IR::Expr *base, const QString *name);
V4IR::Expr *subscript(V4IR::Expr *base, V4IR::Expr *index);
@@ -428,7 +444,6 @@ protected:
V4IR::Function *_function;
V4IR::BasicBlock *_block;
V4IR::BasicBlock *_exitBlock;
- V4IR::BasicBlock *_throwBlock;
unsigned _returnAddress;
Environment *_env;
Loop *_loop;
@@ -436,6 +451,7 @@ protected:
ScopeAndFinally *_scopeAndFinally;
QHash<AST::Node *, Environment *> _envMap;
QHash<AST::FunctionExpression *, int> _functionMap;
+ QStack<V4IR::BasicBlock *> _exceptionHandlers;
bool _strictMode;
QList<QQmlError> _errors;