From 3f12ee31a4dae822fd8e9d3a6791157d8503c653 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 Sep 2015 12:47:52 +0200 Subject: Add method to convert identifiers back into QV4::String objects Allocating a new String for the Identifier is wasting both memory and CPU. Let's rather extract it from the IdentifierTable. Change-Id: Ibb9b2ac9775fefce74602d6954586195cdd5814e Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4object.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4object.cpp') diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 42cc3c7df4..ee3539c176 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -44,6 +44,7 @@ #include "qv4objectiterator_p.h" #include "qv4identifier_p.h" #include "qv4string_p.h" +#include "qv4identifiertable_p.h" #include @@ -590,7 +591,7 @@ void Object::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint * PropertyAttributes a = o->internalClass()->propertyData[it->memberIndex]; ++it->memberIndex; if (!(it->flags & ObjectIterator::EnumerableOnly) || a.isEnumerable()) { - name->setM(o->engine()->newString(n->string)); + name->setM(o->engine()->identifierTable->stringFromIdentifier(n)); *attrs = a; pd->value = *o->propertyData(idx); if (a.isAccessor()) -- cgit v1.2.3