diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-13 22:34:05 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-18 10:05:51 +0000 |
commit | af5adb9e32713edb7196f761bcabd19f35722c57 (patch) | |
tree | f5c1f9d4e70c6bc9f9c7bb77d2d7be60797b668a /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 456632225f3173d401c68e301fb6d38f6c42e493 (diff) |
Cleanup argument handling in contexts
Fix the compiler to already deal with duplicated argument names.
Doing this at runtime was not ideal.
Remove the callData member from the context. Instead use the fact that
the arguments already followed the locals in the context. Don't copy the
thisObject over into the CallContext anymore, it's never used from there
anyway.
Fix the ordering of names in the internalclass, so that arguments don't
require special handling anymore when looking them up by name.
Adjust all places that used callData, and related methods.
Change-Id: I0bc45e1be3f1fcd38dc3b4f04e91edaf7b9ed103
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 27810dc836..a47ea43965 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -290,8 +290,8 @@ ReturnedValue FunctionPrototype::method_apply(const BuiltinFunction *b, CallData if (len) { if (ArgumentsObject::isNonStrictArgumentsObject(arr) && !arr->cast<ArgumentsObject>()->fullyCreated()) { QV4::ArgumentsObject *a = arr->cast<ArgumentsObject>(); - int l = qMin(len, (uint)a->d()->context->callData->argc); - memcpy(cData->args, a->d()->context->callData->args, l*sizeof(Value)); + int l = qMin(len, (uint)a->d()->context->argc()); + memcpy(cData->args, a->d()->context->args(), l*sizeof(Value)); for (quint32 i = l; i < len; ++i) cData->args[i] = Primitive::undefinedValue(); } else if (arr->arrayType() == Heap::ArrayData::Simple && !arr->protoHasArray()) { |