aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-01-09 12:30:01 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2015-01-12 11:04:17 +0100
commit462496c2bbf9a35ce13762af8830cb2f87b0c27e (patch)
tree807d3169aeaae4088d7d60cd861ab587bcf3f6d8 /src/qml/jsruntime
parent5e8008dcbff056eecdca779153804bf3cd5acf85 (diff)
Get rid of the needsActivation flag in Heap::Base
Change-Id: Idcec374cb6d16aabf919c23d7236b76d9d047527 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4context.cpp2
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h3
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4script.cpp2
-rw-r--r--src/qml/jsruntime/qv4value_p.h2
6 files changed, 4 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index f6d27347f6..0caaf33501 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -245,7 +245,7 @@ bool ExecutionContext::deleteProperty(String *name)
bool CallContext::needsOwnArguments() const
{
- return d()->function->needsActivation || d()->callData->argc < static_cast<int>(d()->function->formalParameterCount());
+ return d()->function->needsActivation() || d()->callData->argc < static_cast<int>(d()->function->formalParameterCount());
}
void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine)
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index f70ddb04d4..200d9550b9 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -144,8 +144,6 @@ void FunctionObject::init(String *n, bool createProto)
Scope s(internalClass()->engine);
ScopedValue protectThis(s, this);
- d()->needsActivation = true;
-
ensureMemberIndex(s.engine, Heap::FunctionObject::Index_Prototype);
if (createProto) {
ScopedObject proto(s, scope()->engine->newObject(s.engine->protoClass, s.engine->objectPrototype.asObject()));
@@ -456,8 +454,6 @@ Heap::SimpleScriptFunction::SimpleScriptFunction(QV4::ExecutionContext *scope, F
Q_ASSERT(function);
Q_ASSERT(function->code);
- needsActivation = function->needsActivation();
-
// global function
if (!scope)
return;
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index d3053ce283..2ccec8efd1 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -68,6 +68,7 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object {
unsigned int formalParameterCount() { return function ? function->compiledFunction->nFormals : 0; }
unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; }
+ bool needsActivation() const { return function ? function->needsActivation() : false; }
ExecutionContext *scope;
Function *function;
@@ -141,7 +142,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
ReturnedValue protoProperty() { return memberData()->data[Heap::FunctionObject::Index_Prototype].asReturnedValue(); }
- bool needsActivation() const { return d()->needsActivation; }
+ bool needsActivation() const { return d()->needsActivation(); }
bool strictMode() const { return d()->function ? d()->function->isStrict() : false; }
bool isBinding() const;
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index 7669fa82bb..c521337ce6 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -383,8 +383,6 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall)
if (!function)
return Encode::undefined();
- d()->needsActivation = function->needsActivation();
-
if (function->isStrict() || (ctx->d()->strictMode)) {
ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function));
ScopedCallData callData(scope, 0);
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 4337fc1101..6882061f6b 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -97,7 +97,6 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio
function = f;
if (function)
function->compilationUnit->addref();
- needsActivation = function ? function->needsActivation() : false;
Scope s(scope);
Scoped<QV4::QmlBindingWrapper> o(s, this);
@@ -116,7 +115,6 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::Ob
Q_ASSERT(scope->inUse());
setVTable(QV4::QmlBindingWrapper::staticVTable());
- needsActivation = false;
Scope s(scope);
Scoped<QV4::QmlBindingWrapper> o(s, this);
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 6a67719464..1a5ccb8e29 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -61,7 +61,7 @@ struct Q_QML_EXPORT Base {
uchar markBit : 1;
uchar inUse : 1;
uchar extensible : 1; // used by Object
- uchar needsActivation : 1; // used by FunctionObject
+ uchar _needsActivation : 1; // used by FunctionObject
uchar _strictMode : 1; // used by FunctionObject
uchar _bindingKeyFlag : 1;
uchar hasAccessorProperty : 1;