aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-15 09:41:09 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-08-15 10:37:29 +0200
commit2aee966baa76f55d9061ed22af7bb0abe4f3541e (patch)
tree25e65e3e9575a3b8fcbb497cfffaf4cce28880ae /src/qml/jsruntime/qv4function.cpp
parent3ccd69b53688d6855d0136873876ed315d99b571 (diff)
Initialize formals and locals from the compiled function data instead of in the isel
Change-Id: I9db976df310a5986ceca66d21efeeae536dbede4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r--src/qml/jsruntime/qv4function.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 6e1645c068..58d2cdd275 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -65,6 +65,25 @@ Function::~Function()
compilationUnit->deref();
}
+void Function::init(CompiledData::CompilationUnit *unit, const CompiledData::Function *function)
+{
+ Q_ASSERT(!compilationUnit);
+ compilationUnit = unit;
+ compilationUnit->ref();
+ compiledFunction = function;
+
+ formals.resize(compiledFunction->nFormals);
+ const quint32 *formalsIndices = compiledFunction->formalsTable();
+ for (int i = 0; i < compiledFunction->nFormals; ++i)
+ formals[i] = engine->newString(unit->data->stringAt(formalsIndices[i])->qString());
+
+
+ locals.resize(compiledFunction->nLocals);
+ const quint32 *localsIndices = compiledFunction->localsTable();
+ for (int i = 0; i < compiledFunction->nLocals; ++i)
+ locals[i] = engine->newString(unit->data->stringAt(localsIndices[i])->qString());
+}
+
void Function::mark()
{
if (name)