diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-08-27 12:17:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-22 08:19:56 +0000 |
commit | 17a0c271e0ec606d15fc87dab23b2e3750c0e301 (patch) | |
tree | e1c5fb1065e687897388adb7cdbfa4fbbf707af7 /src/qml/jsruntime/qv4stringobject.cpp | |
parent | 833c99db20a6ccbf337d77855098141e008b04ee (diff) |
Move more objects over to the new allocation scheme
Change-Id: I0241efe10d115f8e4a646f840e47e220eb6cfc18
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index 2d90935c2a..757ec6c6bf 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -67,25 +67,17 @@ using namespace QV4; DEFINE_OBJECT_VTABLE(StringObject); -Heap::StringObject::StringObject(InternalClass *ic, QV4::Object *prototype) - : Heap::Object(ic, prototype) +Heap::StringObject::StringObject() { Q_ASSERT(vtable() == QV4::StringObject::staticVTable()); - string = ic->engine->newString(); - - Scope scope(ic->engine); - ScopedObject s(scope, this); - s->defineReadonlyProperty(ic->engine->id_length(), Primitive::fromInt32(0)); + string = internalClass->engine->id_empty()->d(); + *propertyData(LengthPropertyIndex) = Primitive::fromInt32(0); } -Heap::StringObject::StringObject(ExecutionEngine *engine, const QV4::String *str) - : Heap::Object(engine->emptyClass, engine->stringPrototype()) +Heap::StringObject::StringObject(const QV4::String *str) { string = str->d(); - - Scope scope(engine); - ScopedObject s(scope, this); - s->defineReadonlyProperty(engine->id_length(), Primitive::fromUInt32(length())); + *propertyData(LengthPropertyIndex) = Primitive::fromInt32(length()); } Heap::String *Heap::StringObject::getIndex(uint index) const |