aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-08-21 17:31:22 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 17:27:36 +0200
commit6f472680ebecb3a4d700eedcf62cb423b05c4fd1 (patch)
treebc732911a9c353dbac232ebda5a94468e3e261fe /src/imports
parentda2f24d8e5c32fe4ed45dcb89aa357465f85fc1e (diff)
change calling convention for JS function calls
This allows faster pass through of the data if we have nested calls. Also make sure we always reserve at least QV4::Global::ReservedArgumentCount Values on the stack to avoid stack corruption. Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/localstorage/plugin.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 0bee6d1198..6fc7d1db7f 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -341,9 +341,11 @@ static Value qmlsqldatabase_changeVersion(SimpleCallContext *ctx)
ok = false;
db.transaction();
- Value callbackArgs[] = { Value::fromObject(w) };
+ CALLDATA(1);
+ d.thisObject = engine->global();
+ d.args[0] = Value::fromObject(w);
try {
- f->call(engine->global(), callbackArgs, 1);
+ f->call(d);
} catch (Exception &) {
db.rollback();
throw;
@@ -393,9 +395,11 @@ static Value qmlsqldatabase_transaction_shared(SimpleCallContext *ctx, bool read
db.transaction();
if (callback) {
- Value callbackArgs[] = { Value::fromObject(w) };
+ CALLDATA(1);
+ d.thisObject = engine->global();
+ d.args[0] = Value::fromObject(w);
try {
- callback->call(engine->global(), callbackArgs, 1);
+ callback->call(d);
} catch (Exception &) {
w->inTransaction = false;
db.rollback();
@@ -674,8 +678,10 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
db->version = version;
if (created && dbcreationCallback) {
- Value args[] = { Value::fromObject(db) };
- dbcreationCallback->call(engine->global(), args, 1);
+ CALLDATA(1);
+ d.thisObject = engine->global();
+ d.args[0] = Value::fromObject(db);
+ dbcreationCallback->call(d);
}
args->setReturnValue(Value::fromObject(db));