/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
//
#include <QtCore/qglobal.h>
+#include <private/qdeclarativepropertycache_p.h>
QT_BEGIN_NAMESPACE
#define FOR_EACH_QML_INSTR(F) \
F(Init, init) \
+ F(DeferInit, deferInit) \
F(Done, common) \
- F(CreateObject, create) \
+ F(CreateCppObject, create) \
+ F(CreateQMLObject, createQml) \
+ F(CompleteQMLObject, completeQml) \
F(CreateSimpleObject, createSimple) \
F(SetId, setId) \
F(SetDefault, common) \
F(StoreVariantInteger, storeInteger) \
F(StoreVariantDouble, storeDouble) \
F(StoreVariantBool, storeBool) \
+ F(StoreVar, storeString) \
+ F(StoreVarInteger, storeInteger) \
+ F(StoreVarDouble, storeDouble) \
+ F(StoreVarBool, storeBool) \
F(StoreString, storeString) \
+ F(StoreStringList, storeString) \
+ F(StoreStringQList, storeString) \
+ F(StoreTrString, storeTrString) \
+ F(StoreTrIdString, storeTrIdString) \
F(StoreByteArray, storeByteArray) \
F(StoreUrl, storeUrl) \
+ F(StoreUrlQList, storeUrl) \
F(StoreFloat, storeFloat) \
F(StoreDouble, storeDouble) \
+ F(StoreDoubleQList, storeDouble) \
F(StoreBool, storeBool) \
+ F(StoreBoolQList, storeBool) \
F(StoreInteger, storeInteger) \
+ F(StoreIntegerQList, storeInteger) \
F(StoreColor, storeColor) \
F(StoreDate, storeDate) \
F(StoreTime, storeTime) \
F(StoreRect, storeRect) \
F(StoreRectF, storeRectF) \
F(StoreVector3D, storeVector3D) \
+ F(StoreVector4D, storeVector4D) \
F(StoreObject, storeObject) \
F(AssignCustomType, assignCustomType) \
F(AssignSignalObject, assignSignalObject) \
F(InitV8Bindings, initV8Bindings) \
F(StoreBinding, assignBinding) \
F(StoreBindingOnAlias, assignBinding) \
- F(StoreV4Binding, assignBinding) \
F(StoreV8Binding, assignBinding) \
+ F(StoreV4Binding, assignV4Binding) \
F(StoreValueSource, assignValueSource) \
F(StoreValueInterceptor, assignValueInterceptor) \
F(StoreObjectQList, common) \
F(AssignObjectList, assignObjectList) \
F(StoreVariantObject, storeObject) \
+ F(StoreVarObject, storeObject) \
F(StoreInterface, storeObject) \
F(FetchAttached, fetchAttached) \
F(FetchQList, fetchQmlList) \
F(FetchValueType, fetchValue) \
F(PopValueType, fetchValue)
+#if defined(Q_CC_GNU) && (!defined(Q_CC_INTEL) || __INTEL_COMPILER >= 1200)
+# define QML_THREADED_VME_INTERPRETER
+#endif
+
#ifdef Q_ALIGNOF
# define QML_INSTR_ALIGN_MASK (Q_ALIGNOF(QDeclarativeInstruction) - 1)
#else
# define QML_INSTR_ALIGN_MASK (sizeof(void *) - 1)
#endif
-#define QML_INSTR_HEADER quint8 instructionType;
+#ifdef QML_THREADED_VME_INTERPRETER
+# define QML_INSTR_HEADER void *code;
+#else
+# define QML_INSTR_HEADER quint8 instructionType;
+#endif
+
#define QML_INSTR_ENUM(I, FMT) I,
#define QML_INSTR_SIZE(I, FMT) ((sizeof(QDeclarativeInstruction::instr_##FMT) + QML_INSTR_ALIGN_MASK) & ~QML_INSTR_ALIGN_MASK)
FOR_EACH_QML_INSTR(QML_INSTR_ENUM)
};
- inline void setType(Type type) { common.instructionType = type; }
- inline Type type() const { return (Type)common.instructionType; }
-
struct instr_common {
QML_INSTR_HEADER
};
int parserStatusSize;
int contextCache;
int compiledBinding;
+ int objectStackSize;
+ int listStackSize;
+ };
+ struct instr_deferInit {
+ QML_INSTR_HEADER
+ int bindingsSize;
+ int parserStatusSize;
+ int objectStackSize;
+ int listStackSize;
+ };
+ struct instr_createQml {
+ QML_INSTR_HEADER
+ int type;
+ int bindingBits;
+ bool isRoot;
+ };
+ struct instr_completeQml {
+ QML_INSTR_HEADER
+ ushort column;
+ ushort line;
+ bool isRoot;
};
struct instr_create {
QML_INSTR_HEADER
int type;
int data;
- int bindingBits;
ushort column;
ushort line;
+ bool isRoot;
};
struct instr_createSimple {
QML_INSTR_HEADER
};
struct instr_assignValueSource {
QML_INSTR_HEADER
- int property;
+ QDeclarativePropertyRawData property;
int owner;
int castValue;
};
struct instr_assignValueInterceptor {
QML_INSTR_HEADER
- int property;
+ QDeclarativePropertyRawData property;
int owner;
int castValue;
};
ushort programIndex;
ushort line;
};
- struct instr_assignBinding {
+ struct instr_assignV4Binding {
QML_INSTR_HEADER
unsigned int property;
int value;
short context;
short owner;
+ bool isRoot;
+ ushort line;
+ ushort column;
+ };
+ struct instr_assignBinding {
+ QML_INSTR_HEADER
+ QDeclarativePropertyRawData property;
+ int value;
+ short context;
+ short owner;
+ bool isRoot;
ushort line;
+ ushort column;
};
struct instr_fetch {
QML_INSTR_HEADER
int propertyIndex;
int value;
};
+ struct instr_storeTrString {
+ QML_INSTR_HEADER
+ int propertyIndex;
+ int context;
+ int text;
+ int comment;
+ int n;
+ };
+ struct instr_storeTrIdString {
+ QML_INSTR_HEADER
+ int propertyIndex;
+ int text;
+ int n;
+ };
struct instr_storeByteArray {
QML_INSTR_HEADER
int propertyIndex;
int scope;
int bindingId;
ushort line;
+ ushort column;
};
struct instr_storeScript {
QML_INSTR_HEADER
QML_INSTR_HEADER
int propertyIndex;
struct QRect {
-#if defined(Q_OS_MAC)
- int y1;
- int x1;
- int y2;
- int x2;
-#else
int x1;
int y1;
int x2;
int y2;
-#endif
} rect;
};
struct instr_storeRectF {
int signalIndex;
int value;
short context;
- int name;
ushort line;
+ ushort column;
};
struct instr_assignSignalObject {
QML_INSTR_HEADER
int metaObject;
ushort column;
ushort line;
+ bool isRoot;
};
struct instr_fetchAttached {
QML_INSTR_HEADER
float zp;
} vector;
};
+ struct instr_storeVector4D {
+ QML_INSTR_HEADER
+ int propertyIndex;
+ struct QVector4D {
+ float xp;
+ float yp;
+ float zp;
+ float wp;
+ } vector;
+ };
instr_common common;
instr_init init;
+ instr_deferInit deferInit;
instr_create create;
+ instr_createQml createQml;
+ instr_completeQml completeQml;
instr_createSimple createSimple;
instr_storeMeta storeMeta;
instr_setId setId;
instr_assignValueSource assignValueSource;
instr_assignValueInterceptor assignValueInterceptor;
instr_initV8Bindings initV8Bindings;
+ instr_assignV4Binding assignV4Binding;
instr_assignBinding assignBinding;
instr_fetch fetch;
instr_fetchValue fetchValue;
instr_storeInteger storeInteger;
instr_storeBool storeBool;
instr_storeString storeString;
+ instr_storeTrString storeTrString;
+ instr_storeTrIdString storeTrIdString;
instr_storeByteArray storeByteArray;
instr_storeScriptString storeScriptString;
instr_storeScript storeScript;
instr_storeRect storeRect;
instr_storeRectF storeRectF;
instr_storeVector3D storeVector3D;
+ instr_storeVector4D storeVector4D;
instr_storeObject storeObject;
instr_assignCustomType assignCustomType;
instr_storeSignal storeSignal;
instr_defer defer;
instr_assignObjectList assignObjectList;
- int size() const;
+ static int size(Type type);
};
template<int N>
enum { Size = QML_INSTR_SIZE(I, FMT) }; \
typedef QDeclarativeInstruction::instr_##FMT DataType; \
static const DataType &data(const QDeclarativeInstruction &instr) { return instr.FMT; } \
+ static void setData(QDeclarativeInstruction &instr, const DataType &v) { instr.FMT = v; } \
};
FOR_EACH_QML_INSTR(QML_INSTR_META_TEMPLATE);
#undef QML_INSTR_META_TEMPLATE
+template<int Instr>
+class QDeclarativeInstructionData : public QDeclarativeInstructionMeta<Instr>::DataType
+{
+};
+
QT_END_NAMESPACE
#endif // QDECLARATIVEINSTRUCTION_P_H