diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-09-09 15:37:57 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-10-06 11:44:08 +0000 |
commit | 3b14e2ffdd8eb4b7f7f4508768b75f2acc399370 (patch) | |
tree | 7943f293bf2d0d376d5dc620448bab1a2b58027d /src/qml/jsruntime/qv4argumentsobject_p.h | |
parent | 1b90dc4482d001512f09a5785d4cbd8030879d82 (diff) |
QML: Make Heap::Object and all subclasses trivial
GCC6 might dead-store-eliminate out our secret write to Base::mmdata,
because it expects all memory content to be "undefined" before
constructor calls. Clang might take the same approach if the constructor
of Heap::Object is removed.
By making these structs trivial, it also makes them memcpy-able.
Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4argumentsobject_p.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h index 6ccfd89fd4..37a8d0a94a 100644 --- a/src/qml/jsruntime/qv4argumentsobject_p.h +++ b/src/qml/jsruntime/qv4argumentsobject_p.h @@ -60,12 +60,12 @@ namespace QV4 { namespace Heap { struct ArgumentsGetterFunction : FunctionObject { - inline ArgumentsGetterFunction(QV4::ExecutionContext *scope, uint index); + inline void init(QV4::ExecutionContext *scope, uint index); uint index; }; struct ArgumentsSetterFunction : FunctionObject { - inline ArgumentsSetterFunction(QV4::ExecutionContext *scope, uint index); + inline void init(QV4::ExecutionContext *scope, uint index); uint index; }; @@ -75,7 +75,7 @@ struct ArgumentsObject : Object { CalleePropertyIndex = 1, CallerPropertyIndex = 3 }; - ArgumentsObject(QV4::CallContext *context); + void init(QV4::CallContext *context); Pointer<CallContext> context; bool fullyCreated; Pointer<MemberData> mappedArguments; @@ -91,11 +91,11 @@ struct ArgumentsGetterFunction: FunctionObject static void call(const Managed *that, Scope &scope, CallData *d); }; -inline -Heap::ArgumentsGetterFunction::ArgumentsGetterFunction(QV4::ExecutionContext *scope, uint index) - : Heap::FunctionObject(scope) - , index(index) +inline void +Heap::ArgumentsGetterFunction::init(QV4::ExecutionContext *scope, uint index) { + Heap::FunctionObject::init(scope); + this->index = index; } struct ArgumentsSetterFunction: FunctionObject @@ -106,11 +106,11 @@ struct ArgumentsSetterFunction: FunctionObject static void call(const Managed *that, Scope &scope, CallData *callData); }; -inline -Heap::ArgumentsSetterFunction::ArgumentsSetterFunction(QV4::ExecutionContext *scope, uint index) - : Heap::FunctionObject(scope) - , index(index) +inline void +Heap::ArgumentsSetterFunction::init(QV4::ExecutionContext *scope, uint index) { + Heap::FunctionObject::init(scope); + this->index = index; } |