From 957de0c8fb109ad6938d7a8673164cc94f346ecc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 19 Oct 2017 15:21:08 +0200 Subject: Refactor Call/Construct instructions Give them a pointer to argc and argv instead of a pointer to a full callData. Like this we can construct the callData at the end of the JS stack and avoid the need to create an additional copy in VME::exec(). This also opens up the option of completely avoiding all copies for calls into runtime methods. Also make sure that the calldata we pass into other functions is always at the top of the JS stack. Change-Id: I3d0eb49f7bfd7adb9ddabb213422087c66e5a520 Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4runtime.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4runtime.cpp') diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 97b0c5259f..7bc2315610 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -426,10 +426,11 @@ ReturnedValue RuntimeHelpers::objectDefaultValue(const Object *object, int typeH qSwap(meth1, meth2); Scope scope(engine); + ScopedValue conv(scope, object->get(meth1)); + JSCall jsCall(scope, nullptr, 0); jsCall->thisObject = *object; - ScopedValue conv(scope, object->get(meth1)); if (FunctionObject *o = conv->as()) { jsCall->function = o; jsCall->accumulator = jsCall.call(); -- cgit v1.2.3