diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-28 22:30:04 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-29 14:06:08 +0100 |
commit | cfe24c1aa0f3ec168437cd22e355c28e5e7a4f09 (patch) | |
tree | 7c4f389d7b0a7d5de2074327740aaf0cc0cfadbd /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | 9880e64efa25c1924b95068693ff8664e2f2e121 (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/jsruntime/qv4vme_moth.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 2408ba3f7a..a36d1d870a 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -134,7 +134,7 @@ static VMStats vmStats; #endif // WITH_STATS static inline QV4::Value *getValueRef(QV4::ExecutionContext *context, - QV4::SafeValue* stack, + QV4::SafeValue* stack, const Param ¶m #if !defined(QT_NO_DEBUG) , unsigned stackSize @@ -157,9 +157,10 @@ static inline QV4::Value *getValueRef(QV4::ExecutionContext *context, } #endif // DO_TRACE_INSTR - if (param.isValue()) { + if (param.isConstant()) { VMSTATS(paramIsValue); - return const_cast<QV4::Value *>(&static_cast<const QV4::Value &>(param.value)); + const QV4::SafeValue *v = context->compilationUnit->data->constants() + param.index; + return const_cast<QV4::SafeValue *>(v); } else if (param.isArgument()) { VMSTATS(paramIsArg); QV4::ExecutionContext *c = context; |