summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsevaluate.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-11-21 14:51:03 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2011-11-25 10:36:42 +0100
commit097850c842ce872d31716ddb528ebfad346475da (patch)
treefcbf558b7c37f1f4bb2bb3ea0bcf398d5a7f2b32 /src/libs/qmljs/qmljsevaluate.cpp
parente2b0835b58aefdab91edda097c1180dae08058f6 (diff)
downloadqt-creator-097850c842ce872d31716ddb528ebfad346475da.tar.gz
QmlJS: Speed up ValueOwner construction.
* Don't build all default values (including the global object) separately for each ValueOwner instance. * Instead, keep all global, immutable values in a single, shared instance. While refactoring, some cases where we *modified* the global object had to be removed: * C++ context properties no longer get injected into the global object, instead they now have their own scope just above the global one. * The Qt object's prototype no longer gets modified in Link. Instead, it's now a reference to the "Qt" object provided in a qmltypes file. * The whole concept of a function 'Activation' that could potentially affect the global object was removed. Change-Id: Id382faf965efa747fcc7a9b0bc2c90429d84d61b Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/libs/qmljs/qmljsevaluate.cpp')
-rw-r--r--src/libs/qmljs/qmljsevaluate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljsevaluate.cpp b/src/libs/qmljs/qmljsevaluate.cpp
index d5eddd7846..69a1abe22d 100644
--- a/src/libs/qmljs/qmljsevaluate.cpp
+++ b/src/libs/qmljs/qmljsevaluate.cpp
@@ -273,13 +273,13 @@ bool Evaluate::visit(AST::NumericLiteral *)
bool Evaluate::visit(AST::RegExpLiteral *)
{
- _result = _valueOwner->regexpCtor()->construct();
+ _result = _valueOwner->regexpCtor()->returnValue();
return false;
}
bool Evaluate::visit(AST::ArrayLiteral *)
{
- _result = _valueOwner->arrayCtor()->construct();
+ _result = _valueOwner->arrayCtor()->returnValue();
return false;
}
@@ -347,7 +347,7 @@ bool Evaluate::visit(AST::FieldMemberExpression *ast)
bool Evaluate::visit(AST::NewMemberExpression *ast)
{
if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->base))) {
- _result = ctor->construct();
+ _result = ctor->returnValue();
}
return false;
}
@@ -355,7 +355,7 @@ bool Evaluate::visit(AST::NewMemberExpression *ast)
bool Evaluate::visit(AST::NewExpression *ast)
{
if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->expression))) {
- _result = ctor->construct();
+ _result = ctor->returnValue();
}
return false;
}