summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-10-22 13:51:37 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-10-23 10:18:23 (GMT)
commitcb3544a0c33973cfb662e0215e1b130d23045814 (patch)
tree0f089e0c3439a11908ddeb8f35759ec8b63e583d /src/script
parent6209eb29588801c55891401c82ec17efa310f7f3 (diff)
downloadQt-cb3544a0c33973cfb662e0215e1b130d23045814.zip
Qt-cb3544a0c33973cfb662e0215e1b130d23045814.tar.gz
Qt-cb3544a0c33973cfb662e0215e1b130d23045814.tar.bz2
Inline internal QtScript functions (frameForContext())
Makes QScriptContext::parentContext() 50% faster. Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp10
-rw-r--r--src/script/api/qscriptengine_p.h14
2 files changed, 12 insertions, 12 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 0673f5b..ceaeccb 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -995,16 +995,6 @@ void QScriptEnginePrivate::setDefaultPrototype(int metaTypeId, JSC::JSValue prot
info->prototype = prototype;
}
-JSC::ExecState *QScriptEnginePrivate::frameForContext(QScriptContext *context)
-{
- return reinterpret_cast<JSC::ExecState*>(context);
-}
-
-const JSC::ExecState *QScriptEnginePrivate::frameForContext(const QScriptContext *context)
-{
- return reinterpret_cast<const JSC::ExecState*>(context);
-}
-
JSC::JSGlobalObject *QScriptEnginePrivate::originalGlobalObject() const
{
return globalData->head;
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 42c0444..02cf100 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -148,8 +148,8 @@ public:
void setDefaultPrototype(int metaTypeId, JSC::JSValue prototype);
static inline QScriptContext *contextForFrame(JSC::ExecState *frame);
- static JSC::ExecState *frameForContext(QScriptContext *context);
- static const JSC::ExecState *frameForContext(const QScriptContext *context);
+ static inline JSC::ExecState *frameForContext(QScriptContext *context);
+ static inline const JSC::ExecState *frameForContext(const QScriptContext *context);
JSC::JSGlobalObject *originalGlobalObject() const;
JSC::JSObject *getOriginalGlobalObjectProxy();
@@ -522,6 +522,16 @@ inline QScriptContext *QScriptEnginePrivate::contextForFrame(JSC::ExecState *fra
return reinterpret_cast<QScriptContext *>(frame);
}
+inline JSC::ExecState *QScriptEnginePrivate::frameForContext(QScriptContext *context)
+{
+ return reinterpret_cast<JSC::ExecState*>(context);
+}
+
+inline const JSC::ExecState *QScriptEnginePrivate::frameForContext(const QScriptContext *context)
+{
+ return reinterpret_cast<const JSC::ExecState*>(context);
+}
+
inline JSC::ExecState *QScriptEnginePrivate::globalExec() const
{
return originalGlobalObject()->globalExec();