aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-14 10:17:37 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-08-15 09:08:39 +0200
commit5f3ef18bf8c3e0e3ba1c80bcdeaece46cbb45c06 (patch)
tree645b8834e773e408bdb07b33dc8e7733335bf1e3 /src/qml/compiler/qv4compileddata.cpp
parent131964a3b5ac0cb6de5f1d306035003751da907a (diff)
Begin using the compiled data structures for runtime strings
Change-Id: Idbf278a96624bf101df35de40577b38e593f22be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 4c142f41b3..ee198c3074 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -41,6 +41,7 @@
#include "qv4compileddata_p.h"
#include "qv4jsir_p.h"
+#include <private/qv4engine_p.h>
namespace QV4 {
@@ -51,6 +52,28 @@ int Function::calculateSize(QQmlJS::V4IR::Function *f)
return calculateSize(f->formals.size(), f->locals.size(), f->nestedFunctions.size());
}
+CompilationUnit::~CompilationUnit()
+{
+ free(data);
+ free(runtimeIdentifiers);
+}
+
+QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
+{
+ assert(!runtimeIdentifiers);
+ assert(data);
+ runtimeIdentifiers = (QV4::String**)malloc(data->stringTableSize * sizeof(QV4::String*));
+ for (int i = 0; i < data->stringTableSize; ++i)
+ runtimeIdentifiers[i] = engine->newIdentifier(data->stringAt(i)->qString());
+
+ return linkBackendToEngine(engine);
+}
+
+// ### Move to masm
+QV4::Function *MasmCompilationUnit::linkBackendToEngine(ExecutionEngine *engine)
+{
+ return rootFunction;
+}
}