diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 10:09:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:08 +0200 |
commit | 0f2cf9074d4f0220f5c707eed478f99334814789 (patch) | |
tree | 685ea2295b8728b3545523e2625a4cf65f39b9ee /src/qml/types | |
parent | 1ef957834bf9040ccd001fa6d80e483b9b21452c (diff) |
Fix CallContext to not hold arguments on the C stack anymore
Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 22 | ||||
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 4 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 148332c4bd..130ed291c5 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1702,7 +1702,8 @@ int QQmlDelegateModelItemMetaType::parseGroups(const QV4::Value &groups) const QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>()); if (!o) ctx->throwTypeError(QStringLiteral("Not a valid VisualData object")); if (!o->item->metaType->model) @@ -1713,7 +1714,8 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::SimpleCallContext *ctx) QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>()); if (!o) ctx->throwTypeError(QStringLiteral("Not a valid VisualData object")); @@ -1728,17 +1730,18 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::SimpleCallContext *ctx QV4::ReturnedValue QQmlDelegateModelItem::set_groups(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelItemObject *o = ctx->thisObject.as<QQmlDelegateModelItemObject>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>()); if (!o) ctx->throwTypeError(QStringLiteral("Not a valid VisualData object")); - if (!ctx->argumentCount) + if (!ctx->callData->argc) ctx->throwTypeError(); if (!o->item->metaType->model) return QV4::Encode::undefined(); QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(o->item->metaType->model); - const int groupFlags = model->m_cacheMetaType->parseGroups(ctx->arguments[0]); + const int groupFlags = model->m_cacheMetaType->parseGroups(ctx->callData->args[0]); const int cacheIndex = model->m_cache.indexOf(o->item); Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); model->setGroups(it, 1, Compositor::Cache, groupFlags); @@ -3132,19 +3135,22 @@ struct QQmlDelegateModelGroupChange : QV4::Object } static QV4::ReturnedValue method_get_index(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelGroupChange *that = ctx->thisObject.as<QQmlDelegateModelGroupChange>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>()); if (!that) ctx->throwTypeError(); return QV4::Encode(that->change.index); } static QV4::ReturnedValue method_get_count(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelGroupChange *that = ctx->thisObject.as<QQmlDelegateModelGroupChange>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>()); if (!that) ctx->throwTypeError(); return QV4::Encode(that->change.count); } static QV4::ReturnedValue method_get_moveId(QV4::SimpleCallContext *ctx) { - QQmlDelegateModelGroupChange *that = ctx->thisObject.as<QQmlDelegateModelGroupChange>(); + QV4::Scope scope(ctx); + QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>()); if (!that) ctx->throwTypeError(); if (that->change.moveId < 0) diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index a96a8ee71d..c666372739 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -286,9 +286,9 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::Simp { WorkerEngine *engine = (WorkerEngine*)ctx->engine->v8Engine; - int id = ctx->argumentCount > 1 ? ctx->arguments[1].toInt32() : 0; + int id = ctx->callData->argc > 1 ? ctx->callData->args[1].toInt32() : 0; - QByteArray data = QV4::Serialize::serialize(ctx->argumentCount > 2 ? ctx->arguments[2] : QV4::Value::undefinedValue(), engine); + QByteArray data = QV4::Serialize::serialize(ctx->callData->argc > 2 ? ctx->callData->args[2] : QV4::Value::undefinedValue(), engine); QMutexLocker locker(&engine->p->m_lock); WorkerScript *script = engine->p->workers.value(id); |