aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljslookupcontext.h
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2011-07-13 15:04:27 +0200
committerChristian Kamm <[email protected]>2011-08-08 12:05:19 +0200
commit9dc9674c6b37909d7d7804cb2102ead15950348a (patch)
tree584db5019c86fd499b3552c8f3577e703f293942 /src/libs/qmljs/qmljslookupcontext.h
parentf87dc6198609abdb58b430cf272a4e6ca7144865 (diff)
QmlJS: Share Context.
Previously Context was not entirely thread safe and had to be copied locally. Now it is thread safe and its lifetime managed by QSharedPointer. The non-safe parts were moved into ScopeChain in a previous commit. Change-Id: I851a93de85cbd6391dbea0fe33b011e2e093addb Reviewed-on: http://codereview.qt.nokia.com/1695 Reviewed-by: Fawzi Mohamed <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljslookupcontext.h')
-rw-r--r--src/libs/qmljs/qmljslookupcontext.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljslookupcontext.h b/src/libs/qmljs/qmljslookupcontext.h
index f71ae802847..12f9f7d6a92 100644
--- a/src/libs/qmljs/qmljslookupcontext.h
+++ b/src/libs/qmljs/qmljslookupcontext.h
@@ -34,7 +34,6 @@
#define QMLJSLOOKUPCONTEXT_H
#include "qmljsdocument.h"
-#include "qmljscontext.h"
#include "parser/qmljsastfwd_p.h"
#include <QtCore/QSharedPointer>
@@ -47,6 +46,8 @@ class LookupContextData;
namespace Interpreter {
class Value;
class Context;
+typedef QSharedPointer<const Context> ContextPtr;
+class ValueOwner;
class ScopeChain;
}
@@ -56,7 +57,7 @@ class QMLJS_EXPORT LookupContext
LookupContext(const Document::Ptr doc, const Snapshot &snapshot, const QList<AST::Node *> &path);
LookupContext(const Document::Ptr doc,
- const Interpreter::Context &context,
+ const Interpreter::ContextPtr &context,
const QList<AST::Node *> &path);
public:
@@ -68,7 +69,7 @@ public:
static Ptr create(const Document::Ptr doc, const Snapshot &snapshot,
const QList<AST::Node *> &path);
static Ptr create(const Document::Ptr doc,
- const Interpreter::Context &context,
+ const Interpreter::ContextPtr &context,
const QList<AST::Node *> &path);
const Interpreter::Value *evaluate(AST::Node *node) const;
@@ -76,7 +77,7 @@ public:
Document::Ptr document() const;
Snapshot snapshot() const;
Interpreter::ValueOwner *valueOwner() const;
- const Interpreter::Context *context() const;
+ const Interpreter::ContextPtr &context() const;
const Interpreter::ScopeChain &scopeChain() const;
private: