summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/rulesevaluationcontext.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2012-11-30 10:45:50 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2012-12-05 11:10:57 +0100
commita42474e5ce1c06ef2bfdc5d0ce8098b8e43be22b (patch)
tree595d3b7122b67bd7efdc5fdf21fbf5cd94426160 /src/lib/buildgraph/rulesevaluationcontext.h
parentc552cb2ab5c3be9d2c6209b076a71c9e37209c29 (diff)
downloadqbs-a42474e5ce1c06ef2bfdc5d0ce8098b8e43be22b.tar.gz
Some engine-related optimizations.
- Re-enable script program cache; it is safe to use now. - Create a new evaluation context only for the first build of a project. - To help with all of this, use a shared pointer for RulesEvaluationContext, as it does not have a clear owner. Change-Id: I90a7fcaf855573b756f29daff37038e98aa7c1fe Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/rulesevaluationcontext.h')
-rw-r--r--src/lib/buildgraph/rulesevaluationcontext.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/buildgraph/rulesevaluationcontext.h b/src/lib/buildgraph/rulesevaluationcontext.h
index 2395cc34f..cc253f5ed 100644
--- a/src/lib/buildgraph/rulesevaluationcontext.h
+++ b/src/lib/buildgraph/rulesevaluationcontext.h
@@ -31,7 +31,10 @@
#include <language/forward_decls.h>
+#include <QHash>
+#include <QScriptProgram>
#include <QScriptValue>
+#include <QString>
namespace qbs {
namespace Internal {
@@ -56,6 +59,7 @@ public:
ScriptEngine *engine() const { return m_engine; }
QScriptValue scope() const { return m_scope; }
+ QScriptProgram scriptProgram(const QString &script);
void setObserver(ProgressObserver *observer) { m_observer = observer; }
void initializeObserver(const QString &description, int maximumProgress);
@@ -73,6 +77,7 @@ private:
unsigned int m_initScopeCalls;
QScriptValue m_scope;
QScriptValue m_prepareScriptScope;
+ QHash<QString, QScriptProgram> m_scriptHash;
};
} // namespace Internal