aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-14 15:44:53 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-08-15 09:08:44 +0200
commit0d1e37e9f50b644c88578aee82859990e7378caf (patch)
tree29a142a092f69886ff87f98d8020049cb85a2e16 /src/qml/compiler/qv4compileddata_p.h
parent5f3ef18bf8c3e0e3ba1c80bcdeaece46cbb45c06 (diff)
Fix writing the function offset table and initialize the pointer to the compiled function in the runtime function
Change-Id: I9aed9f394fedc4a4ea334f6ab1b72fe749c64c72 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 67ddfb3bb4..fdd5891850 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -62,6 +62,7 @@ struct ExecutionContext;
namespace CompiledData {
struct String;
+struct Function;
static const char magic_str[] = "qv4cdata";
@@ -88,6 +89,12 @@ struct Unit
return reinterpret_cast<const String*>(reinterpret_cast<const char *>(this) + offset);
}
+ const Function *functionAt(int idx) const {
+ const uint *offsetTable = reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToFunctionTable);
+ const uint offset = offsetTable[idx];
+ return reinterpret_cast<const Function*>(reinterpret_cast<const char *>(this) + offset);
+ }
+
static int calculateSize(uint nStrings, uint nFunctions) { return (sizeof(Unit) + (nStrings + nFunctions) * sizeof(uint) + 7) & ~7; }
};
@@ -251,8 +258,7 @@ struct MasmCompilationUnit : public CompilationUnit
// Coderef + execution engine
- // ### remove
- QV4::Function *rootFunction;
+ QList<QV4::Function *> runtimeFunctions;
};
struct MothCompilationUnit : public CompilationUnit