aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-19 12:05:18 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit713ae5106ff04d15c5854e901681d7f3386b9604 (patch)
tree938279556853d5a709920805da2c0580296d294b /src/qml/jsruntime
parent62cf5b1b6d7dab9517dc1df2b0d1790682ed58cf (diff)
Change the runtime API over to using StringRef's instead of String*
Change-Id: I0ea95e6cca995dc5f98871f0369204af18e48111 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4context.cpp61
-rw-r--r--src/qml/jsruntime/qv4context_p.h12
-rw-r--r--src/qml/jsruntime/qv4function.cpp2
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp136
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h80
-rw-r--r--src/qml/jsruntime/qv4script.cpp2
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp2
8 files changed, 139 insertions, 158 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index baa4ade837..8d07c5220a 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -172,10 +172,9 @@ CallContext *ExecutionContext::newQmlContext(FunctionObject *f, Object *qml)
-void ExecutionContext::createMutableBinding(String *name, bool deletable)
+void ExecutionContext::createMutableBinding(const StringRef name, bool deletable)
{
Scope scope(this);
- ScopedString n(scope, name);
// find the right context to create the binding on
Object *activation = engine->globalObject;
@@ -191,12 +190,12 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable)
ctx = ctx->outer;
}
- if (activation->__hasProperty__(n))
+ if (activation->__hasProperty__(name))
return;
Property desc = Property::fromValue(Value::undefinedValue());
PropertyAttributes attrs(Attr_Data);
attrs.setConfigurable(deletable);
- activation->__defineOwnProperty__(this, n, desc, attrs);
+ activation->__defineOwnProperty__(this, name, desc, attrs);
}
String * const *ExecutionContext::formals() const
@@ -366,15 +365,14 @@ void ExecutionContext::mark()
}
}
-void ExecutionContext::setProperty(String *name, const ValueRef value)
+void ExecutionContext::setProperty(const StringRef name, const ValueRef value)
{
Scope scope(this);
- ScopedString n(scope, name);
for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer) {
if (ctx->type == Type_WithContext) {
Object *w = static_cast<WithContext *>(ctx)->withObject;
- if (w->__hasProperty__(n)) {
- w->put(n, value);
+ if (w->__hasProperty__(name)) {
+ w->put(name, value);
return;
}
} else if (ctx->type == Type_CatchContext && static_cast<CatchContext *>(ctx)->exceptionVarName->isEqualTo(name)) {
@@ -399,25 +397,24 @@ void ExecutionContext::setProperty(String *name, const ValueRef value)
activation = static_cast<GlobalContext *>(ctx)->global;
}
- if (activation && (ctx->type == Type_QmlContext || activation->__hasProperty__(n))) {
- activation->put(n, value);
+ if (activation && (ctx->type == Type_QmlContext || activation->__hasProperty__(name))) {
+ activation->put(name, value);
return;
}
}
}
if (strictMode || name->isEqualTo(engine->id_this)) {
- Scoped<String> n(scope, name);
+ ScopedValue n(scope, name.asReturnedValue());
throwReferenceError(n);
}
- engine->globalObject->put(n, value);
+ engine->globalObject->put(name, value);
}
-ReturnedValue ExecutionContext::getProperty(String *name)
+ReturnedValue ExecutionContext::getProperty(const StringRef name)
{
Scope scope(this);
ScopedValue v(scope);
- ScopedString n(scope, name);
- n->makeIdentifier();
+ name->makeIdentifier();
if (name->isEqualTo(engine->id_this))
return thisObject.asReturnedValue();
@@ -429,7 +426,7 @@ ReturnedValue ExecutionContext::getProperty(String *name)
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- v = w->get(n, &hasProperty);
+ v = w->get(name, &hasProperty);
if (hasProperty) {
return v.asReturnedValue();
}
@@ -456,7 +453,7 @@ ReturnedValue ExecutionContext::getProperty(String *name)
}
if (c->activation) {
bool hasProperty = false;
- v = c->activation->get(n, &hasProperty);
+ v = c->activation->get(name, &hasProperty);
if (hasProperty)
return v.asReturnedValue();
}
@@ -468,23 +465,23 @@ ReturnedValue ExecutionContext::getProperty(String *name)
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- v = g->global->get(n, &hasProperty);
+ v = g->global->get(name, &hasProperty);
if (hasProperty)
return v.asReturnedValue();
}
}
+ ScopedValue n(scope, name.asReturnedValue());
throwReferenceError(n);
return 0;
}
-ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
+ReturnedValue ExecutionContext::getPropertyNoThrow(const StringRef name)
{
Scope scope(this);
ScopedValue v(scope);
- ScopedString n(scope, name);
- n->makeIdentifier();
+ name->makeIdentifier();
- if (n->isEqualTo(engine->id_this))
+ if (name->isEqualTo(engine->id_this))
return thisObject.asReturnedValue();
bool hasWith = false;
@@ -494,7 +491,7 @@ ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- v = w->get(n, &hasProperty);
+ v = w->get(name, &hasProperty);
if (hasProperty) {
return v.asReturnedValue();
}
@@ -521,7 +518,7 @@ ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
}
if (c->activation) {
bool hasProperty = false;
- v = c->activation->get(n, &hasProperty);
+ v = c->activation->get(name, &hasProperty);
if (hasProperty)
return v.asReturnedValue();
}
@@ -533,7 +530,7 @@ ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- v = g->global->get(n, &hasProperty);
+ v = g->global->get(name, &hasProperty);
if (hasProperty)
return v.asReturnedValue();
}
@@ -541,15 +538,14 @@ ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
return Value::undefinedValue().asReturnedValue();
}
-ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object **base)
+ReturnedValue ExecutionContext::getPropertyAndBase(const StringRef name, Object **base)
{
Scope scope(this);
ScopedValue v(scope);
- ScopedString n(scope, name);
*base = 0;
- n->makeIdentifier();
+ name->makeIdentifier();
- if (n->isEqualTo(engine->id_this))
+ if (name->isEqualTo(engine->id_this))
return thisObject.asReturnedValue();
bool hasWith = false;
@@ -559,7 +555,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object **base)
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- v = w->get(n, &hasProperty);
+ v = w->get(name, &hasProperty);
if (hasProperty) {
*base = w;
return v.asReturnedValue();
@@ -587,7 +583,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object **base)
}
if (c->activation) {
bool hasProperty = false;
- v = c->activation->get(n, &hasProperty);
+ v = c->activation->get(name, &hasProperty);
if (hasProperty) {
if (ctx->type == Type_QmlContext)
*base = c->activation;
@@ -602,11 +598,12 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object **base)
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- v = g->global->get(n, &hasProperty);
+ v = g->global->get(name, &hasProperty);
if (hasProperty)
return v.asReturnedValue();
}
}
+ ScopedValue n(scope, name.asReturnedValue());
throwReferenceError(n);
return 0;
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index d4d9216dbd..f216746212 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -86,7 +86,7 @@ struct Q_QML_EXPORT ExecutionContext
ExecutionContext *parent;
ExecutionContext *outer;
Lookup *lookups;
- String **runtimeStrings;
+ SafeString *runtimeStrings;
CompiledData::CompilationUnit *compilationUnit;
const CompiledData::Function *compiledFunction;
ExecutionContext *next; // used in the GC
@@ -128,7 +128,7 @@ struct Q_QML_EXPORT ExecutionContext
String * const *variables() const;
unsigned int variableCount() const;
- void createMutableBinding(String *name, bool deletable);
+ void createMutableBinding(const StringRef name, bool deletable);
void Q_NORETURN throwError(const QV4::ValueRef value);
void Q_NORETURN throwError(const QString &message);
@@ -142,10 +142,10 @@ struct Q_QML_EXPORT ExecutionContext
void Q_NORETURN throwURIError(Value msg);
void Q_NORETURN throwUnimplemented(const QString &message);
- void setProperty(String *name, const ValueRef value);
- ReturnedValue getProperty(String *name);
- ReturnedValue getPropertyNoThrow(String *name);
- ReturnedValue getPropertyAndBase(String *name, Object **base);
+ void setProperty(const StringRef name, const ValueRef value);
+ ReturnedValue getProperty(const StringRef name);
+ ReturnedValue getPropertyNoThrow(const StringRef name);
+ ReturnedValue getPropertyAndBase(const StringRef name, Object **base);
bool deleteProperty(const StringRef name);
void mark();
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index a7ae365d21..f69a095991 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -60,7 +60,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
, codeData(0)
, codeSize(_codeSize)
{
- name = compilationUnit->runtimeStrings[compiledFunction->nameIndex];
+ name = compilationUnit->runtimeStrings[compiledFunction->nameIndex].asString();
formals.resize(compiledFunction->nFormals);
const quint32 *formalsIndices = compiledFunction->formalsTable();
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index 9ec70f59be..ae91b11991 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -408,7 +408,7 @@ ReturnedValue EvalFunction::evalCall(Value /*thisObject*/, Value *args, int argc
CompiledData::CompilationUnit * const oldCompilationUnit = ctx->compilationUnit;
const CompiledData::Function * const oldCompiledFunction = ctx->compiledFunction;
- String ** const oldRuntimeStrings = ctx->runtimeStrings;
+ SafeString * const oldRuntimeStrings = ctx->runtimeStrings;
ctx->compilationUnit = function->compilationUnit;
ctx->compiledFunction = function->compiledFunction;
ctx->runtimeStrings = function->compilationUnit->runtimeStrings;
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 735c593889..21ada92f32 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -250,30 +250,30 @@ ReturnedValue __qmljs_init_closure(ExecutionContext *ctx, int functionId)
ReturnedValue __qmljs_delete_subscript(ExecutionContext *ctx, const ValueRef base, const ValueRef index)
{
- if (Object *o = base->asObject()) {
+ Scope scope(ctx);
+ ScopedObject o(scope, base);
+ if (o) {
uint n = index->asArrayIndex();
if (n < UINT_MAX) {
return Value::fromBoolean(o->deleteIndexedProperty(n)).asReturnedValue();
}
}
- String *name = index->toString(ctx);
+ ScopedString name(scope, index->toString(ctx));
return __qmljs_delete_member(ctx, base, name);
}
-ReturnedValue __qmljs_delete_member(ExecutionContext *ctx, const ValueRef base, String *name)
+ReturnedValue __qmljs_delete_member(ExecutionContext *ctx, const ValueRef base, const StringRef name)
{
Scope scope(ctx);
ScopedObject obj(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- return Encode(obj->deleteProperty(n));
+ return Encode(obj->deleteProperty(name));
}
-ReturnedValue __qmljs_delete_name(ExecutionContext *ctx, String *name)
+ReturnedValue __qmljs_delete_name(ExecutionContext *ctx, const StringRef name)
{
Scope scope(ctx);
- ScopedString n(scope, name);
- return Encode(ctx->deleteProperty(n));
+ return Encode(ctx->deleteProperty(name));
}
QV4::ReturnedValue __qmljs_add_helper(ExecutionContext *ctx, const ValueRef left, const ValueRef right)
@@ -314,7 +314,7 @@ QV4::ReturnedValue __qmljs_in(ExecutionContext *ctx, const ValueRef left, const
return Value::fromBoolean(r).asReturnedValue();
}
-static void inplaceBitOp(ExecutionContext *ctx, String *name, const ValueRef value, BinOp op)
+static void inplaceBitOp(ExecutionContext *ctx, const StringRef name, const ValueRef value, BinOp op)
{
Scope scope(ctx);
ScopedValue lhs(scope, ctx->getProperty(name));
@@ -323,22 +323,22 @@ static void inplaceBitOp(ExecutionContext *ctx, String *name, const ValueRef val
}
-void __qmljs_inplace_bit_and_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_bit_and_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_bit_and);
}
-void __qmljs_inplace_bit_or_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_bit_or_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_bit_or);
}
-void __qmljs_inplace_bit_xor_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_bit_xor_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_bit_xor);
}
-void __qmljs_inplace_add_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_add_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
Scope scope(ctx);
ScopedValue lhs(scope, ctx->getProperty(name));
@@ -346,37 +346,37 @@ void __qmljs_inplace_add_name(ExecutionContext *ctx, String *name, const ValueRe
ctx->setProperty(name, result);
}
-void __qmljs_inplace_sub_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_sub_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_sub);
}
-void __qmljs_inplace_mul_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_mul_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_mul);
}
-void __qmljs_inplace_div_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_div_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_div);
}
-void __qmljs_inplace_mod_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_mod_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_mod);
}
-void __qmljs_inplace_shl_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_shl_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_shl);
}
-void __qmljs_inplace_shr_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_shr_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_shr);
}
-void __qmljs_inplace_ushr_name(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_inplace_ushr_name(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
inplaceBitOp(ctx, name, value, __qmljs_ushr);
}
@@ -447,92 +447,81 @@ void __qmljs_inplace_ushr_element(ExecutionContext *ctx, const ValueRef base, co
obj->inplaceBinOpValue(ctx, __qmljs_ushr, index, rhs);
}
-void __qmljs_inplace_bit_and_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_bit_and_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_bit_and, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_bit_and, name, rhs);
}
-void __qmljs_inplace_bit_or_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_bit_or_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_bit_or, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_bit_or, name, rhs);
}
-void __qmljs_inplace_bit_xor_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_bit_xor_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_bit_xor, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_bit_xor, name, rhs);
}
-void __qmljs_inplace_add_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_add_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_add, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_add, name, rhs);
}
-void __qmljs_inplace_sub_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_sub_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_sub, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_sub, name, rhs);
}
-void __qmljs_inplace_mul_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_mul_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_mul, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_mul, name, rhs);
}
-void __qmljs_inplace_div_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_div_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_div, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_div, name, rhs);
}
-void __qmljs_inplace_mod_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_mod_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_mod, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_mod, name, rhs);
}
-void __qmljs_inplace_shl_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_shl_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_shl, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_shl, name, rhs);
}
-void __qmljs_inplace_shr_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_shr_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_shr, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_shr, name, rhs);
}
-void __qmljs_inplace_ushr_member(ExecutionContext *ctx, const ValueRef base, String *name, const ValueRef rhs)
+void __qmljs_inplace_ushr_member(ExecutionContext *ctx, const ValueRef base, const StringRef name, const ValueRef rhs)
{
Scope scope(ctx);
ScopedObject o(scope, base->toObject(ctx));
- ScopedString n(scope, name);
- o->inplaceBinOp(ctx, __qmljs_ushr, n, rhs);
+ o->inplaceBinOp(ctx, __qmljs_ushr, name, rhs);
}
double __qmljs_string_to_number(const QString &string)
@@ -669,12 +658,11 @@ Returned<String> *__qmljs_convert_to_string(ExecutionContext *ctx, const ValueRe
} // switch
}
-void __qmljs_set_property(ExecutionContext *ctx, const ValueRef object, String *name, const ValueRef value)
+void __qmljs_set_property(ExecutionContext *ctx, const ValueRef object, const StringRef name, const ValueRef value)
{
Scope scope(ctx);
ScopedObject o(scope, object->toObject(ctx));
- ScopedString n(scope, name);
- o->put(n, value);
+ o->put(name, value);
}
ReturnedValue __qmljs_get_element(ExecutionContext *ctx, const ValueRef object, const ValueRef index)
@@ -782,15 +770,14 @@ ReturnedValue __qmljs_foreach_next_property_name(const ValueRef foreach_iterator
}
-void __qmljs_set_activation_property(ExecutionContext *ctx, String *name, const ValueRef value)
+void __qmljs_set_activation_property(ExecutionContext *ctx, const StringRef name, const ValueRef value)
{
ctx->setProperty(name, value);
}
-ReturnedValue __qmljs_get_property(ExecutionContext *ctx, const ValueRef object, String *n)
+ReturnedValue __qmljs_get_property(ExecutionContext *ctx, const ValueRef object, const StringRef name)
{
Scope scope(ctx);
- ScopedString name(scope, n);
Scoped<Object> o(scope, object);
if (o)
@@ -805,7 +792,7 @@ ReturnedValue __qmljs_get_property(ExecutionContext *ctx, const ValueRef object,
return o->get(name);
}
-ReturnedValue __qmljs_get_activation_property(ExecutionContext *ctx, String *name)
+ReturnedValue __qmljs_get_activation_property(ExecutionContext *ctx, const StringRef name)
{
return ctx->getProperty(name);
}
@@ -970,7 +957,7 @@ ReturnedValue __qmljs_call_global_lookup(ExecutionContext *context, uint index,
}
-ReturnedValue __qmljs_call_activation_property(ExecutionContext *context, String *name, CallDataRef callData)
+ReturnedValue __qmljs_call_activation_property(ExecutionContext *context, const StringRef name, CallDataRef callData)
{
Q_ASSERT(callData->thisObject.isUndefined());
Scope scope(context);
@@ -996,10 +983,9 @@ ReturnedValue __qmljs_call_activation_property(ExecutionContext *context, String
return o->call(callData);
}
-ReturnedValue __qmljs_call_property(ExecutionContext *context, String *n, CallDataRef callData)
+ReturnedValue __qmljs_call_property(ExecutionContext *context, const StringRef name, CallDataRef callData)
{
Scope scope(context);
- ScopedString name(scope, n);
Scoped<Object> baseObject(scope, callData->thisObject);
if (!baseObject) {
Q_ASSERT(!callData->thisObject.isEmpty());
@@ -1071,7 +1057,7 @@ ReturnedValue __qmljs_construct_global_lookup(ExecutionContext *context, uint in
}
-ReturnedValue __qmljs_construct_activation_property(ExecutionContext *context, String *name, CallDataRef callData)
+ReturnedValue __qmljs_construct_activation_property(ExecutionContext *context, const StringRef name, CallDataRef callData)
{
Scope scope(context);
ScopedValue func(scope, context->getProperty(name));
@@ -1091,11 +1077,10 @@ ReturnedValue __qmljs_construct_value(ExecutionContext *context, const ValueRef
return f->construct(callData);
}
-ReturnedValue __qmljs_construct_property(ExecutionContext *context, const ValueRef base, String *n, CallDataRef callData)
+ReturnedValue __qmljs_construct_property(ExecutionContext *context, const ValueRef base, const StringRef name, CallDataRef callData)
{
Scope scope(context);
ScopedObject thisObject(scope, base->toObject(context));
- ScopedString name(scope, n);
Scoped<Object> f(scope, thisObject->get(name));
if (!f)
@@ -1137,18 +1122,17 @@ ReturnedValue __qmljs_builtin_typeof(ExecutionContext *ctx, const ValueRef value
return Value::fromString(res).asReturnedValue();
}
-QV4::ReturnedValue __qmljs_builtin_typeof_name(ExecutionContext *context, String *name)
+QV4::ReturnedValue __qmljs_builtin_typeof_name(ExecutionContext *context, const StringRef name)
{
Scope scope(context);
ScopedValue prop(scope, context->getPropertyNoThrow(name));
return __qmljs_builtin_typeof(context, prop);
}
-QV4::ReturnedValue __qmljs_builtin_typeof_member(ExecutionContext *context, const ValueRef base, String *n)
+QV4::ReturnedValue __qmljs_builtin_typeof_member(ExecutionContext *context, const ValueRef base, const StringRef name)
{
Scope scope(context);
ScopedObject obj(scope, base->toObject(context));
- ScopedString name(scope, n);
ScopedValue prop(scope, obj->get(name));
return __qmljs_builtin_typeof(context, prop);
}
@@ -1168,9 +1152,9 @@ ExecutionContext *__qmljs_builtin_push_with_scope(const ValueRef o, ExecutionCon
return ctx->newWithContext(obj);
}
-ExecutionContext *__qmljs_builtin_push_catch_scope(String *exceptionVarName, const ValueRef exceptionValue, ExecutionContext *ctx)
+ExecutionContext *__qmljs_builtin_push_catch_scope(const StringRef exceptionVarName, const ValueRef exceptionValue, ExecutionContext *ctx)
{
- return ctx->newCatchContext(exceptionVarName, *exceptionValue);
+ return ctx->newCatchContext(exceptionVarName.getPointer(), *exceptionValue);
}
ExecutionContext *__qmljs_builtin_pop_scope(ExecutionContext *ctx)
@@ -1178,19 +1162,19 @@ ExecutionContext *__qmljs_builtin_pop_scope(ExecutionContext *ctx)
return ctx->engine->popContext();
}
-void __qmljs_builtin_declare_var(ExecutionContext *ctx, bool deletable, String *name)
+void __qmljs_builtin_declare_var(ExecutionContext *ctx, bool deletable, const StringRef name)
{
ctx->createMutableBinding(name, deletable);
}
-void __qmljs_builtin_define_property(ExecutionContext *ctx, const ValueRef object, String *name, ValueRef val)
+void __qmljs_builtin_define_property(ExecutionContext *ctx, const ValueRef object, const StringRef name, ValueRef val)
{
Scope scope(ctx);
ScopedObject o(scope, object->asObject());
assert(o);
uint idx = name->asArrayIndex();
- Property *pd = (idx != UINT_MAX) ? o->arrayInsert(idx) : o->insertMember(ScopedString(scope, name), Attr_Data);
+ Property *pd = (idx != UINT_MAX) ? o->arrayInsert(idx) : o->insertMember(name, Attr_Data);
pd->value = val ? *val : Value::undefinedValue();
}
@@ -1220,14 +1204,14 @@ ReturnedValue __qmljs_builtin_define_array(ExecutionContext *ctx, Value *values,
return a.asReturnedValue();
}
-void __qmljs_builtin_define_getter_setter(ExecutionContext *ctx, const ValueRef object, String *name, const ValueRef getter, const ValueRef setter)
+void __qmljs_builtin_define_getter_setter(ExecutionContext *ctx, const ValueRef object, const StringRef name, const ValueRef getter, const ValueRef setter)
{
Scope scope(ctx);
ScopedObject o(scope, object->asObject());
Q_ASSERT(!!o);
uint idx = name->asArrayIndex();
- Property *pd = (idx != UINT_MAX) ? o->arrayInsert(idx, Attr_Accessor) : o->insertMember(ScopedString(scope, name), Attr_Accessor);
+ Property *pd = (idx != UINT_MAX) ? o->arrayInsert(idx, Attr_Accessor) : o->insertMember(name, Attr_Accessor);
pd->setGetter(getter ? getter->asFunctionObject() : 0);
pd->setSetter(setter ? setter->asFunctionObject() : 0);
}
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index 38e54c8613..6b3325898c 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -109,29 +109,29 @@ struct ExecutionEngine;
struct InternalClass;
// context
-QV4::ReturnedValue __qmljs_call_activation_property(QV4::ExecutionContext *, QV4::String *name, CallDataRef callData);
-QV4::ReturnedValue __qmljs_call_property(QV4::ExecutionContext *context, QV4::String *name, CallDataRef callData);
+QV4::ReturnedValue __qmljs_call_activation_property(QV4::ExecutionContext *, const QV4::StringRef name, CallDataRef callData);
+QV4::ReturnedValue __qmljs_call_property(QV4::ExecutionContext *context, const QV4::StringRef name, CallDataRef callData);
QV4::ReturnedValue __qmljs_call_property_lookup(ExecutionContext *context, uint index, CallDataRef callData);
QV4::ReturnedValue __qmljs_call_element(ExecutionContext *context, const ValueRef index, CallDataRef callData);
QV4::ReturnedValue __qmljs_call_value(QV4::ExecutionContext *context, const QV4::ValueRef func, CallDataRef callData);
-QV4::ReturnedValue __qmljs_construct_activation_property(QV4::ExecutionContext *, QV4::String *name, CallDataRef callData);
-QV4::ReturnedValue __qmljs_construct_property(QV4::ExecutionContext *context, const QV4::ValueRef base, QV4::String *name, CallDataRef callData);
+QV4::ReturnedValue __qmljs_construct_activation_property(QV4::ExecutionContext *, const QV4::StringRef name, CallDataRef callData);
+QV4::ReturnedValue __qmljs_construct_property(QV4::ExecutionContext *context, const QV4::ValueRef base, const QV4::StringRef name, CallDataRef callData);
QV4::ReturnedValue __qmljs_construct_value(QV4::ExecutionContext *context, const QV4::ValueRef func, CallDataRef callData);
QV4::ReturnedValue __qmljs_builtin_typeof(QV4::ExecutionContext *ctx, const QV4::ValueRef val);
-QV4::ReturnedValue __qmljs_builtin_typeof_name(QV4::ExecutionContext *context, QV4::String *name);
-QV4::ReturnedValue __qmljs_builtin_typeof_member(QV4::ExecutionContext* context, const QV4::ValueRef base, QV4::String *name);
+QV4::ReturnedValue __qmljs_builtin_typeof_name(QV4::ExecutionContext *context, const QV4::StringRef name);
+QV4::ReturnedValue __qmljs_builtin_typeof_member(QV4::ExecutionContext* context, const QV4::ValueRef base, const QV4::StringRef name);
QV4::ReturnedValue __qmljs_builtin_typeof_element(QV4::ExecutionContext* context, const QV4::ValueRef base, const QV4::ValueRef index);
void Q_NORETURN __qmljs_builtin_rethrow(QV4::ExecutionContext *context);
QV4::ExecutionContext *__qmljs_builtin_push_with_scope(const QV4::ValueRef o, QV4::ExecutionContext *ctx);
-QV4::ExecutionContext *__qmljs_builtin_push_catch_scope(QV4::String *exceptionVarName, const QV4::ValueRef exceptionValue, QV4::ExecutionContext *ctx);
+QV4::ExecutionContext *__qmljs_builtin_push_catch_scope(const QV4::StringRef exceptionVarName, const QV4::ValueRef exceptionValue, QV4::ExecutionContext *ctx);
QV4::ExecutionContext *__qmljs_builtin_pop_scope(QV4::ExecutionContext *ctx);
-void __qmljs_builtin_declare_var(QV4::ExecutionContext *ctx, bool deletable, QV4::String *name);
-void __qmljs_builtin_define_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, QV4::String *name, QV4::ValueRef val);
+void __qmljs_builtin_declare_var(QV4::ExecutionContext *ctx, bool deletable, const QV4::StringRef name);
+void __qmljs_builtin_define_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name, QV4::ValueRef val);
QV4::ReturnedValue __qmljs_builtin_define_array(QV4::ExecutionContext *ctx, QV4::Value *values, uint length);
-void __qmljs_builtin_define_getter_setter(QV4::ExecutionContext *ctx, const QV4::ValueRef object, QV4::String *name, const QV4::ValueRef getter, const QV4::ValueRef setter);
+void __qmljs_builtin_define_getter_setter(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name, const QV4::ValueRef getter, const QV4::ValueRef setter);
QV4::ReturnedValue __qmljs_builtin_define_object_literal(QV4::ExecutionContext *ctx, const QV4::Value *args, int classId);
QV4::ReturnedValue __qmljs_builtin_setup_arguments_object(ExecutionContext *ctx);
@@ -148,10 +148,10 @@ Returned<String> *__qmljs_string_concat(QV4::ExecutionContext *ctx, QV4::String
// objects
Q_QML_EXPORT ReturnedValue __qmljs_object_default_value(QV4::Object *object, int typeHint);
-void __qmljs_set_activation_property(QV4::ExecutionContext *ctx, QV4::String *name, const QV4::ValueRef value);
-void __qmljs_set_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, QV4::String *name, const QV4::ValueRef value);
-QV4::ReturnedValue __qmljs_get_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, QV4::String *name);
-QV4::ReturnedValue __qmljs_get_activation_property(QV4::ExecutionContext *ctx, QV4::String *name);
+void __qmljs_set_activation_property(QV4::ExecutionContext *ctx, const QV4::StringRef name, const QV4::ValueRef value);
+void __qmljs_set_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name, const QV4::ValueRef value);
+QV4::ReturnedValue __qmljs_get_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name);
+QV4::ReturnedValue __qmljs_get_activation_property(QV4::ExecutionContext *ctx, const QV4::StringRef name);
ReturnedValue __qmljs_call_global_lookup(QV4::ExecutionContext *context, uint index, CallDataRef callData);
QV4::ReturnedValue __qmljs_construct_global_lookup(QV4::ExecutionContext *context, uint index, CallDataRef callData);
@@ -193,8 +193,8 @@ Q_QML_EXPORT unsigned __qmljs_value_to_uint32(const ValueRef value);
Q_QML_EXPORT unsigned __qmljs_double_to_uint32(const double &d);
QV4::ReturnedValue __qmljs_delete_subscript(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::ValueRef index);
-ReturnedValue __qmljs_delete_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name);
-ReturnedValue __qmljs_delete_name(QV4::ExecutionContext *ctx, QV4::String *name);
+ReturnedValue __qmljs_delete_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name);
+ReturnedValue __qmljs_delete_name(QV4::ExecutionContext *ctx, const QV4::StringRef name);
void Q_NORETURN __qmljs_throw(QV4::ExecutionContext*, const QV4::ValueRef value);
@@ -227,18 +227,18 @@ QV4::ReturnedValue __qmljs_sne(const QV4::ValueRef left, const QV4::ValueRef rig
QV4::ReturnedValue __qmljs_add_helper(QV4::ExecutionContext *ctx, const QV4::ValueRef left, const QV4::ValueRef right);
-typedef void (*InplaceBinOpName)(QV4::ExecutionContext *ctx, QV4::String *name, const QV4::ValueRef value);
-void __qmljs_inplace_bit_and_name(QV4::ExecutionContext *ctx, QV4::String *name, const QV4::ValueRef value);
-void __qmljs_inplace_bit_or_name(QV4::ExecutionContext *ctx, QV4::String *name, const QV4::ValueRef value);
-void __qmljs_inplace_bit_xor_name(QV4::ExecutionContext *ctx, QV4::String *name, const QV4::ValueRef value);
-void __qmljs_inplace_add_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_sub_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_mul_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_div_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_mod_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_shl_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_shr_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
-void __qmljs_inplace_ushr_name(QV4::ExecutionContext *ctx, QV4::String *name, const ValueRef value);
+typedef void (*InplaceBinOpName)(QV4::ExecutionContext *ctx, const QV4::StringRef name, const QV4::ValueRef value);
+void __qmljs_inplace_bit_and_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const QV4::ValueRef value);
+void __qmljs_inplace_bit_or_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const QV4::ValueRef value);
+void __qmljs_inplace_bit_xor_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const QV4::ValueRef value);
+void __qmljs_inplace_add_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_sub_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_mul_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_div_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_mod_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_shl_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_shr_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
+void __qmljs_inplace_ushr_name(QV4::ExecutionContext *ctx, const QV4::StringRef name, const ValueRef value);
typedef void (*InplaceBinOpElement)(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::ValueRef index, const QV4::ValueRef rhs);
void __qmljs_inplace_bit_and_element(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::ValueRef index, const QV4::ValueRef rhs);
@@ -253,18 +253,18 @@ void __qmljs_inplace_shl_element(QV4::ExecutionContext *ctx, const QV4::ValueRef
void __qmljs_inplace_shr_element(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::ValueRef index, const QV4::ValueRef rhs);
void __qmljs_inplace_ushr_element(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::ValueRef index, const QV4::ValueRef rhs);
-typedef void (*InplaceBinOpMember)(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_bit_and_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_bit_or_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_bit_xor_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_add_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_sub_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_mul_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_div_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_mod_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_shl_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_shr_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
-void __qmljs_inplace_ushr_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, QV4::String *name, const QV4::ValueRef rhs);
+typedef void (*InplaceBinOpMember)(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_bit_and_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_bit_or_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_bit_xor_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_add_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_sub_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_mul_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_div_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_mod_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_shl_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_shr_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
+void __qmljs_inplace_ushr_member(QV4::ExecutionContext *ctx, const QV4::ValueRef base, const QV4::StringRef name, const QV4::ValueRef rhs);
typedef QV4::Bool (*CmpOp)(const QV4::ValueRef left, const QV4::ValueRef right);
QV4::Bool __qmljs_cmp_gt(const QV4::ValueRef l, const QV4::ValueRef r);
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index fe61168d3c..1aa9d80a2d 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -228,7 +228,7 @@ ReturnedValue Script::run()
Lookup *oldLookups = scope->lookups;
CompiledData::CompilationUnit * const oldCompilationUnit = scope->compilationUnit;
const CompiledData::Function * const oldCompiledFunction = scope->compiledFunction;
- String ** const oldRuntimeStrings = scope->runtimeStrings;
+ SafeString * const oldRuntimeStrings = scope->runtimeStrings;
scope->strictMode = vmFunction->isStrict();
scope->lookups = vmFunction->compilationUnit->runtimeLookups;
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 8f7144df74..868158717c 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -242,7 +242,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *&code,
}
#endif
- QV4::String ** const runtimeStrings = context->runtimeStrings;
+ QV4::SafeString * const runtimeStrings = context->runtimeStrings;
context->interpreterInstructionPointer = &code;
#ifdef MOTH_THREADED_INTERPRETER