summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-10-22 16:47:04 +0200
committerKent Hansen <khansen@trolltech.com>2009-10-23 12:18:24 +0200
commit36d365458d54c6168c8003f7348e932e3a4ffc2c (patch)
tree18fbb941678c7c7bd7a58d122df64a4b238f67ce /src/script
parent4d318525c9663a46d36b27605143dab3250d2b9b (diff)
downloadqt4-tools-36d365458d54c6168c8003f7348e932e3a4ffc2c.tar.gz
Inline internal QtScript object delegate functions
Makes QScriptValue::scriptClass() 20% faster. Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script')
-rw-r--r--src/script/bridge/qscriptclassobject.cpp11
-rw-r--r--src/script/bridge/qscriptclassobject_p.h15
-rw-r--r--src/script/bridge/qscriptobject.cpp16
-rw-r--r--src/script/bridge/qscriptobject_p.h20
4 files changed, 31 insertions, 31 deletions
diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp
index 0d885320d9..1dde98b6d7 100644
--- a/src/script/bridge/qscriptclassobject.cpp
+++ b/src/script/bridge/qscriptclassobject.cpp
@@ -70,17 +70,6 @@ ClassObjectDelegate::~ClassObjectDelegate()
{
}
-QScriptClass *ClassObjectDelegate::scriptClass() const
-{
- return m_scriptClass;
-}
-
-void ClassObjectDelegate::setScriptClass(QScriptClass *scriptClass)
-{
- Q_ASSERT(scriptClass != 0);
- m_scriptClass = scriptClass;
-}
-
QScriptObjectDelegate::Type ClassObjectDelegate::type() const
{
return ClassObject;
diff --git a/src/script/bridge/qscriptclassobject_p.h b/src/script/bridge/qscriptclassobject_p.h
index f5cce76a27..9b342449ad 100644
--- a/src/script/bridge/qscriptclassobject_p.h
+++ b/src/script/bridge/qscriptclassobject_p.h
@@ -70,8 +70,8 @@ public:
ClassObjectDelegate(QScriptClass *scriptClass);
~ClassObjectDelegate();
- QScriptClass *scriptClass() const;
- void setScriptClass(QScriptClass *scriptClass);
+ inline QScriptClass *scriptClass() const;
+ inline void setScriptClass(QScriptClass *scriptClass);
virtual Type type() const;
@@ -105,6 +105,17 @@ private:
QScriptClass *m_scriptClass;
};
+inline QScriptClass *ClassObjectDelegate::scriptClass() const
+{
+ return m_scriptClass;
+}
+
+inline void ClassObjectDelegate::setScriptClass(QScriptClass *scriptClass)
+{
+ Q_ASSERT(scriptClass != 0);
+ m_scriptClass = scriptClass;
+}
+
} // namespace QScript
QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index 55644fe95a..4808c7cfca 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -84,22 +84,6 @@ void QScriptObject::setData(JSC::JSValue data)
d->data = data;
}
-QScriptObjectDelegate *QScriptObject::delegate() const
-{
- if (!d)
- return 0;
- return d->delegate;
-}
-
-void QScriptObject::setDelegate(QScriptObjectDelegate *delegate)
-{
- if (!d)
- d = new Data();
- else
- delete d->delegate;
- d->delegate = delegate;
-}
-
bool QScriptObject::getOwnPropertySlot(JSC::ExecState* exec,
const JSC::Identifier& propertyName,
JSC::PropertySlot& slot)
diff --git a/src/script/bridge/qscriptobject_p.h b/src/script/bridge/qscriptobject_p.h
index c1cee31845..1170709cf3 100644
--- a/src/script/bridge/qscriptobject_p.h
+++ b/src/script/bridge/qscriptobject_p.h
@@ -107,8 +107,8 @@ public:
JSC::JSValue data() const;
void setData(JSC::JSValue data);
- QScriptObjectDelegate *delegate() const;
- void setDelegate(QScriptObjectDelegate *delegate);
+ inline QScriptObjectDelegate *delegate() const;
+ inline void setDelegate(QScriptObjectDelegate *delegate);
protected:
Data *d;
@@ -158,6 +158,22 @@ private:
Q_DISABLE_COPY(QScriptObjectDelegate)
};
+inline QScriptObjectDelegate *QScriptObject::delegate() const
+{
+ if (!d)
+ return 0;
+ return d->delegate;
+}
+
+inline void QScriptObject::setDelegate(QScriptObjectDelegate *delegate)
+{
+ if (!d)
+ d = new Data();
+ else
+ delete d->delegate;
+ d->delegate = delegate;
+}
+
QT_END_NAMESPACE
#endif