summaryrefslogtreecommitdiffstats
path: root/src/script/bridge
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-01 20:05:57 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-02 08:01:00 (GMT)
commit0b5a81dd9aa153f6cd3a3929ee7ed82ca48f45a5 (patch)
tree872442f35c338ec989bcf60f8691d9c0cda2f420 /src/script/bridge
parent7578f43d0f1358b2ed52b3a5d2b853f26e63aec0 (diff)
downloadQt-0b5a81dd9aa153f6cd3a3929ee7ed82ca48f45a5.zip
Qt-0b5a81dd9aa153f6cd3a3929ee7ed82ca48f45a5.tar.gz
Qt-0b5a81dd9aa153f6cd3a3929ee7ed82ca48f45a5.tar.bz2
Optimize QScriptClass
Do not convert JSC::Identifier to QString to convert it later to JSC::Identivier again Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptclassobject.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp
index c8633ab..fcd0124 100644
--- a/src/script/bridge/qscriptclassobject.cpp
+++ b/src/script/bridge/qscriptclassobject.cpp
@@ -97,8 +97,7 @@ bool ClassObjectDelegate::getOwnPropertySlot(QScriptObject* object,
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
QScriptValue scriptObject = engine->scriptValueFromJSCValue(object);
- QString name(propertyName.ustring());
- QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name);
+ QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName);
uint id = 0;
QScriptClass::QueryFlags flags = m_scriptClass->queryProperty(
scriptObject, scriptName, QScriptClass::HandlesReadAccess, &id);
@@ -116,8 +115,7 @@ void ClassObjectDelegate::put(QScriptObject* object, JSC::ExecState *exec,
{
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
QScriptValue scriptObject = engine->scriptValueFromJSCValue(object);
- QString name(propertyName.ustring());
- QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name);
+ QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName);
uint id = 0;
QScriptClass::QueryFlags flags = m_scriptClass->queryProperty(
scriptObject, scriptName, QScriptClass::HandlesWriteAccess, &id);
@@ -135,8 +133,7 @@ bool ClassObjectDelegate::deleteProperty(QScriptObject* object, JSC::ExecState *
// ### avoid duplication of put()
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
QScriptValue scriptObject = engine->scriptValueFromJSCValue(object);
- QString name(propertyName.ustring());
- QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name);
+ QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName);
uint id = 0;
QScriptClass::QueryFlags flags = m_scriptClass->queryProperty(
scriptObject, scriptName, QScriptClass::HandlesWriteAccess, &id);
@@ -155,8 +152,7 @@ bool ClassObjectDelegate::getPropertyAttributes(const QScriptObject* object, JSC
{
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
QScriptValue scriptObject = engine->scriptValueFromJSCValue(object);
- QString name(propertyName.ustring());
- QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name);
+ QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName);
uint id = 0;
QScriptClass::QueryFlags flags = m_scriptClass->queryProperty(
scriptObject, scriptName, QScriptClass::HandlesReadAccess, &id);