aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-16 16:35:05 +0200
committerLars Knoll <lars.knoll@digia.com>2013-08-16 19:14:55 +0200
commit5ef4dd00f93d12a59cb01fa6ff44e2f01e3f71a1 (patch)
treee91dbd1baf691e39eeab89451f1090eff10f08b1 /src
parent0d4657cc172d8b3dbd491da10ff88912603b0024 (diff)
Ported identifiers in moth to use runtime strings
Change-Id: I09f04994a2ebe631b12fa76b77a622711de31926 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h51
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp55
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h2
-rw-r--r--src/qml/jsruntime/qv4context.cpp9
-rw-r--r--src/qml/jsruntime/qv4function.cpp2
-rw-r--r--src/qml/jsruntime/qv4function_p.h1
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp50
7 files changed, 87 insertions, 83 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 2cc1b3e8d7..6e167e267b 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
#define FOR_EACH_MOTH_INSTR(F) \
F(Ret, ret) \
F(LoadValue, loadValue) \
+ F(LoadString, loadString) \
F(LoadClosure, loadClosure) \
F(MoveTemp, moveTemp) \
F(LoadName, loadName) \
@@ -218,6 +219,11 @@ union Instr
Param value;
Param result;
};
+ struct instr_loadString {
+ MOTH_INSTR_HEADER
+ int stringId;
+ Param result;
+ };
struct instr_moveTemp {
MOTH_INSTR_HEADER
Param source;
@@ -230,23 +236,23 @@ union Instr
};
struct instr_loadName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param result;
};
struct instr_storeName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param source;
};
struct instr_loadProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param base;
Param result;
};
struct instr_storeProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param base;
Param source;
};
@@ -270,7 +276,7 @@ union Instr
MOTH_INSTR_HEADER
ptrdiff_t tryOffset;
ptrdiff_t catchOffset;
- QV4::String *exceptionVarName;
+ int exceptionVarName;
Param exceptionVar;
};
struct instr_callValue {
@@ -282,7 +288,7 @@ union Instr
};
struct instr_callProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
quint32 argc;
quint32 args;
Param base;
@@ -298,7 +304,7 @@ union Instr
};
struct instr_callActivationProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
quint32 argc;
quint32 args;
Param result;
@@ -329,7 +335,7 @@ union Instr
};
struct instr_callBuiltinDeleteMember {
MOTH_INSTR_HEADER
- QV4::String *member;
+ int member;
Param base;
Param result;
};
@@ -341,12 +347,12 @@ union Instr
};
struct instr_callBuiltinDeleteName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param result;
};
struct instr_callBuiltinTypeofMember {
MOTH_INSTR_HEADER
- QV4::String *member;
+ int member;
Param base;
Param result;
};
@@ -358,7 +364,7 @@ union Instr
};
struct instr_callBuiltinTypeofName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param result;
};
struct instr_callBuiltinTypeofValue {
@@ -369,7 +375,7 @@ union Instr
struct instr_callBuiltinPostIncMember {
MOTH_INSTR_HEADER
Param base;
- QV4::String *member;
+ int member;
Param result;
};
struct instr_callBuiltinPostIncSubscript {
@@ -380,7 +386,7 @@ union Instr
};
struct instr_callBuiltinPostIncName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param result;
};
struct instr_callBuiltinPostIncValue {
@@ -391,7 +397,7 @@ union Instr
struct instr_callBuiltinPostDecMember {
MOTH_INSTR_HEADER
Param base;
- QV4::String *member;
+ int member;
Param result;
};
struct instr_callBuiltinPostDecSubscript {
@@ -402,7 +408,7 @@ union Instr
};
struct instr_callBuiltinPostDecName {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param result;
};
struct instr_callBuiltinPostDecValue {
@@ -412,19 +418,19 @@ union Instr
};
struct instr_callBuiltinDeclareVar {
MOTH_INSTR_HEADER
- QV4::String *varName;
+ int varName;
bool isDeletable;
};
struct instr_callBuiltinDefineGetterSetter {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param object;
Param getter;
Param setter;
};
struct instr_callBuiltinDefineProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
Param object;
Param value;
};
@@ -449,7 +455,7 @@ union Instr
};
struct instr_createProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
quint32 argc;
quint32 args;
Param base;
@@ -457,7 +463,7 @@ union Instr
};
struct instr_createActivationProperty {
MOTH_INSTR_HEADER
- QV4::String *name;
+ int name;
quint32 argc;
quint32 args;
Param result;
@@ -523,20 +529,21 @@ union Instr
struct instr_inplaceMemberOp {
MOTH_INSTR_HEADER
QV4::InplaceBinOpMember alu;
- QV4::String *member;
+ int member;
Param base;
Param source;
};
struct instr_inplaceNameOp {
MOTH_INSTR_HEADER
QV4::InplaceBinOpName alu;
- QV4::String *name;
+ int name;
Param source;
};
instr_common common;
instr_ret ret;
instr_loadValue loadValue;
+ instr_loadString loadString;
instr_moveTemp moveTemp;
instr_loadClosure loadClosure;
instr_loadName loadName;
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index b950a987c4..7325ef020c 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -325,7 +325,7 @@ void InstructionSelection::callProperty(V4IR::Temp *base, const QString &name, V
// call the property on the loaded base
Instruction::CallProperty call;
call.base = getParam(base);
- call.name = identifier(name);
+ call.name = stringId(name);
prepareCallArgs(args, call.argc, call.args);
call.result = getResultParam(result);
addInstruction(call);
@@ -356,7 +356,7 @@ void InstructionSelection::constructActivationProperty(V4IR::Name *func,
V4IR::Temp *result)
{
Instruction::CreateActivationProperty create;
- create.name = identifier(*func->id);
+ create.name = stringId(*func->id);
prepareCallArgs(args, create.argc, create.args);
create.result = getResultParam(result);
addInstruction(create);
@@ -366,7 +366,7 @@ void InstructionSelection::constructProperty(V4IR::Temp *base, const QString &na
{
Instruction::CreateProperty create;
create.base = getParam(base);
- create.name = identifier(name);
+ create.name = stringId(name);
prepareCallArgs(args, create.argc, create.args);
create.result = getResultParam(result);
addInstruction(create);
@@ -400,8 +400,8 @@ void InstructionSelection::loadConst(V4IR::Const *sourceConst, V4IR::Temp *targe
void InstructionSelection::loadString(const QString &str, V4IR::Temp *targetTemp)
{
- Instruction::LoadValue load;
- load.value = Instr::Param::createValue(QV4::Value::fromString(identifier(str)));
+ Instruction::LoadString load;
+ load.stringId = stringId(str);
load.result = getResultParam(targetTemp);
addInstruction(load);
}
@@ -422,7 +422,7 @@ void InstructionSelection::loadRegexp(V4IR::RegExp *sourceRegexp, V4IR::Temp *ta
void InstructionSelection::getActivationProperty(const V4IR::Name *name, V4IR::Temp *temp)
{
Instruction::LoadName load;
- load.name = identifier(*name->id);
+ load.name = stringId(*name->id);
load.result = getResultParam(temp);
addInstruction(load);
}
@@ -431,7 +431,7 @@ void InstructionSelection::setActivationProperty(V4IR::Temp *source, const QStri
{
Instruction::StoreName store;
store.source = getParam(source);
- store.name = identifier(targetName);
+ store.name = stringId(targetName);
addInstruction(store);
}
@@ -449,7 +449,7 @@ void InstructionSelection::getProperty(V4IR::Temp *base, const QString &name, V4
{
Instruction::LoadProperty load;
load.base = getParam(base);
- load.name = identifier(name);
+ load.name = stringId(name);
load.result = getResultParam(target);
addInstruction(load);
}
@@ -458,7 +458,7 @@ void InstructionSelection::setProperty(V4IR::Temp *source, V4IR::Temp *targetBas
{
Instruction::StoreProperty store;
store.base = getParam(targetBase);
- store.name = identifier(targetName);
+ store.name = stringId(targetName);
store.source = getParam(source);
addInstruction(store);
}
@@ -603,7 +603,7 @@ void InstructionSelection::inplaceNameOp(V4IR::AluOp oper, V4IR::Temp *rightSour
if (op) {
Instruction::InplaceNameOp ieo;
ieo.alu = op;
- ieo.name = identifier(targetName);
+ ieo.name = stringId(targetName);
ieo.source = getParam(rightSource);
addInstruction(ieo);
}
@@ -656,7 +656,7 @@ void InstructionSelection::inplaceMemberOp(V4IR::AluOp oper, V4IR::Temp *source,
Instruction::InplaceMemberOp imo;
imo.alu = op;
imo.base = getParam(targetBase);
- imo.member = identifier(targetName);
+ imo.member = stringId(targetName);
imo.source = getParam(source);
addInstruction(imo);
}
@@ -742,7 +742,7 @@ void InstructionSelection::visitTry(V4IR::Try *t)
Instruction::EnterTry enterTry;
enterTry.tryOffset = 0;
enterTry.catchOffset = 0;
- enterTry.exceptionVarName = identifier(*t->exceptionVarName);
+ enterTry.exceptionVarName = stringId(*t->exceptionVarName);
enterTry.exceptionVar = getParam(t->exceptionVar);
ptrdiff_t enterTryLoc = addInstruction(enterTry);
@@ -756,7 +756,7 @@ void InstructionSelection::visitTry(V4IR::Try *t)
void InstructionSelection::callBuiltinInvalid(V4IR::Name *func, V4IR::ExprList *args, V4IR::Temp *result)
{
Instruction::CallActivationProperty call;
- call.name = identifier(*func->id);
+ call.name = stringId(*func->id);
prepareCallArgs(args, call.argc, call.args);
call.result = getResultParam(result);
addInstruction(call);
@@ -766,7 +766,7 @@ void InstructionSelection::callBuiltinTypeofMember(V4IR::Temp *base, const QStri
{
Instruction::CallBuiltinTypeofMember call;
call.base = getParam(base);
- call.member = identifier(name);
+ call.member = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -783,7 +783,7 @@ void InstructionSelection::callBuiltinTypeofSubscript(V4IR::Temp *base, V4IR::Te
void InstructionSelection::callBuiltinTypeofName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinTypeofName call;
- call.name = identifier(name);
+ call.name = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -800,7 +800,7 @@ void InstructionSelection::callBuiltinDeleteMember(V4IR::Temp *base, const QStri
{
Instruction::CallBuiltinDeleteMember call;
call.base = getParam(base);
- call.member = identifier(name);
+ call.member = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -817,7 +817,7 @@ void InstructionSelection::callBuiltinDeleteSubscript(V4IR::Temp *base, V4IR::Te
void InstructionSelection::callBuiltinDeleteName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinDeleteName call;
- call.name = identifier(name);
+ call.name = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -834,7 +834,7 @@ void InstructionSelection::callBuiltinPostDecrementMember(V4IR::Temp *base, cons
{
Instruction::CallBuiltinPostDecMember call;
call.base = getParam(base);
- call.member = identifier(name);
+ call.member = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -851,7 +851,7 @@ void InstructionSelection::callBuiltinPostDecrementSubscript(V4IR::Temp *base, V
void InstructionSelection::callBuiltinPostDecrementName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinPostDecName call;
- call.name = identifier(name);
+ call.name = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -868,7 +868,7 @@ void InstructionSelection::callBuiltinPostIncrementMember(V4IR::Temp *base, cons
{
Instruction::CallBuiltinPostIncMember call;
call.base = getParam(base);
- call.member = identifier(name);
+ call.member = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -885,7 +885,7 @@ void InstructionSelection::callBuiltinPostIncrementSubscript(V4IR::Temp *base, V
void InstructionSelection::callBuiltinPostIncrementName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinPostIncName call;
- call.name = identifier(name);
+ call.name = stringId(name);
call.result = getResultParam(result);
addInstruction(call);
}
@@ -944,7 +944,7 @@ void InstructionSelection::callBuiltinDeclareVar(bool deletable, const QString &
{
Instruction::CallBuiltinDeclareVar call;
call.isDeletable = deletable;
- call.varName = identifier(name);
+ call.varName = stringId(name);
addInstruction(call);
}
@@ -952,7 +952,7 @@ void InstructionSelection::callBuiltinDefineGetterSetter(V4IR::Temp *object, con
{
Instruction::CallBuiltinDefineGetterSetter call;
call.object = getParam(object);
- call.name = identifier(name);
+ call.name = stringId(name);
call.getter = getParam(getter);
call.setter = getParam(setter);
addInstruction(call);
@@ -962,7 +962,7 @@ void InstructionSelection::callBuiltinDefineProperty(V4IR::Temp *object, const Q
{
Instruction::CallBuiltinDefineProperty call;
call.object = getParam(object);
- call.name = identifier(name);
+ call.name = stringId(name);
call.value = getParam(value);
addInstruction(call);
}
@@ -1069,13 +1069,6 @@ QByteArray InstructionSelection::squeezeCode() const
return squeezed;
}
-QV4::String *InstructionSelection::identifier(const QString &s)
-{
- QV4::String *str = engine()->newIdentifier(s);
- _vmFunction->identifiers.append(str);
- return str;
-}
-
Instr::Param InstructionSelection::getParam(V4IR::Expr *e) {
typedef Instr::Param Param;
assert(e);
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h
index b32fba43f5..4c0d96c4f5 100644
--- a/src/qml/compiler/qv4isel_moth_p.h
+++ b/src/qml/compiler/qv4isel_moth_p.h
@@ -170,8 +170,6 @@ private:
void patchJumpAddresses();
QByteArray squeezeCode() const;
- QV4::String *identifier(const QString &s);
-
V4IR::Function *_function;
QV4::Function *_vmFunction;
V4IR::BasicBlock *_block;
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 0effad944c..3c0dbe35b7 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -612,12 +612,15 @@ void ExecutionContext::throwURIError(Value msg)
const Function *ExecutionContext::runtimeFunction() const
{
- if (type >= Type_CallContext) {
- const QV4::FunctionObject *f = asCallContext()->function;
+ const ExecutionContext *ctx = this;
+ if (ctx->type == Type_CatchContext)
+ ctx = ctx->parent;
+ if (ctx->type >= Type_CallContext) {
+ const QV4::FunctionObject *f = ctx->asCallContext()->function;
Q_ASSERT(f);
return f ? f->function : 0;
}
- Q_ASSERT(type == Type_GlobalContext);
+ Q_ASSERT(ctx->type == Type_GlobalContext);
return engine->globalCode;
}
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 8c95452f3c..3f7be84057 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -97,8 +97,6 @@ void Function::mark()
for (int i = 0; i < generatedValues.size(); ++i)
if (Managed *m = generatedValues.at(i).asManaged())
m->mark();
- for (int i = 0; i < identifiers.size(); ++i)
- identifiers.at(i)->mark();
}
namespace QV4 {
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index cc6491b9f8..948729e933 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -99,7 +99,6 @@ struct Function {
QVector<String *> formals;
QVector<String *> locals;
QVector<Value> generatedValues;
- QVector<String *> identifiers;
QVector<Function *> nestedFunctions;
QVector<LineNumberMapping> lineNumberMappings;
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index b5e6fc1ab9..746a7be722 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -239,6 +239,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
}
#endif
+ QV4::String ** const runtimeStrings = context->runtimeFunction()->compilationUnit->runtimeStrings;
context->interpreterInstructionPointer = &code;
#ifdef MOTH_THREADED_INTERPRETER
@@ -259,18 +260,23 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
VALUE(instr.result) = VALUE(instr.value);
MOTH_END_INSTR(LoadValue)
+ MOTH_BEGIN_INSTR(LoadString)
+// TRACE(value, "%s", instr.value.toString(context)->toQString().toUtf8().constData());
+ VALUE(instr.result) = QV4::Value::fromString(runtimeStrings[instr.stringId]);
+ MOTH_END_INSTR(LoadString)
+
MOTH_BEGIN_INSTR(LoadClosure)
__qmljs_init_closure(context, VALUEPTR(instr.result), instr.value);
MOTH_END_INSTR(LoadClosure)
MOTH_BEGIN_INSTR(LoadName)
TRACE(inline, "property name = %s", instr.name->toQString().toUtf8().constData());
- __qmljs_get_activation_property(context, VALUEPTR(instr.result), instr.name);
+ __qmljs_get_activation_property(context, VALUEPTR(instr.result), runtimeStrings[instr.name]);
MOTH_END_INSTR(LoadName)
MOTH_BEGIN_INSTR(StoreName)
TRACE(inline, "property name = %s", instr.name->toQString().toUtf8().constData());
- __qmljs_set_activation_property(context, instr.name, VALUE(instr.source));
+ __qmljs_set_activation_property(context, runtimeStrings[instr.name], VALUE(instr.source));
MOTH_END_INSTR(StoreName)
MOTH_BEGIN_INSTR(LoadElement)
@@ -282,11 +288,11 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(StoreElement)
MOTH_BEGIN_INSTR(LoadProperty)
- __qmljs_get_property(context, VALUEPTR(instr.result), VALUE(instr.base), instr.name);
+ __qmljs_get_property(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.name]);
MOTH_END_INSTR(LoadProperty)
MOTH_BEGIN_INSTR(StoreProperty)
- __qmljs_set_property(context, VALUE(instr.base), instr.name, VALUE(instr.source));
+ __qmljs_set_property(context, VALUE(instr.base), runtimeStrings[instr.name], VALUE(instr.source));
MOTH_END_INSTR(StoreProperty)
MOTH_BEGIN_INSTR(Push)
@@ -316,7 +322,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(instr.name->toQString()), instr.args, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
Q_ASSERT(instr.args + instr.argc <= stackSize);
QV4::Value *args = stack + instr.args;
- __qmljs_call_property(context, VALUEPTR(instr.result), VALUE(instr.base), instr.name, args, instr.argc);
+ __qmljs_call_property(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.name], args, instr.argc);
MOTH_END_INSTR(CallProperty)
MOTH_BEGIN_INSTR(CallElement)
@@ -329,7 +335,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
Q_ASSERT(instr.args + instr.argc <= stackSize);
TRACE(args, "starting at %d, length %d", instr.args, instr.argc);
QV4::Value *args = stack + instr.args;
- __qmljs_call_activation_property(context, VALUEPTR(instr.result), instr.name, args, instr.argc);
+ __qmljs_call_activation_property(context, VALUEPTR(instr.result), runtimeStrings[instr.name], args, instr.argc);
MOTH_END_INSTR(CallActivationProperty)
MOTH_BEGIN_INSTR(CallBuiltinThrow)
@@ -347,7 +353,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
ex.accept(context);
VALUE(instr.exceptionVar) = ex.value();
try {
- QV4::ExecutionContext *catchContext = __qmljs_builtin_push_catch_scope(instr.exceptionVarName, ex.value(), context);
+ QV4::ExecutionContext *catchContext = __qmljs_builtin_push_catch_scope(runtimeStrings[instr.exceptionVarName], ex.value(), context);
const uchar *catchCode = ((uchar *)&instr.catchOffset) + instr.catchOffset;
run(catchContext, catchCode, stack, stackSize);
code = catchCode;
@@ -385,7 +391,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinForeachNextPropertyName)
MOTH_BEGIN_INSTR(CallBuiltinDeleteMember)
- __qmljs_delete_member(context, VALUEPTR(instr.result), VALUE(instr.base), instr.member);
+ __qmljs_delete_member(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.member]);
MOTH_END_INSTR(CallBuiltinDeleteMember)
MOTH_BEGIN_INSTR(CallBuiltinDeleteSubscript)
@@ -393,11 +399,11 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinDeleteSubscript)
MOTH_BEGIN_INSTR(CallBuiltinDeleteName)
- __qmljs_delete_name(context, VALUEPTR(instr.result), instr.name);
+ __qmljs_delete_name(context, VALUEPTR(instr.result), runtimeStrings[instr.name]);
MOTH_END_INSTR(CallBuiltinDeleteName)
MOTH_BEGIN_INSTR(CallBuiltinTypeofMember)
- __qmljs_builtin_typeof_member(context, VALUEPTR(instr.result), VALUE(instr.base), instr.member);
+ __qmljs_builtin_typeof_member(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.member]);
MOTH_END_INSTR(CallBuiltinTypeofMember)
MOTH_BEGIN_INSTR(CallBuiltinTypeofSubscript)
@@ -405,7 +411,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofSubscript)
MOTH_BEGIN_INSTR(CallBuiltinTypeofName)
- __qmljs_builtin_typeof_name(context, VALUEPTR(instr.result), instr.name);
+ __qmljs_builtin_typeof_name(context, VALUEPTR(instr.result), runtimeStrings[instr.name]);
MOTH_END_INSTR(CallBuiltinTypeofName)
MOTH_BEGIN_INSTR(CallBuiltinTypeofValue)
@@ -413,7 +419,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofValue)
MOTH_BEGIN_INSTR(CallBuiltinPostIncMember)
- __qmljs_builtin_post_increment_member(context, VALUEPTR(instr.result), VALUE(instr.base), instr.member);
+ __qmljs_builtin_post_increment_member(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.member]);
MOTH_END_INSTR(CallBuiltinTypeofMember)
MOTH_BEGIN_INSTR(CallBuiltinPostIncSubscript)
@@ -421,7 +427,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofSubscript)
MOTH_BEGIN_INSTR(CallBuiltinPostIncName)
- __qmljs_builtin_post_increment_name(context, VALUEPTR(instr.result), instr.name);
+ __qmljs_builtin_post_increment_name(context, VALUEPTR(instr.result), runtimeStrings[instr.name]);
MOTH_END_INSTR(CallBuiltinTypeofName)
MOTH_BEGIN_INSTR(CallBuiltinPostIncValue)
@@ -429,7 +435,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofValue)
MOTH_BEGIN_INSTR(CallBuiltinPostDecMember)
- __qmljs_builtin_post_decrement_member(context, VALUEPTR(instr.result), VALUE(instr.base), instr.member);
+ __qmljs_builtin_post_decrement_member(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.member]);
MOTH_END_INSTR(CallBuiltinTypeofMember)
MOTH_BEGIN_INSTR(CallBuiltinPostDecSubscript)
@@ -437,7 +443,7 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofSubscript)
MOTH_BEGIN_INSTR(CallBuiltinPostDecName)
- __qmljs_builtin_post_decrement_name(context, VALUEPTR(instr.result), instr.name);
+ __qmljs_builtin_post_decrement_name(context, VALUEPTR(instr.result), runtimeStrings[instr.name]);
MOTH_END_INSTR(CallBuiltinTypeofName)
MOTH_BEGIN_INSTR(CallBuiltinPostDecValue)
@@ -445,15 +451,15 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_END_INSTR(CallBuiltinTypeofValue)
MOTH_BEGIN_INSTR(CallBuiltinDeclareVar)
- __qmljs_builtin_declare_var(context, instr.isDeletable, instr.varName);
+ __qmljs_builtin_declare_var(context, instr.isDeletable, runtimeStrings[instr.varName]);
MOTH_END_INSTR(CallBuiltinDeclareVar)
MOTH_BEGIN_INSTR(CallBuiltinDefineGetterSetter)
- __qmljs_builtin_define_getter_setter(context, VALUE(instr.object), instr.name, VALUEPTR(instr.getter), VALUEPTR(instr.setter));
+ __qmljs_builtin_define_getter_setter(context, VALUE(instr.object), runtimeStrings[instr.name], VALUEPTR(instr.getter), VALUEPTR(instr.setter));
MOTH_END_INSTR(CallBuiltinDefineGetterSetter)
MOTH_BEGIN_INSTR(CallBuiltinDefineProperty)
- __qmljs_builtin_define_property(context, VALUE(instr.object), instr.name, VALUEPTR(instr.value));
+ __qmljs_builtin_define_property(context, VALUE(instr.object), runtimeStrings[instr.name], VALUEPTR(instr.value));
MOTH_END_INSTR(CallBuiltinDefineProperty)
MOTH_BEGIN_INSTR(CallBuiltinDefineArray)
@@ -476,14 +482,14 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_BEGIN_INSTR(CreateProperty)
Q_ASSERT(instr.args + instr.argc <= stackSize);
QV4::Value *args = stack + instr.args;
- __qmljs_construct_property(context, VALUEPTR(instr.result), VALUE(instr.base), instr.name, args, instr.argc);
+ __qmljs_construct_property(context, VALUEPTR(instr.result), VALUE(instr.base), runtimeStrings[instr.name], args, instr.argc);
MOTH_END_INSTR(CreateProperty)
MOTH_BEGIN_INSTR(CreateActivationProperty)
TRACE(inline, "property name = %s, args = %d, argc = %d", instr.name->toQString().toUtf8().constData(), instr.args, instr.argc);
Q_ASSERT(instr.args + instr.argc <= stackSize);
QV4::Value *args = stack + instr.args;
- __qmljs_construct_activation_property(context, VALUEPTR(instr.result), instr.name, args, instr.argc);
+ __qmljs_construct_activation_property(context, VALUEPTR(instr.result), runtimeStrings[instr.name], args, instr.argc);
MOTH_END_INSTR(CreateActivationProperty)
MOTH_BEGIN_INSTR(Jump)
@@ -556,13 +562,13 @@ QV4::Value VME::run(QV4::ExecutionContext *context, const uchar *&code,
MOTH_BEGIN_INSTR(InplaceMemberOp)
instr.alu(context,
VALUE(instr.base),
- instr.member,
+ runtimeStrings[instr.member],
VALUE(instr.source));
MOTH_END_INSTR(InplaceMemberOp)
MOTH_BEGIN_INSTR(InplaceNameOp)
TRACE(name, "%s", instr.name->toQString().toUtf8().constData());
- instr.alu(context, instr.name, VALUE(instr.source));
+ instr.alu(context, runtimeStrings[instr.name], VALUE(instr.source));
MOTH_END_INSTR(InplaceNameOp)
#ifdef MOTH_THREADED_INTERPRETER