aboutsummaryrefslogtreecommitdiffstats
path: root/moth
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2012-11-30 09:48:46 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2012-11-30 12:30:14 +0100
commitd63043df6fa8e8624b4ab9c7a70f320df8156a4a (patch)
tree46b6e51027635c08d253f29af128122e00bd8ebc /moth
parentf26d5c36cff33cc8a968c87a69e9dddbb4278855 (diff)
Clean up the DeclarativeEnvironment
Add a pointer to the FunctionObject in there, and remove the duplication of the formal and local variable names. Change-Id: Id8017b3e167228292b5d351e02b8927f0bfb41eb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'moth')
-rw-r--r--moth/qv4vme_moth.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/moth/qv4vme_moth.cpp b/moth/qv4vme_moth.cpp
index e71733d2a1..ff42684fac 100644
--- a/moth/qv4vme_moth.cpp
+++ b/moth/qv4vme_moth.cpp
@@ -80,13 +80,13 @@ static inline VM::Value *tempValue(QQmlJS::VM::ExecutionContext *context, QVecto
Q_ASSERT(varEnv->arguments);
return varEnv->arguments + arg;
- } else if (index < (int) varEnv->varCount) {
+ } else if (index < (int) varEnv->variableCount()) {
Q_ASSERT(index >= 0);
Q_ASSERT(varEnv->locals);
return varEnv->locals + index;
} else {
- int off = index - varEnv->varCount;
+ int off = index - varEnv->variableCount();
Q_ASSERT(off >= 0);
Q_ASSERT(off < stack.size());
@@ -231,21 +231,21 @@ VM::Value VME::operator()(QQmlJS::VM::ExecutionContext *context, const uchar *co
}
}
#endif // DO_TRACE_INSTR
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
TRACE(Call, "value index = %d, argStart = %d, argc = %d, result temp index = %d", instr.destIndex, argStart, instr.argc, instr.targetTempIndex);
VM::Value *args = stack.data() + argStart;
TEMP(instr.targetTempIndex) = __qmljs_call_value(context, VM::Value::undefinedValue(), TEMP(instr.destIndex), args, instr.argc);
MOTH_END_INSTR(CallValue)
MOTH_BEGIN_INSTR(CallProperty)
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
VM::Value *args = stack.data() + argStart;
VM::Value base = TEMP(instr.baseTemp);
TEMP(instr.targetTempIndex) = __qmljs_call_property(context, base, instr.name, args, instr.argc);
MOTH_END_INSTR(CallProperty)
MOTH_BEGIN_INSTR(CallBuiltin)
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
VM::Value *args = stack.data() + argStart;
void *buf;
switch (instr.builtin) {
@@ -325,20 +325,20 @@ VM::Value VME::operator()(QQmlJS::VM::ExecutionContext *context, const uchar *co
MOTH_END_INSTR(CallBuiltinDeleteValue)
MOTH_BEGIN_INSTR(CreateValue)
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
VM::Value *args = stack.data() + argStart;
TEMP(instr.targetTempIndex) = __qmljs_construct_value(context, TEMP(instr.func), args, instr.argc);
MOTH_END_INSTR(CreateValue)
MOTH_BEGIN_INSTR(CreateProperty)
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
VM::Value *args = stack.data() + argStart;
TEMP(instr.targetTempIndex) = __qmljs_construct_property(context, TEMP(instr.base), instr.name, args, instr.argc);
MOTH_END_INSTR(CreateProperty)
MOTH_BEGIN_INSTR(CreateActivationProperty)
TRACE(inline, "property name = %s, argc = %d", instr.name->toQString().toUtf8().constData(), instr.argc);
- quint32 argStart = instr.args - context->lexicalEnvironment->varCount;
+ quint32 argStart = instr.args - context->lexicalEnvironment->variableCount();
VM::Value *args = stack.data() + argStart;
TEMP(instr.targetTempIndex) = __qmljs_construct_activation_property(context, instr.name, args, instr.argc);
MOTH_END_INSTR(CreateActivationProperty)