Add QFastMetaBuilder
[profile/ivi/qtdeclarative.git] / src / declarative / qml / qdeclarativeparser_p.h
index f7b71c4..023cb9c 100644 (file)
@@ -66,6 +66,8 @@
 #include <private/qdeclarativeglobal_p.h>
 #include <private/qdeclarativepool_p.h>
 #include <private/qfieldlist_p.h>
+#include <private/qdeclarativepropertycache_p.h>
+#include <private/qfastmetabuilder_p.h>
 
 QT_BEGIN_HEADER
 
@@ -230,6 +232,10 @@ namespace QDeclarativeParser
         int type;
         // The metaobject index of this property, or -1 if unknown.
         int index;
+        // The core data in the case of a regular property.  
+        // XXX This has to be a value now as the synthCache may change during
+        // compilation which invalidates pointers.  We should fix this.
+        QDeclarativePropertyCache::Data core;
 
         // Returns true if this is an empty property - both value and values
         // are unset.
@@ -245,8 +251,8 @@ namespace QDeclarativeParser
         // Content in value and values are mutually exclusive.
         Object *value;
         // The property name
-        QString name() const { return _name?*_name:QString(); }
-        void setName(const QString &n) { _name = pool()->NewString(n); }
+        QStringRef name() const { return _name; }
+        void setName(const QString &n) { _name = QStringRef(pool()->NewString(n)); }
         // True if this property was accessed as the default property.  
         bool isDefault;
         // True if the setting of this property will be deferred.  Set by the
@@ -272,7 +278,7 @@ namespace QDeclarativeParser
 
     private:
         friend class Object;
-        QString *_name;
+        QStringRef _name;
     };
 
     class Object : public QDeclarativePool::Class
@@ -312,7 +318,7 @@ namespace QDeclarativeParser
 
         Property *getDefaultProperty();
         // name ptr must be guarenteed to remain valid
-        Property *getProperty(const QString *name, bool create=true);
+        Property *getProperty(const QStringRef &name, bool create=true);
         Property *getProperty(const QString &name, bool create=true);
 
         Property *defaultProperty;
@@ -369,6 +375,12 @@ namespace QDeclarativeParser
             QByteArray name;
             QDeclarativeParser::Property *defaultValue;
             LocationSpan location;
+
+            // Used by the compiler
+            QByteArray resolvedCustomTypeName;
+            QFastMetaBuilder::StringRef typeRef;
+            QFastMetaBuilder::StringRef nameRef;
+            QFastMetaBuilder::StringRef changedSignatureRef;
         };
         struct DynamicSignal {
             DynamicSignal();
@@ -377,6 +389,13 @@ namespace QDeclarativeParser
             QByteArray name;
             QList<QByteArray> parameterTypes;
             QList<QByteArray> parameterNames;
+
+            int parameterTypesLength() const;
+            int parameterNamesLength() const;
+
+            // Used by the compiler
+            QFastMetaBuilder::StringRef signatureRef;
+            QFastMetaBuilder::StringRef parameterNamesRef;
         };
         struct DynamicSlot {
             DynamicSlot();
@@ -386,6 +405,12 @@ namespace QDeclarativeParser
             QString body;
             QList<QByteArray> parameterNames;
             LocationSpan location;
+
+            int parameterNamesLength() const;
+
+            // Used by the compiler
+            QFastMetaBuilder::StringRef signatureRef;
+            QFastMetaBuilder::StringRef parameterNamesRef;
         };
 
         // The list of dynamic properties