diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-22 14:54:29 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-23 10:18:24 (GMT) |
commit | 7e7b34fe5acab632c10814b591c80b0a9d613220 (patch) | |
tree | 0f6d1ee151147d8f326e8b37aa2660d567f86852 /src/script | |
parent | 36d365458d54c6168c8003f7348e932e3a4ffc2c (diff) | |
download | Qt-7e7b34fe5acab632c10814b591c80b0a9d613220.zip Qt-7e7b34fe5acab632c10814b591c80b0a9d613220.tar.gz Qt-7e7b34fe5acab632c10814b591c80b0a9d613220.tar.bz2 |
Inline internal QtScript object data() functions
Makes QScriptValue::data() 15% faster.
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/bridge/qscriptobject.cpp | 14 | ||||
-rw-r--r-- | src/script/bridge/qscriptobject_p.h | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp index 4808c7c..1fdf0b1 100644 --- a/src/script/bridge/qscriptobject.cpp +++ b/src/script/bridge/qscriptobject.cpp @@ -70,20 +70,6 @@ QScriptObject::~QScriptObject() delete d; } -JSC::JSValue QScriptObject::data() const -{ - if (!d) - return JSC::JSValue(); - return d->data; -} - -void QScriptObject::setData(JSC::JSValue data) -{ - if (!d) - d = new Data(); - d->data = data; -} - 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 1170709..9dd9d88 100644 --- a/src/script/bridge/qscriptobject_p.h +++ b/src/script/bridge/qscriptobject_p.h @@ -104,8 +104,8 @@ public: return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::ImplementsHasInstance | JSC::OverridesHasInstance)); } - JSC::JSValue data() const; - void setData(JSC::JSValue data); + inline JSC::JSValue data() const; + inline void setData(JSC::JSValue data); inline QScriptObjectDelegate *delegate() const; inline void setDelegate(QScriptObjectDelegate *delegate); @@ -158,6 +158,20 @@ private: Q_DISABLE_COPY(QScriptObjectDelegate) }; +inline JSC::JSValue QScriptObject::data() const +{ + if (!d) + return JSC::JSValue(); + return d->data; +} + +inline void QScriptObject::setData(JSC::JSValue data) +{ + if (!d) + d = new Data(); + d->data = data; +} + inline QScriptObjectDelegate *QScriptObject::delegate() const { if (!d) |