aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
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/jsruntime/qv4context.cpp
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/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index f3d2ab66ed..c14d987171 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -461,69 +461,6 @@ ReturnedValue ExecutionContext::getProperty(const StringRef name)
return 0;
}
-ReturnedValue ExecutionContext::getPropertyNoThrow(const StringRef name)
-{
- Scope scope(this);
- ScopedValue v(scope);
- name->makeIdentifier();
-
- if (name->equals(engine->id_this))
- return callData->thisObject.asReturnedValue();
-
- bool hasWith = false;
- bool hasCatchScope = false;
- for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer) {
- if (ctx->type == Type_WithContext) {
- ScopedObject w(scope, static_cast<WithContext *>(ctx)->withObject);
- hasWith = true;
- bool hasProperty = false;
- v = w->get(name, &hasProperty);
- if (hasProperty) {
- return v.asReturnedValue();
- }
- continue;
- }
-
- else if (ctx->type == Type_CatchContext) {
- hasCatchScope = true;
- CatchContext *c = static_cast<CatchContext *>(ctx);
- if (c->exceptionVarName->isEqualTo(name))
- return c->exceptionValue.asReturnedValue();
- }
-
- else if (ctx->type >= Type_CallContext) {
- QV4::CallContext *c = static_cast<CallContext *>(ctx);
- ScopedFunctionObject f(scope, c->function);
- if (f->needsActivation || hasWith || hasCatchScope) {
- for (unsigned int i = 0; i < f->varCount; ++i)
- if (f->varList[i]->isEqualTo(name))
- return c->locals[i].asReturnedValue();
- for (int i = (int)f->formalParameterCount - 1; i >= 0; --i)
- if (f->formalParameterList[i]->isEqualTo(name))
- return c->callData->args[i].asReturnedValue();
- }
- if (c->activation) {
- bool hasProperty = false;
- v = c->activation->get(name, &hasProperty);
- if (hasProperty)
- return v.asReturnedValue();
- }
- if (f->function && f->function->isNamedExpression()
- && name->equals(f->function->name))
- return f.asReturnedValue();
- }
-
- else if (ctx->type == Type_GlobalContext) {
- GlobalContext *g = static_cast<GlobalContext *>(ctx);
- bool hasProperty = false;
- v = g->global->get(name, &hasProperty);
- if (hasProperty)
- return v.asReturnedValue();
- }
- }
- return Encode::undefined();
-}
-
ReturnedValue ExecutionContext::getPropertyAndBase(const StringRef name, ObjectRef base)
{
Scope scope(this);