aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-11-03 15:23:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-09 02:01:17 +0100
commit412eb94de4cae754130ae855236420ebd5c42482 (patch)
tree901af6051691c65a96abe3f69fcd3d5fc57ff80a /src/qml/types
parente367f75d7285d2bcd10cbb35d088c96f33c02aff (diff)
Simplify & speed up function calling
Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp12
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h6
-rw-r--r--src/qml/types/qquickworkerscript.cpp4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index cdd5f8583a..754d008745 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1704,7 +1704,7 @@ int QQmlDelegateModelItemMetaType::parseGroups(const QV4::ValueRef groups) const
return groupFlags;
}
-QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::SimpleCallContext *ctx)
+QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::CallContext *ctx)
{
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>());
@@ -1716,7 +1716,7 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_model(QV4::SimpleCallContext *ctx)
return o->item->get();
}
-QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::SimpleCallContext *ctx)
+QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::CallContext *ctx)
{
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>());
@@ -1732,7 +1732,7 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_groups(QV4::SimpleCallContext *ctx
return ctx->engine->v8Engine->fromVariant(groups);
}
-QV4::ReturnedValue QQmlDelegateModelItem::set_groups(QV4::SimpleCallContext *ctx)
+QV4::ReturnedValue QQmlDelegateModelItem::set_groups(QV4::CallContext *ctx)
{
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->callData->thisObject.as<QQmlDelegateModelItemObject>());
@@ -3147,21 +3147,21 @@ struct QQmlDelegateModelGroupChange : QV4::Object
vtbl = &static_vtbl;
}
- static QV4::ReturnedValue method_get_index(QV4::SimpleCallContext *ctx) {
+ static QV4::ReturnedValue method_get_index(QV4::CallContext *ctx) {
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
return ctx->throwTypeError();
return QV4::Encode(that->change.index);
}
- static QV4::ReturnedValue method_get_count(QV4::SimpleCallContext *ctx) {
+ static QV4::ReturnedValue method_get_count(QV4::CallContext *ctx) {
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
return ctx->throwTypeError();
return QV4::Encode(that->change.count);
}
- static QV4::ReturnedValue method_get_moveId(QV4::SimpleCallContext *ctx) {
+ static QV4::ReturnedValue method_get_moveId(QV4::CallContext *ctx) {
QV4::Scope scope(ctx);
QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, ctx->callData->thisObject.as<QQmlDelegateModelGroupChange>());
if (!that)
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 8205b5350f..066c8e70e5 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -133,9 +133,9 @@ public:
virtual void setValue(const QString &role, const QVariant &value) { Q_UNUSED(role); Q_UNUSED(value); }
virtual bool resolveIndex(const QQmlAdaptorModel &, int) { return false; }
- static QV4::ReturnedValue get_model(QV4::SimpleCallContext *ctx);
- static QV4::ReturnedValue get_groups(QV4::SimpleCallContext *ctx);
- static QV4::ReturnedValue set_groups(QV4::SimpleCallContext *ctx);
+ static QV4::ReturnedValue get_model(QV4::CallContext *ctx);
+ static QV4::ReturnedValue get_groups(QV4::CallContext *ctx);
+ static QV4::ReturnedValue set_groups(QV4::CallContext *ctx);
static QV4::ReturnedValue get_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::ValueRef);
static QV4::ReturnedValue set_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::ValueRef arg);
static QV4::ReturnedValue get_index(QQmlDelegateModelItem *thisItem, uint flag, const QV4::ValueRef arg);
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index cf19bbc56a..7607febe01 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -181,7 +181,7 @@ public:
int m_nextId;
- static QV4::ReturnedValue method_sendMessage(QV4::SimpleCallContext *ctx);
+ static QV4::ReturnedValue method_sendMessage(QV4::CallContext *ctx);
signals:
void stopThread();
@@ -281,7 +281,7 @@ QQuickWorkerScriptEnginePrivate::QQuickWorkerScriptEnginePrivate(QQmlEngine *eng
{
}
-QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::SimpleCallContext *ctx)
+QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::CallContext *ctx)
{
WorkerEngine *engine = (WorkerEngine*)ctx->engine->v8Engine;