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 <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-07-13 15:04:27 +02:00
parent f87dc61986
commit 9dc9674c6b
28 changed files with 129 additions and 91 deletions

View File

@@ -201,7 +201,7 @@ private:
const Interpreter::Value *getPropertyValue(const Interpreter::ObjectValue *object,
const QStringList &propertyNames,
const Interpreter::Context *context)
const Interpreter::ContextPtr &context)
{
if (propertyNames.isEmpty() || !object)
return 0;
@@ -422,7 +422,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
const QList<AST::Node *> path = semanticInfo.rangePath(m_interface->position());
LookupContext::Ptr lookupContext = semanticInfo.lookupContext(path);
const Interpreter::Context *context = lookupContext->context();
const Interpreter::ContextPtr &context = lookupContext->context();
const Interpreter::ScopeChain &scopeChain = lookupContext->scopeChain();
// Search for the operator that triggered the completion.