aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-09-19 15:08:49 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-09-20 09:24:43 +0000
commit3d076faeea52ef67daf4d51635d8bb49376de087 (patch)
tree8b94a2e6984c2178e8751f1863232782a314580a /src/qml/jsruntime/qv4context.cpp
parent042aa2eb0e55616fc754d0d71246efb531ca6dfe (diff)
Remove superfluous zero fill on 32bit
Now that we use the same encoding on 32bit as on 64bit, undefined is encoded as 0. So no need to do a separate fill-with-undefined, because the memory manager will already zero-initialize the freshly allocated memory. Change-Id: Ia1e0f5385d86f5ab283dd114e202cc48c2a27f23 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 2598c079b8..9d7cafabc8 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -74,13 +74,8 @@ Heap::CallContext *ExecutionContext::newCallContext(Heap::ExecutionContext *oute
uint nLocals = compiledFunction->nLocals;
c->locals.size = nLocals;
c->locals.alloc = localsAndFormals;
-#if QT_POINTER_SIZE == 8
- // memory allocated from the JS heap is 0 initialized, so skip the std::fill() below
+ // memory allocated from the JS heap is 0 initialized, so check if undefined is 0
Q_ASSERT(Primitive::undefinedValue().asReturnedValue() == 0);
-#else
- if (nLocals)
- std::fill(c->locals.values, c->locals.values + nLocals, Primitive::undefinedValue());
-#endif
::memcpy(c->locals.values + nLocals, &callData->args[0], nFormals * sizeof(Value));
c->nArgs = callData->argc();