From 6f472680ebecb3a4d700eedcf62cb423b05c4fd1 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 21 Aug 2013 17:31:22 +0200 Subject: 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 --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3