aboutsummaryrefslogtreecommitdiffstats
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 5d02f7985b..1db3bc3fe8 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -2260,8 +2260,10 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::Value &o, const
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return false;
- QV4::Value args[] = { o };
- function->call(engine->global(), args, 1);
+ CALLDATA(1);
+ d.args[0] = o;
+ d.thisObject = engine->global();
+ function->call(d);
} catch (QV4::Exception &e) {
e.accept(ctx);
return true;
@@ -2283,8 +2285,10 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::Value &o,
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return false;
- QV4::Value args[] = { o };
- QV4::Value value = function->call(engine->global(), args, 1);
+ CALLDATA(1);
+ d.args[0] = o;
+ d.thisObject = engine->global();
+ QV4::Value value = function->call(d);
return __qmljs_strict_equal(value, result);
} catch (QV4::Exception &e) {
e.accept(ctx);
@@ -2305,8 +2309,10 @@ static inline QV4::Value evaluate(QV8Engine *engine, const QV4::Value & o,
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return QV4::Value::emptyValue();
- QV4::Value args[] = { o };
- QV4::Value value = function->call(engine->global(), args, 1);
+ CALLDATA(1);
+ d.args[0] = o;
+ d.thisObject = engine->global();
+ QV4::Value value = function->call(d);
return value;
} catch (QV4::Exception &e) {
e.accept(ctx);