aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4instr_moth_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-28 22:30:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 14:06:08 +0100
commitcfe24c1aa0f3ec168437cd22e355c28e5e7a4f09 (patch)
tree7c4f389d7b0a7d5de2074327740aaf0cc0cfadbd /src/qml/compiler/qv4instr_moth_p.h
parent9880e64efa25c1924b95068693ff8664e2f2e121 (diff)
Move constants into the compiled data for the interpreter
This makes it possible to remove the Value stored as part of the instruction stream. Reduces the size of the instruction stream and will allow to optimize Param lookup. Change-Id: I23dab5dbed76bf8d62df7042934064d4676bc43d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index f9a46a06d7..795576b2a9 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -125,29 +125,28 @@ namespace Moth {
struct Param {
enum {
- ValueType = 0,
+ ConstantType = 0,
ArgumentType = 1,
LocalType = 2,
TempType = 3,
ScopedLocalType = 4
};
- QV4::Primitive value;
unsigned type : 3;
unsigned scope : 29;
unsigned index;
- bool isValue() const { return type == ValueType; }
+ bool isConstant() const { return type == ConstantType; }
bool isArgument() const { return type == ArgumentType; }
bool isLocal() const { return type == LocalType; }
bool isTemp() const { return type == TempType; }
bool isScopedLocal() const { return type == ScopedLocalType; }
- static Param createValue(const QV4::Primitive &v)
+ static Param createConstant(int index)
{
Param p;
- p.type = ValueType;
+ p.type = ConstantType;
p.scope = 0;
- p.value = v;
+ p.index = index;
return p;
}