aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-27 22:32:38 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-22 08:20:01 +0000
commitd7e535e99babae46d01311059f5ef6080dc90751 (patch)
treea526cf8c87c4838554fd7768bfca106e585b61ac /src/qml/jsruntime/qv4engine.cpp
parent9420eb5c4e55d68b996bb0120db1f2dfeeef3a8c (diff)
Convert variant object and ObjectProto
Change-Id: I5ee3b453b74f5832997aca68d04979302f9afac5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index d881474bbc..19a4467ca8 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -298,7 +298,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
jsStrings[String_buffer] = newIdentifier(QStringLiteral("buffer"));
jsStrings[String_lastIndex] = newIdentifier(QStringLiteral("lastIndex"));
- jsObjects[ObjectProto] = memoryManager->alloc<ObjectPrototype>(emptyClass, (QV4::Object *)0);
+ jsObjects[ObjectProto] = memoryManager->allocObject<ObjectPrototype>(emptyClass);
arrayClass = emptyClass->addMember(id_length(), Attr_NotConfigurable|Attr_NotEnumerable);
jsObjects[ArrayProto] = memoryManager->allocObject<ArrayPrototype>(arrayClass, objectPrototype());
@@ -359,10 +359,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
jsObjects[TypeErrorProto] = memoryManager->alloc<TypeErrorPrototype>(emptyClass, errorPrototype());
jsObjects[URIErrorProto] = memoryManager->alloc<URIErrorPrototype>(emptyClass, errorPrototype());
- jsObjects[VariantProto] = memoryManager->alloc<VariantPrototype>(emptyClass, objectPrototype());
+ jsObjects[VariantProto] = memoryManager->allocObject<VariantPrototype>(emptyClass, objectPrototype());
Q_ASSERT(variantPrototype()->prototype() == objectPrototype()->d());
- jsObjects[SequenceProto] = ScopedValue(scope, memoryManager->alloc<SequencePrototype>(arrayClass, arrayPrototype()));
+ jsObjects[SequenceProto] = ScopedValue(scope, memoryManager->allocObject<SequencePrototype>(arrayClass, arrayPrototype()));
ExecutionContext *global = rootContext();
jsObjects[Object_Ctor] = memoryManager->alloc<ObjectCtor>(global);
@@ -723,9 +723,7 @@ Heap::Object *ExecutionEngine::newURIErrorObject(const Value &message)
Heap::Object *ExecutionEngine::newVariantObject(const QVariant &v)
{
- Scope scope(this);
- ScopedObject o(scope, memoryManager->alloc<VariantObject>(this, v));
- return o->d();
+ return memoryManager->allocObject<VariantObject>(emptyClass, variantPrototype(), v);
}
Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)