diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-29 14:31:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | edee5c3dc0d922ec3b6a44d66193e9a57b8a979e (patch) | |
tree | 5e40caa777c01a7999d736ead63ae239d1eb5b98 /src/qml/compiler/qv4compileddata.cpp | |
parent | 3ad8b0f0e8193bb7b62ffee6b33588ef6b51459c (diff) |
Move prototype pointer into QV4::InternalClass
The prototype is actually the same for most objects. By
moving it into the internal class, we can save 8 bytes
per object, as well as allowing for some future
optimizations.
Also fix a bug in the implementation of the Error
prototype objects.
Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 4c1b05b04e..696531fec3 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -43,6 +43,7 @@ #include "qv4jsir_p.h" #include <private/qv4engine_p.h> #include <private/qv4function_p.h> +#include <private/qv4objectproto_p.h> #include <private/qv4lookup_p.h> #include <private/qv4regexpobject_p.h> #include <private/qv4unwindhelper_p.h> @@ -124,6 +125,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) int memberCount = 0; const CompiledData::JSClassMember *member = data->jsClassAt(i, &memberCount); QV4::InternalClass *klass = engine->emptyClass; + klass = klass->changePrototype(engine->objectPrototype); for (int j = 0; j < memberCount; ++j, ++member) klass = klass->addMember(runtimeStrings[member->nameOffset], member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data); |