aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-01 21:22:57 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 17:27:36 +0200
commit6359ab63cd9c730a168e8b8da4c275e2d03d25d5 (patch)
tree78e12031a279fe3c0ea07440ec48f908ec93322c /src/qml/jsruntime/qv4engine.cpp
parent036d1bcde9096ff71bf042caa14996aa71fae331 (diff)
Optimize ScriptFunction::construct() and creation of FunctionObjects
Change-Id: I7df04171a26cbe659e85f14878cc4e51030e8a5a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index e6a4932c2d..af87ee2a45 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -163,6 +163,11 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory)
FunctionPrototype *functionPrototype = new (memoryManager) FunctionPrototype(objectClass);
functionClass = emptyClass->changePrototype(functionPrototype);
+ uint index;
+ functionWithProtoClass = functionClass->addMember(id_prototype, Attr_NotEnumerable|Attr_NotConfigurable, &index);
+ Q_ASSERT(index == FunctionObject::Index_Prototype);
+ protoClass = objectClass->addMember(id_constructor, Attr_NotEnumerable, &index);
+ Q_ASSERT(index == FunctionObject::Index_ProtoConstructor);
RegExpPrototype *regExpPrototype = new (memoryManager) RegExpPrototype(objectClass);
regExpClass = emptyClass->changePrototype(regExpPrototype);