aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-19 09:58:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit383fa29f95a595be4d6f4da113dff3b0dca79343 (patch)
treec0158b37c56df5daa9be9d7222cce229d8afaa96 /src
parent332b870bd8f0fba6f09e539376a674d7a4413631 (diff)
Convert the remaining vtable methods to be GC safe
Change-Id: I679d1833609c41d71e8436ec0ba8a4624f0c4dd0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsapi/qjsvalue.cpp7
-rw-r--r--src/qml/jsruntime/qv4context.cpp9
-rw-r--r--src/qml/jsruntime/qv4context_p.h2
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp16
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4managed.cpp17
-rw-r--r--src/qml/jsruntime/qv4managed_p.h18
-rw-r--r--src/qml/jsruntime/qv4object.cpp10
-rw-r--r--src/qml/jsruntime/qv4object_p.h6
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h2
-rw-r--r--src/qml/jsruntime/qv4regexp.cpp4
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h4
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp12
-rw-r--r--src/qml/jsruntime/qv4string.cpp4
-rw-r--r--src/qml/jsruntime/qv4string_p.h4
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp2
-rw-r--r--src/qml/qml/qqmltypewrapper_p.h2
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp6
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper_p.h2
21 files changed, 74 insertions, 61 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index eb4d43c6c8..56a01a584d 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -957,12 +957,13 @@ void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value)
*/
bool QJSValue::deleteProperty(const QString &name)
{
- Object *o = d->value.asObject();
+ ExecutionEngine *engine = d->engine;
+ Scope scope(engine);
+ ScopedObject o(scope, d->value.asObject());
if (!o)
return false;
- ExecutionEngine *engine = d->engine;
- String *s = engine->newString(name);
+ ScopedString s(scope, engine->newString(name));
return o->deleteProperty(s);
}
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 73a059c4e8..baa4ade837 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -286,16 +286,15 @@ void CallContext::initQmlContext(ExecutionContext *parentContext, Object *qml, F
}
-bool ExecutionContext::deleteProperty(String *name)
+bool ExecutionContext::deleteProperty(const StringRef name)
{
Scope scope(this);
- ScopedString n(scope, name);
bool hasWith = false;
for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer) {
if (ctx->type == Type_WithContext) {
hasWith = true;
WithContext *w = static_cast<WithContext *>(ctx);
- if (w->withObject->__hasProperty__(n))
+ if (w->withObject->__hasProperty__(name))
return w->withObject->deleteProperty(name);
} else if (ctx->type == Type_CatchContext) {
CatchContext *c = static_cast<CatchContext *>(ctx);
@@ -312,11 +311,11 @@ bool ExecutionContext::deleteProperty(String *name)
if (f->formalParameterList[i]->isEqualTo(name))
return false;
}
- if (c->activation && c->activation->__hasProperty__(n))
+ if (c->activation && c->activation->__hasProperty__(name))
return c->activation->deleteProperty(name);
} else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
- if (g->global->__hasProperty__(n))
+ if (g->global->__hasProperty__(name))
return g->global->deleteProperty(name);
}
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 3e230f97c2..d4d9216dbd 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -146,7 +146,7 @@ struct Q_QML_EXPORT ExecutionContext
ReturnedValue getProperty(String *name);
ReturnedValue getPropertyNoThrow(String *name);
ReturnedValue getPropertyAndBase(String *name, Object **base);
- bool deleteProperty(String *name);
+ bool deleteProperty(const StringRef name);
void mark();
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 59d6fdb40a..69c749f92f 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -130,20 +130,18 @@ ReturnedValue FunctionObject::newInstance()
return construct(callData);
}
-bool FunctionObject::hasInstance(Managed *that, const Value &value)
+bool FunctionObject::hasInstance(Managed *that, const ValueRef value)
{
- FunctionObject *f = static_cast<FunctionObject *>(that);
+ Scope scope(that->engine());
+ ScopedFunctionObject f(scope, static_cast<FunctionObject *>(that));
- Object *v = value.asObject();
+ ScopedObject v(scope, value);
if (!v)
return false;
- ExecutionContext *ctx = f->engine()->current;
- QV4::Scope scope(ctx);
-
- Scoped<Object> o(scope, f->get(ctx->engine->id_prototype));
+ Scoped<Object> o(scope, f->get(scope.engine->id_prototype));
if (!o)
- ctx->throwTypeError();
+ scope.engine->current->throwTypeError();
while (v) {
v = v->prototype();
@@ -677,7 +675,7 @@ ReturnedValue BoundFunction::construct(Managed *that, CallData *dd)
return f->target->construct(callData);
}
-bool BoundFunction::hasInstance(Managed *that, const Value &value)
+bool BoundFunction::hasInstance(Managed *that, const ValueRef value)
{
BoundFunction *f = static_cast<BoundFunction *>(that);
return FunctionObject::hasInstance(f->target, value);
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index 141bf22a49..dfd160dbc0 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -137,7 +137,7 @@ protected:
FunctionObject(InternalClass *ic);
static void markObjects(Managed *that);
- static bool hasInstance(Managed *that, const Value &value);
+ static bool hasInstance(Managed *that, const ValueRef value);
static void destroy(Managed *that)
{ static_cast<FunctionObject*>(that)->~FunctionObject(); }
};
@@ -234,7 +234,7 @@ struct BoundFunction: FunctionObject {
static void destroy(Managed *);
static void markObjects(Managed *that);
- static bool hasInstance(Managed *that, const Value &value);
+ static bool hasInstance(Managed *that, const ValueRef value);
};
}
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp
index 7b0d4058a2..f5715d51ec 100644
--- a/src/qml/jsruntime/qv4managed.cpp
+++ b/src/qml/jsruntime/qv4managed.cpp
@@ -171,7 +171,7 @@ QString Managed::className() const
return QString::fromLatin1(s);
}
-bool Managed::hasInstance(Managed *m, const Value &)
+bool Managed::hasInstance(Managed *m, const ValueRef)
{
m->engine()->current->throwTypeError();
}
@@ -202,6 +202,11 @@ bool Managed::isEqualTo(Managed *, Managed *)
return false;
}
+bool Managed::hasInstance(const ValueRef v)
+{
+ return vtbl->hasInstance(this, v);
+}
+
ReturnedValue Managed::get(const StringRef name, bool *hasProperty)
{
return vtbl->get(this, name, hasProperty);
@@ -226,3 +231,13 @@ void Managed::putIndexed(uint index, const ValueRef value)
{
vtbl->putIndexed(this, index, value);
}
+
+PropertyAttributes Managed::query(StringRef name) const
+{
+ return vtbl->query(this, name);
+}
+
+bool Managed::deleteProperty(const StringRef name)
+{
+ return vtbl->deleteProperty(this, name);
+}
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index c91b9453da..c369353422 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -96,14 +96,14 @@ struct ManagedVTable
void (*markObjects)(Managed *);
void (*destroy)(Managed *);
void (*collectDeletables)(Managed *, GCDeletable **deletable);
- bool (*hasInstance)(Managed *, const Value &value);
+ bool (*hasInstance)(Managed *, const ValueRef value);
ReturnedValue (*get)(Managed *, const StringRef name, bool *hasProperty);
ReturnedValue (*getIndexed)(Managed *, uint index, bool *hasProperty);
void (*put)(Managed *, const StringRef name, const ValueRef value);
void (*putIndexed)(Managed *, uint index, const ValueRef value);
- PropertyAttributes (*query)(const Managed *, String *name);
+ PropertyAttributes (*query)(const Managed *, StringRef name);
PropertyAttributes (*queryIndexed)(const Managed *, uint index);
- bool (*deleteProperty)(Managed *m, String *name);
+ bool (*deleteProperty)(Managed *m, const StringRef name);
bool (*deleteIndexedProperty)(Managed *m, uint index);
ReturnedValue (*getLookup)(Managed *m, Lookup *l);
void (*setLookup)(Managed *m, Lookup *l, const ValueRef v);
@@ -258,22 +258,18 @@ public:
*reinterpret_cast<Managed **>(this) = m;
}
- inline bool hasInstance(const Value &v) {
- return vtbl->hasInstance(this, v);
- }
+ bool hasInstance(const ValueRef v);
ReturnedValue construct(CallData *d);
ReturnedValue call(CallData *d);
ReturnedValue get(const StringRef name, bool *hasProperty = 0);
ReturnedValue getIndexed(uint index, bool *hasProperty = 0);
void put(const StringRef name, const ValueRef value);
void putIndexed(uint index, const ValueRef value);
- PropertyAttributes query(String *name) const
- { return vtbl->query(this, name); }
+ PropertyAttributes query(StringRef name) const;
PropertyAttributes queryIndexed(uint index) const
{ return vtbl->queryIndexed(this, index); }
- bool deleteProperty(String *name)
- { return vtbl->deleteProperty(this, name); }
+ bool deleteProperty(const StringRef name);
bool deleteIndexedProperty(uint index)
{ return vtbl->deleteIndexedProperty(this, index); }
ReturnedValue getLookup(Lookup *l)
@@ -286,7 +282,7 @@ public:
{ return vtbl->advanceIterator(this, it, name, index, attributes); }
static void destroy(Managed *that) { that->_data = 0; }
- static bool hasInstance(Managed *that, const Value &value);
+ static bool hasInstance(Managed *that, const ValueRef value);
static ReturnedValue construct(Managed *m, CallData *d);
static ReturnedValue call(Managed *m, CallData *);
static ReturnedValue getLookup(Managed *m, Lookup *);
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 2a36371bdd..1e45334e3a 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -434,7 +434,7 @@ bool Object::__hasProperty__(const StringRef name) const
const Object *o = this;
while (o) {
- if (!o->query(name.getPointer()).isEmpty())
+ if (!o->query(name).isEmpty())
return true;
o = o->prototype();
}
@@ -477,14 +477,14 @@ void Object::putIndexed(Managed *m, uint index, const ValueRef value)
static_cast<Object *>(m)->internalPutIndexed(index, value);
}
-PropertyAttributes Object::query(const Managed *m, String *name)
+PropertyAttributes Object::query(const Managed *m, StringRef name)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
return queryIndexed(m, idx);
const Object *o = static_cast<const Object *>(m);
- idx = o->internalClass->find(name);
+ idx = o->internalClass->find(name.getPointer());
if (idx < UINT_MAX)
return o->internalClass->propertyData[idx];
@@ -508,7 +508,7 @@ PropertyAttributes Object::queryIndexed(const Managed *m, uint index)
return Attr_Invalid;
}
-bool Object::deleteProperty(Managed *m, String *name)
+bool Object::deleteProperty(Managed *m, const StringRef name)
{
return static_cast<Object *>(m)->internalDeleteProperty(name);
}
@@ -874,7 +874,7 @@ void Object::internalPutIndexed(uint index, const ValueRef value)
}
// Section 8.12.7
-bool Object::internalDeleteProperty(String *name)
+bool Object::internalDeleteProperty(const StringRef name)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 99fbd8c94c..22cf9206b6 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -314,9 +314,9 @@ protected:
static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
static void putIndexed(Managed *m, uint index, const ValueRef value);
- static PropertyAttributes query(const Managed *m, String *name);
+ static PropertyAttributes query(const Managed *m, StringRef name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
- static bool deleteProperty(Managed *m, String *name);
+ static bool deleteProperty(Managed *m, const StringRef name);
static bool deleteIndexedProperty(Managed *m, uint index);
static ReturnedValue getLookup(Managed *m, Lookup *l);
static void setLookup(Managed *m, Lookup *l, const ValueRef v);
@@ -328,7 +328,7 @@ private:
ReturnedValue internalGetIndexed(uint index, bool *hasProperty);
void internalPut(const StringRef name, const ValueRef value);
void internalPutIndexed(uint index, const ValueRef value);
- bool internalDeleteProperty(String *name);
+ bool internalDeleteProperty(const StringRef name);
bool internalDeleteIndexedProperty(uint index);
friend struct ObjectIterator;
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index f7085e30b1..cc3ff6d730 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -420,7 +420,7 @@ ReturnedValue ObjectPrototype::method_hasOwnProperty(SimpleCallContext *ctx)
Scoped<Object> O(scope, ctx->thisObject, Scoped<Object>::Convert);
bool r = O->__getOwnProperty__(P) != 0;
if (!r)
- r = !O->query(P.getPointer()).isEmpty();
+ r = !O->query(P).isEmpty();
return Encode(r);
}
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 226de86a38..e982989a4d 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -621,7 +621,7 @@ void QObjectWrapper::put(Managed *m, const StringRef name, const ValueRef value)
}
}
-PropertyAttributes QObjectWrapper::query(const Managed *m, String *name)
+PropertyAttributes QObjectWrapper::query(const Managed *m, StringRef name)
{
const QObjectWrapper *that = static_cast<const QObjectWrapper*>(m);
ExecutionEngine *engine = that->engine();
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index e8c2d91da6..2fc0767bc8 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -107,7 +107,7 @@ private:
static ReturnedValue get(Managed *m, const StringRef name, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
- static PropertyAttributes query(const Managed *, String *name);
+ static PropertyAttributes query(const Managed *, StringRef name);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
static void markObjects(Managed *that);
static void collectDeletables(Managed *m, GCDeletable **deletable);
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp
index ac7b122c4d..9534162ecd 100644
--- a/src/qml/jsruntime/qv4regexp.cpp
+++ b/src/qml/jsruntime/qv4regexp.cpp
@@ -154,7 +154,7 @@ void RegExp::putIndexed(Managed *m, uint index, const ValueRef value)
{
}
-PropertyAttributes RegExp::query(const Managed *m, String *name)
+PropertyAttributes RegExp::query(const Managed *m, StringRef name)
{
return Attr_Invalid;
}
@@ -164,7 +164,7 @@ PropertyAttributes RegExp::queryIndexed(const Managed *m, uint index)
return Attr_Invalid;
}
-bool RegExp::deleteProperty(Managed *, String *)
+bool RegExp::deleteProperty(Managed *, const StringRef)
{
return false;
}
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h
index cbc60d9140..8aa173ca38 100644
--- a/src/qml/jsruntime/qv4regexp_p.h
+++ b/src/qml/jsruntime/qv4regexp_p.h
@@ -115,9 +115,9 @@ protected:
static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
static void putIndexed(Managed *m, uint index, const ValueRef value);
- static PropertyAttributes query(const Managed *m, String *name);
+ static PropertyAttributes query(const Managed *m, StringRef name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
- static bool deleteProperty(Managed *, String *);
+ static bool deleteProperty(Managed *, const StringRef);
static bool deleteIndexedProperty(Managed *m, uint index);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 63050c7c34..5d899096cf 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -263,13 +263,17 @@ ReturnedValue __qmljs_delete_subscript(ExecutionContext *ctx, const ValueRef bas
ReturnedValue __qmljs_delete_member(ExecutionContext *ctx, const ValueRef base, String *name)
{
- Object *obj = base->toObject(ctx);
- return Value::fromBoolean(obj->deleteProperty(name)).asReturnedValue();
+ Scope scope(ctx);
+ ScopedObject obj(scope, base->toObject(ctx));
+ ScopedString n(scope, name);
+ return Encode(obj->deleteProperty(n));
}
ReturnedValue __qmljs_delete_name(ExecutionContext *ctx, String *name)
{
- return Value::fromBoolean(ctx->deleteProperty(name)).asReturnedValue();
+ Scope scope(ctx);
+ ScopedString n(scope, name);
+ return Encode(ctx->deleteProperty(n));
}
QV4::ReturnedValue __qmljs_add_helper(ExecutionContext *ctx, const ValueRef left, const ValueRef right)
@@ -296,7 +300,7 @@ QV4::ReturnedValue __qmljs_instanceof(ExecutionContext *ctx, const ValueRef left
if (!o)
ctx->throwTypeError();
- bool r = o->hasInstance(*left);
+ bool r = o->hasInstance(left);
return Value::fromBoolean(r).asReturnedValue();
}
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index cff0d7a14f..7995e37a6f 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -189,7 +189,7 @@ void String::putIndexed(Managed *m, uint index, const ValueRef value)
o->putIndexed(index, value);
}
-PropertyAttributes String::query(const Managed *m, String *name)
+PropertyAttributes String::query(const Managed *m, StringRef name)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
@@ -203,7 +203,7 @@ PropertyAttributes String::queryIndexed(const Managed *m, uint index)
return (index < that->_text.length()) ? Attr_NotConfigurable|Attr_NotWritable : Attr_Invalid;
}
-bool String::deleteProperty(Managed *, String *)
+bool String::deleteProperty(Managed *, const StringRef)
{
return false;
}
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 5cfe0c4d25..b194003005 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -131,9 +131,9 @@ protected:
static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
static void putIndexed(Managed *m, uint index, const ValueRef value);
- static PropertyAttributes query(const Managed *m, String *name);
+ static PropertyAttributes query(const Managed *m, StringRef name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
- static bool deleteProperty(Managed *, String *);
+ static bool deleteProperty(Managed *, const StringRef);
static bool deleteIndexedProperty(Managed *m, uint index);
static bool isEqualTo(Managed *that, Managed *o);
};
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 2b27f48d6e..d5c0ed058c 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -260,7 +260,7 @@ void QmlTypeWrapper::put(Managed *m, const StringRef name, const ValueRef value)
}
}
-PropertyAttributes QmlTypeWrapper::query(const Managed *m, String *name)
+PropertyAttributes QmlTypeWrapper::query(const Managed *m, StringRef name)
{
// ### Implement more efficiently.
Scope scope(m->engine());
diff --git a/src/qml/qml/qqmltypewrapper_p.h b/src/qml/qml/qqmltypewrapper_p.h
index 6c762a2d19..9078c184c6 100644
--- a/src/qml/qml/qqmltypewrapper_p.h
+++ b/src/qml/qml/qqmltypewrapper_p.h
@@ -84,7 +84,7 @@ public:
static ReturnedValue get(Managed *m, const StringRef name, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
- static PropertyAttributes query(const Managed *, String *name);
+ static PropertyAttributes query(const Managed *, StringRef name);
static void destroy(Managed *that);
private:
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index e38bc191dd..b27d99793f 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -202,7 +202,7 @@ bool QmlValueTypeWrapper::isEqualTo(Managed *m, Managed *other)
return false;
}
-PropertyAttributes QmlValueTypeWrapper::query(const Managed *m, String *name)
+PropertyAttributes QmlValueTypeWrapper::query(const Managed *m, StringRef name)
{
const QmlValueTypeWrapper *r = m->as<const QmlValueTypeWrapper>();
QV4::ExecutionEngine *v4 = m->engine();
@@ -214,9 +214,9 @@ PropertyAttributes QmlValueTypeWrapper::query(const Managed *m, String *name)
{
QQmlData *ddata = QQmlData::get(r->type, false);
if (ddata && ddata->propertyCache)
- result = ddata->propertyCache->property(name, 0, 0);
+ result = ddata->propertyCache->property(name.getPointer(), 0, 0);
else
- result = QQmlPropertyCache::property(r->v8->engine(), r->type, name, 0, local);
+ result = QQmlPropertyCache::property(r->v8->engine(), r->type, name.getPointer(), 0, local);
}
return result ? Attr_Data : Attr_Invalid;
}
diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h
index 1ff04f6104..f2effc362b 100644
--- a/src/qml/qml/qqmlvaluetypewrapper_p.h
+++ b/src/qml/qml/qqmlvaluetypewrapper_p.h
@@ -87,7 +87,7 @@ public:
static void put(Managed *m, const StringRef name, const ValueRef value);
static void destroy(Managed *that);
static bool isEqualTo(Managed *m, Managed *other);
- static PropertyAttributes query(const Managed *, String *name);
+ static PropertyAttributes query(const Managed *, StringRef name);
static QV4::ReturnedValue method_toString(SimpleCallContext *ctx);