Change the runtime API over to using StringRef's instead of String*
authorLars Knoll <lars.knoll@digia.com>
Thu, 19 Sep 2013 10:05:18 +0000 (12:05 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 21 Sep 2013 23:06:20 +0000 (01:06 +0200)
Change-Id: I0ea95e6cca995dc5f98871f0369204af18e48111
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
12 files changed:
src/qml/compiler/qv4compileddata.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4isel_masm.cpp
src/qml/compiler/qv4isel_masm_p.h
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4function.cpp
src/qml/jsruntime/qv4globalobject.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtime_p.h
src/qml/jsruntime/qv4script.cpp
src/qml/jsruntime/qv4vme_moth.cpp

index 991fc92..cc1f27c 100644 (file)
@@ -75,7 +75,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
 
     assert(!runtimeStrings);
     assert(data);
-    runtimeStrings = (QV4::String**)malloc(data->stringTableSize * sizeof(QV4::String*));
+    runtimeStrings = (QV4::SafeString *)malloc(data->stringTableSize * sizeof(QV4::SafeString));
     for (int i = 0; i < data->stringTableSize; ++i)
         runtimeStrings[i] = engine->newIdentifier(data->stringAt(i));
 
@@ -110,7 +110,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
                 l->classList[i] = 0;
             l->level = -1;
             l->index = UINT_MAX;
-            l->name = runtimeStrings[compiledLookups[i].nameIndex];
+            l->name = runtimeStrings[compiledLookups[i].nameIndex].asString();
         }
     }
 
@@ -122,7 +122,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
             const CompiledData::JSClassMember *member = data->jsClassAt(i, &memberCount);
             QV4::InternalClass *klass = engine->objectClass;
             for (int j = 0; j < memberCount; ++j, ++member)
-                klass = klass->addMember(runtimeStrings[member->nameOffset], member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data);
+                klass = klass->addMember(runtimeStrings[member->nameOffset].asString(), member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data);
 
             runtimeClasses[i] = klass;
         }
@@ -162,7 +162,7 @@ void CompilationUnit::unlink()
 void CompilationUnit::markObjects()
 {
     for (int i = 0; i < data->stringTableSize; ++i)
-        runtimeStrings[i]->mark();
+        runtimeStrings[i].mark();
     for (int i = 0; i < data->regexpTableSize; ++i)
         runtimeRegularExpressions[i].mark();
     for (int i = 0; i < runtimeFunctions.count(); ++i)
index 8481e17..9186086 100644 (file)
@@ -464,7 +464,7 @@ struct Q_QML_EXPORT CompilationUnit
 
     QString fileName() const { return data->stringAt(data->sourceFileIndex); }
 
-    QV4::String **runtimeStrings; // Array
+    QV4::SafeString *runtimeStrings; // Array
     QV4::Lookup *runtimeLookups;
     QV4::Value *runtimeRegularExpressions;
     QV4::InternalClass **runtimeClasses;
index a6a245e..c723471 100644 (file)
@@ -299,7 +299,14 @@ Assembler::Pointer Assembler::loadStringAddress(RegisterID reg, const QString &s
 {
     loadPtr(Address(Assembler::ContextRegister, qOffsetOf(QV4::ExecutionContext, runtimeStrings)), reg);
     const int id = _isel->registerString(string);
-    return Pointer(reg, id * sizeof(QV4::String*));
+    return Pointer(reg, id * sizeof(QV4::SafeString));
+}
+
+void Assembler::loadStringRef(RegisterID reg, const QString &string)
+{
+    loadPtr(Address(Assembler::ContextRegister, qOffsetOf(QV4::ExecutionContext, runtimeStrings)), reg);
+    const int id = _isel->registerString(string);
+    addPtr(TrustedImmPtr(id * sizeof(QV4::SafeString)), reg);
 }
 
 template <typename Result, typename Source>
@@ -782,7 +789,7 @@ void InstructionSelection::callBuiltinThrow(V4IR::Expr *arg)
 
 typedef void *(*MiddleOfFunctionEntryPoint(ExecutionContext *, void *localsPtr));
 static void *tryWrapper(ExecutionContext *context, void *localsPtr, MiddleOfFunctionEntryPoint tryBody, MiddleOfFunctionEntryPoint catchBody,
-                        QV4::String *exceptionVarName, ValueRef exceptionVar)
+                        QV4::StringRef exceptionVarName, ValueRef exceptionVar)
 {
     exceptionVar = Value::undefinedValue();
     void *addressToContinueAt = 0;
@@ -983,8 +990,6 @@ void InstructionSelection::loadString(const QString &str, V4IR::Temp *targetTemp
     _as->loadPtr(srcAddr, Assembler::ReturnValueRegister);
     Pointer destAddr = _as->loadTempAddress(Assembler::ScratchRegister, targetTemp);
 #if QT_POINTER_SIZE == 8
-    _as->or64(Assembler::TrustedImm64(quint64(QV4::Value::Managed_Type) << QV4::Value::Tag_Shift),
-              Assembler::ReturnValueRegister);
     _as->store64(Assembler::ReturnValueRegister, destAddr);
 #else
     _as->store32(Assembler::ReturnValueRegister, destAddr);
index c74dcd3..d6f5e0c 100644 (file)
@@ -440,6 +440,7 @@ public:
 
     Pointer loadTempAddress(RegisterID reg, V4IR::Temp *t);
     Pointer loadStringAddress(RegisterID reg, const QString &string);
+    void loadStringRef(RegisterID reg, const QString &string);
     Pointer stackSlotPointer(V4IR::Temp *t) const
     {
         Q_ASSERT(t->kind == V4IR::Temp::StackSlot);
@@ -512,8 +513,7 @@ public:
     void loadArgumentInRegister(PointerToString temp, RegisterID dest, int argumentNumber)
     {
         Q_UNUSED(argumentNumber);
-        Pointer addr = loadStringAddress(dest, temp.string);
-        loadPtr(addr, dest);
+        loadStringRef(dest, temp.string);
     }
 
     void loadArgumentInRegister(Reference temp, RegisterID dest, int argumentNumber)
@@ -694,8 +694,7 @@ public:
     void loadArgumentOnStack(PointerToString temp, int argumentNumber)
     {
         Q_UNUSED(argumentNumber);
-        Pointer ptr = loadStringAddress(ScratchRegister, temp.string);
-        loadPtr(ptr, ScratchRegister);
+        loadStringRef(ScratchRegister, temp.string);
         poke(ScratchRegister, StackSlot);
     }
 
index baa4ade..8d07c52 100644 (file)
@@ -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;
 }
index d4d9216..f216746 100644 (file)
@@ -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();
index a7ae365..f69a095 100644 (file)
@@ -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();
index 9ec70f5..ae91b11 100644 (file)
@@ -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;
index 735c593..21ada92 100644 (file)
@@ -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);
 }
index 38e54c8..6b33258 100644 (file)
@@ -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);
index fe61168..1aa9d80 100644 (file)
@@ -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;
index 8f7144d..8681587 100644 (file)
@@ -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