diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-07-04 12:41:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-04 07:27:11 +0200 |
commit | 71114ff964582f58e68d68bf0301cd42110751cc (patch) | |
tree | e3ad3d3e1af59ef9dc32aa28ce12a6d70a89a03a /src/declarative/qml/v8 | |
parent | 8371e37e47967848ec470a4b34f46b1c8591c3c1 (diff) |
Optimize QDeclarativePropertyCache
The creation of QDeclarativePropertyCaches contributes significantly
to the initial compile time of a QML app.
Change-Id: Iac5d1578155dfa4678a0e21eab51f4c1675762a9
Reviewed-on: http://codereview.qt.nokia.com/1026
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8')
-rw-r--r-- | src/declarative/qml/v8/qv8qobjectwrapper.cpp | 10 | ||||
-rw-r--r-- | src/declarative/qml/v8/qv8valuetypewrapper.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index 7e5bd4ecbd..e59df8dc53 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -436,9 +436,9 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject typedef QDeclarativeEnginePrivate::CapturedProperty CapturedProperty; if (result->isFunction()) { - if (result->flags & QDeclarativePropertyCache::Data::IsVMEFunction) { + if (result->isVMEFunction()) { return ((QDeclarativeVMEMetaObject *)(object->metaObject()))->vmeMethod(result->coreIndex); - } else if (result->flags & QDeclarativePropertyCache::Data::IsV8Function) { + } else if (result->isV8Function()) { return MethodClosure::createWithGlobal(engine, object, objectHandle, result->coreIndex); } else { return MethodClosure::create(engine, object, objectHandle, result->coreIndex); @@ -1558,7 +1558,7 @@ static const QDeclarativePropertyCache::Data * RelatedMethod(QObject *object, static v8::Handle<v8::Value> CallPrecise(QObject *object, const QDeclarativePropertyCache::Data &data, QV8Engine *engine, CallArgs &callArgs) { - if (data.flags & QDeclarativePropertyCache::Data::HasArguments) { + if (data.hasArguments()) { QMetaMethod m = object->metaObject()->method(data.coreIndex); QList<QByteArray> argTypeNames = m.parameterTypes(); @@ -1620,7 +1620,7 @@ static v8::Handle<v8::Value> CallOverloaded(QObject *object, const QDeclarativeP do { QList<QByteArray> methodArgTypeNames; - if (attempt->flags & QDeclarativePropertyCache::Data::HasArguments) + if (attempt->hasArguments()) methodArgTypeNames = object->metaObject()->method(attempt->coreIndex).parameterTypes(); int methodArgumentCount = methodArgTypeNames.count(); @@ -1780,7 +1780,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Invoke(const v8::Arguments &args) return v8::Undefined(); } - if (method.flags & QDeclarativePropertyCache::Data::IsV8Function) { + if (method.isV8Function()) { v8::Handle<v8::Value> rv; v8::Handle<v8::Object> qmlglobal = args[2]->ToObject(); diff --git a/src/declarative/qml/v8/qv8valuetypewrapper.cpp b/src/declarative/qml/v8/qv8valuetypewrapper.cpp index f4f79ce92e..f3100cf7b5 100644 --- a/src/declarative/qml/v8/qv8valuetypewrapper.cpp +++ b/src/declarative/qml/v8/qv8valuetypewrapper.cpp @@ -231,7 +231,7 @@ v8::Handle<v8::Value> QV8ValueTypeWrapper::Setter(v8::Local<v8::String> property v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(value); QDeclarativePropertyCache::Data cacheData; - cacheData.flags = QDeclarativePropertyCache::Data::IsWritable; + cacheData.setFlags(QDeclarativePropertyCache::Data::IsWritable); cacheData.propType = reference->object->metaObject()->property(reference->property).userType(); cacheData.coreIndex = reference->property; |