diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-05-03 19:11:53 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-18 05:48:10 +0000 |
commit | 17a336714dcc16e786a619d68d2901e0e93e86a4 (patch) | |
tree | 1c9216cd7fcb98781a87a877d8af47d813ab617a /src | |
parent | 7be7651e9d6699981ed13643eff0aa43ca1bed4e (diff) |
Don't store the qmlscope object in a persistent
This doesn't make sense, as the persistent is never being
used. So either the scope object is being used from somewhere
else in which case it'll be referenced and marked from there,
or it's not being used in which case, we might as well collect it.
Change-Id: I56cb45282cbc795d4c59314c10491dedb9b7d478
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/debugger/qqmlenginedebugservice.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 10 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression_p.h | 6 |
5 files changed, 6 insertions, 16 deletions
diff --git a/src/qml/debugger/qqmlenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp index 7db3d36361..fd7d1c2da4 100644 --- a/src/qml/debugger/qqmlenginedebugservice.cpp +++ b/src/qml/debugger/qqmlenginedebugservice.cpp @@ -752,7 +752,7 @@ bool QQmlEngineDebugService::setMethodBody(int objectId, const QString &method, int lineNumber = vmeMetaObject->vmeMethodLineNumber(prop->coreIndex); QV4::ExecutionEngine *v4 = QV8Engine::getV4(qmlEngine(object)->handle()); QV4::Scope scope(v4); - QV4::ScopedValue v(scope, QQmlExpressionPrivate::evalFunction(contextData, object, jsfunction, contextData->urlString(), lineNumber)); + QV4::ScopedValue v(scope, QQmlJavaScriptExpression::evalFunction(contextData, object, jsfunction, contextData->urlString(), lineNumber)); vmeMetaObject->setVmeMethod(prop->coreIndex, v); return true; } diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 3813281044..e4a36f7580 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -246,7 +246,7 @@ QV4::ReturnedValue QQmlExpressionPrivate::v4value(bool *isUndefined) QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(q->engine())->v4engine(); if (!expressionFunctionValid) { - m_function.set(v4, qmlBinding(context(), scopeObject(), expression, url, line, &qmlscope)); + m_function.set(v4, qmlBinding(context(), scopeObject(), expression, url, line)); expressionFunctionValid = true; } diff --git a/src/qml/qml/qqmlexpression_p.h b/src/qml/qml/qqmlexpression_p.h index 0419c9c11c..2303539194 100644 --- a/src/qml/qml/qqmlexpression_p.h +++ b/src/qml/qml/qqmlexpression_p.h @@ -86,8 +86,6 @@ public: QString expression; - QV4::PersistentValue qmlscope; - QString url; // This is a QString for a reason. QUrls are slooooooow... quint16 line; quint16 column; diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index cc57d855c3..60378a26e7 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -313,8 +313,7 @@ QQmlDelayedError *QQmlJavaScriptExpression::delayedError() QV4::ReturnedValue QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObject, - const QString &code, const QString &filename, quint16 line, - QV4::PersistentValue *qmlscope) + const QString &code, const QString &filename, quint16 line) { QQmlEngine *engine = ctxt->engine; QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); @@ -340,14 +339,11 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje ep->warning(error); return QV4::Encode::undefined(); } - if (qmlscope) - qmlscope->set(v4, qmlScopeObject); return result->asReturnedValue(); } QV4::ReturnedValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, QObject *qmlScope, - const QString &code, const QString &filename, quint16 line, - QV4::PersistentValue *qmlscope) + const QString &code, const QString &filename, quint16 line) { QQmlEngine *engine = ctxt->engine; QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); @@ -373,8 +369,6 @@ QV4::ReturnedValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, Q ep->warning(error); return QV4::Encode::undefined(); } - if (qmlscope) - qmlscope->set(v4, qmlScopeObject); return result->asReturnedValue(); } diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index f846b6570f..c6028d86dc 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -137,13 +137,11 @@ public: static QV4::ReturnedValue evalFunction(QQmlContextData *ctxt, QObject *scope, const QString &code, const QString &filename, - quint16 line, - QV4::PersistentValue *qmlscope = 0); + quint16 line); // doesn't require rewriting the expression static QV4::ReturnedValue qmlBinding(QQmlContextData *ctxt, QObject *scope, const QString &code, - const QString &filename, quint16 line, - QV4::PersistentValue *qmlscope = 0); + const QString &filename, quint16 line); private: friend class QQmlContextData; |