Rename Managed::managedData() to d() to be consistent
No need to differentiate in the name anymore, as the data structures all inherit from each other now. Change-Id: Ia41f50ce4e521f9626d874311ceb57e0e194888b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
parent
d44cac4028
commit
c9081fab7c
|
@ -382,7 +382,7 @@ void Managed::mark(QV4::ExecutionEngine *engine)
|
|||
Q_ASSERT(inUse());
|
||||
if (markBit())
|
||||
return;
|
||||
managedData()->markBit = 1;
|
||||
d()->markBit = 1;
|
||||
engine->pushForGC(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,8 +112,8 @@ FunctionObject::FunctionObject(InternalClass *ic)
|
|||
d()->scope = ic->engine->rootContext;
|
||||
d()->function = 0;
|
||||
|
||||
managedData()->needsActivation = false;
|
||||
managedData()->strictMode = false;
|
||||
d()->needsActivation = false;
|
||||
d()->strictMode = false;
|
||||
memberData()[Index_Prototype] = Encode::undefined();
|
||||
}
|
||||
|
||||
|
@ -128,8 +128,8 @@ void FunctionObject::init(const StringRef n, bool createProto)
|
|||
Scope s(internalClass()->engine);
|
||||
ScopedValue protectThis(s, this);
|
||||
|
||||
managedData()->needsActivation = true;
|
||||
managedData()->strictMode = false;
|
||||
d()->needsActivation = true;
|
||||
d()->strictMode = false;
|
||||
|
||||
if (createProto) {
|
||||
Scoped<Object> proto(s, scope()->engine->newObject(scope()->engine->protoClass));
|
||||
|
@ -366,8 +366,8 @@ ScriptFunction::ScriptFunction(ExecutionContext *scope, Function *function)
|
|||
Scope s(scope);
|
||||
ScopedValue protectThis(s, this);
|
||||
|
||||
managedData()->needsActivation = function->needsActivation();
|
||||
managedData()->strictMode = function->isStrict();
|
||||
d()->needsActivation = function->needsActivation();
|
||||
d()->strictMode = function->isStrict();
|
||||
|
||||
defineReadonlyProperty(scope->engine->id_length, Primitive::fromInt32(formalParameterCount()));
|
||||
|
||||
|
@ -450,8 +450,8 @@ SimpleScriptFunction::SimpleScriptFunction(ExecutionContext *scope, Function *fu
|
|||
|
||||
ExecutionEngine *v4 = scope->engine;
|
||||
|
||||
managedData()->needsActivation = function->needsActivation();
|
||||
managedData()->strictMode = function->isStrict();
|
||||
d()->needsActivation = function->needsActivation();
|
||||
d()->strictMode = function->isStrict();
|
||||
|
||||
defineReadonlyProperty(scope->engine->id_length, Primitive::fromInt32(formalParameterCount()));
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@ struct Q_QML_EXPORT FunctionObject: Object {
|
|||
|
||||
ReturnedValue protoProperty() { return memberData()[Index_Prototype].asReturnedValue(); }
|
||||
|
||||
bool needsActivation() const { return managedData()->needsActivation; }
|
||||
bool strictMode() const { return managedData()->strictMode; }
|
||||
bool bindingKeyFlag() const { return managedData()->bindingKeyFlag; }
|
||||
bool needsActivation() const { return d()->needsActivation; }
|
||||
bool strictMode() const { return d()->strictMode; }
|
||||
bool bindingKeyFlag() const { return d()->bindingKeyFlag; }
|
||||
|
||||
protected:
|
||||
FunctionObject(InternalClass *ic);
|
||||
|
|
|
@ -409,9 +409,9 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall)
|
|||
if (!function)
|
||||
return Encode::undefined();
|
||||
|
||||
managedData()->strictMode = function->isStrict() || (ctx->strictMode);
|
||||
d()->strictMode = function->isStrict() || (ctx->strictMode);
|
||||
|
||||
managedData()->needsActivation = function->needsActivation();
|
||||
d()->needsActivation = function->needsActivation();
|
||||
|
||||
if (strictMode()) {
|
||||
ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function));
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
String *entry = entries[i];
|
||||
if (!entry || entry->markBit())
|
||||
continue;
|
||||
entry->managedData()->markBit = 1;
|
||||
entry->d()->markBit = 1;
|
||||
Q_ASSERT(entry->internalClass()->vtable->markObjects);
|
||||
entry->internalClass()->vtable->markObjects(entry, e);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ QString Managed::className() const
|
|||
void Managed::setVTable(const ManagedVTable *vt)
|
||||
{
|
||||
Q_ASSERT(internalClass());
|
||||
managedData()->internalClass = internalClass()->changeVTable(vt);
|
||||
d()->internalClass = internalClass()->changeVTable(vt);
|
||||
}
|
||||
|
||||
bool Managed::isEqualTo(Managed *, Managed *)
|
||||
|
|
|
@ -193,10 +193,10 @@ protected:
|
|||
Managed(InternalClass *internal)
|
||||
{
|
||||
Q_ASSERT(internal && internal->vtable);
|
||||
managedData()->internalClass = internal;
|
||||
managedData()->_data = 0;
|
||||
managedData()->inUse = 1;
|
||||
managedData()->extensible = 1;
|
||||
d()->internalClass = internal;
|
||||
d()->_data = 0;
|
||||
d()->inUse = 1;
|
||||
d()->extensible = 1;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -310,17 +310,17 @@ public:
|
|||
};
|
||||
Data data;
|
||||
|
||||
Data *managedData() { return &data; }
|
||||
const Data *managedData() const { return &data; }
|
||||
Data *d() { return &data; }
|
||||
const Data *d() const { return &data; }
|
||||
|
||||
InternalClass *internalClass() const { return managedData()->internalClass; }
|
||||
void setInternalClass(InternalClass *ic) { managedData()->internalClass = ic; }
|
||||
InternalClass *internalClass() const { return d()->internalClass; }
|
||||
void setInternalClass(InternalClass *ic) { d()->internalClass = ic; }
|
||||
|
||||
uchar subtype() const { return managedData()->subtype; }
|
||||
void setSubtype(uchar subtype) const { managedData()->subtype = subtype; }
|
||||
uchar subtype() const { return d()->subtype; }
|
||||
void setSubtype(uchar subtype) const { d()->subtype = subtype; }
|
||||
|
||||
bool inUse() const { return managedData()->inUse; }
|
||||
bool markBit() const { return managedData()->markBit; }
|
||||
bool inUse() const { return d()->inUse; }
|
||||
bool markBit() const { return d()->markBit; }
|
||||
|
||||
static void destroy(Managed *) {}
|
||||
private:
|
||||
|
|
|
@ -363,7 +363,7 @@ void MemoryManager::sweep(bool lastSweep)
|
|||
Managed *m = i->managed();
|
||||
Q_ASSERT(m->inUse());
|
||||
if (m->markBit()) {
|
||||
m->managedData()->markBit = 0;
|
||||
m->d()->markBit = 0;
|
||||
last = &i->next;
|
||||
i = i->next;
|
||||
continue;
|
||||
|
@ -404,7 +404,7 @@ void MemoryManager::sweep(char *chunkStart, std::size_t chunkSize, size_t size)
|
|||
|
||||
if (m->inUse()) {
|
||||
if (m->markBit()) {
|
||||
m->managedData()->markBit = 0;
|
||||
m->d()->markBit = 0;
|
||||
} else {
|
||||
// qDebug() << "-- collecting it." << m << *f << m->nextFree();
|
||||
#ifdef V4_USE_VALGRIND
|
||||
|
|
|
@ -186,11 +186,11 @@ struct Q_QML_EXPORT Object: Managed {
|
|||
|
||||
inline ExecutionEngine *engine() const { return internalClass()->engine; }
|
||||
|
||||
inline bool hasAccessorProperty() const { return managedData()->hasAccessorProperty; }
|
||||
inline void setHasAccessorProperty() { managedData()->hasAccessorProperty = true; }
|
||||
inline bool hasAccessorProperty() const { return d()->hasAccessorProperty; }
|
||||
inline void setHasAccessorProperty() { d()->hasAccessorProperty = true; }
|
||||
|
||||
bool isExtensible() const { return managedData()->extensible; }
|
||||
void setExtensible(bool b) { managedData()->extensible = b; }
|
||||
bool isExtensible() const { return d()->extensible; }
|
||||
void setExtensible(bool b) { d()->extensible = b; }
|
||||
|
||||
// Array handling
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ QmlBindingWrapper::QmlBindingWrapper(ExecutionContext *scope, Function *f, Objec
|
|||
d()->function = f;
|
||||
if (function())
|
||||
function()->compilationUnit->ref();
|
||||
managedData()->needsActivation = function() ? function()->needsActivation() : false;
|
||||
d()->needsActivation = function() ? function()->needsActivation() : false;
|
||||
|
||||
Scope s(scope);
|
||||
ScopedValue protectThis(s, this);
|
||||
|
@ -91,7 +91,7 @@ QmlBindingWrapper::QmlBindingWrapper(ExecutionContext *scope, ObjectRef qml)
|
|||
Q_ASSERT(scope->inUse());
|
||||
|
||||
setVTable(staticVTable());
|
||||
managedData()->needsActivation = false;
|
||||
d()->needsActivation = false;
|
||||
|
||||
Scope s(scope);
|
||||
ScopedValue protectThis(s, this);
|
||||
|
|
|
@ -1179,7 +1179,7 @@ QQmlBindingFunction::QQmlBindingFunction(FunctionObject *originalFunction)
|
|||
{
|
||||
d()->originalFunction = originalFunction;
|
||||
setVTable(staticVTable());
|
||||
managedData()->bindingKeyFlag = true;
|
||||
d()->bindingKeyFlag = true;
|
||||
}
|
||||
|
||||
void QQmlBindingFunction::initBindingLocation()
|
||||
|
|
Loading…
Reference in New Issue