aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 474d4c88bc..d6d2419d74 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -50,6 +50,10 @@
QT_BEGIN_NAMESPACE
+namespace QmlIR {
+struct Document;
+}
+
namespace QV4 {
namespace IR {
struct Function;
@@ -163,6 +167,7 @@ struct Unit
char magic[8];
qint16 architecture;
qint16 version;
+ quint32 unitSize; // Size of the Unit and any depending data. Does _not_ include size of data needed by QmlUnit.
enum {
IsJavascript = 0x1,
@@ -198,8 +203,10 @@ struct Unit
return QString(qstr.constData(), qstr.length());
}
+ const uint *functionOffsetTable() const { return reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToFunctionTable); }
+
const Function *functionAt(int idx) const {
- const uint *offsetTable = reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToFunctionTable);
+ const uint *offsetTable = functionOffsetTable();
const uint offset = offsetTable[idx];
return reinterpret_cast<const Function*>(reinterpret_cast<const char *>(this) + offset);
}
@@ -524,6 +531,7 @@ struct Import
struct QmlUnit
{
Unit header;
+ quint32 qmlUnitSize; // size including header and all surrounding data.
quint32 nImports;
quint32 offsetToImports;
quint32 nObjects;
@@ -578,16 +586,15 @@ struct Q_QML_EXPORT CompilationUnit
QV4::Value *runtimeRegularExpressions;
QV4::InternalClass **runtimeClasses;
QVector<QV4::Function *> runtimeFunctions;
-// QVector<QV4::Function *> runtimeFunctionsSortedByAddress;
+
+ // Called only when building QML, when we build the header for JS first and append QML data
+ virtual QV4::CompiledData::Unit *createUnitData(QmlIR::Document *irDocument);
QV4::Function *linkToEngine(QV4::ExecutionEngine *engine);
void unlink();
virtual QV4::ExecutableAllocator::ChunkOfPages *chunkForFunction(int /*functionIndex*/) { return 0; }
- // ### runtime data
- // pointer to qml data for QML unit
-
void markObjects(QV4::ExecutionEngine *e);
protected: