diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-17 15:56:30 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:21 +0200 |
commit | b3fab495f514a3bd2d335276a022c0f3678f1cc4 (patch) | |
tree | 3b6f6e17f4addd94bd95bf3fe3945c5398a05446 /src/qml/jsruntime | |
parent | 659e06f3a0c5a72154306c16abfeb177b2572e43 (diff) |
Cleanup: Get rid of __data members
These are not needed anymore
Change-Id: Ib834aa294e84ca9fbdd5b6850d5bc172e8b54ba1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
22 files changed, 18 insertions, 200 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h index cc3a70d0c3..59ab9f020e 100644 --- a/src/qml/jsruntime/qv4argumentsobject_p.h +++ b/src/qml/jsruntime/qv4argumentsobject_p.h @@ -59,9 +59,6 @@ struct ArgumentsGetterFunction: FunctionObject } uint index; }; - struct { - uint index; - } __data; V4_OBJECT(FunctionObject) uint index() const { return d()->index; } @@ -80,9 +77,6 @@ struct ArgumentsSetterFunction: FunctionObject } uint index; }; - struct { - uint index; - } __data; V4_OBJECT(FunctionObject) uint index() const { return d()->index; } @@ -98,11 +92,6 @@ struct ArgumentsObject: Object { bool fullyCreated; Members mappedArguments; }; - struct { - CallContext *context; - bool fullyCreated; - Members mappedArguments; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(ArgumentsObject) diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index cd0925092e..f56c31b177 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -131,23 +131,23 @@ void ArrayData::realloc(Object *o, Type newType, uint offset, uint alloc, bool e size += alloc*sizeof(PropertyAttributes); if (newType < Sparse) { - size += sizeof(SimpleArrayData); + size += sizeof(SimpleArrayData::Data); SimpleArrayData *newData = static_cast<SimpleArrayData *>(o->engine()->memoryManager->allocManaged(size)); new (newData->d()) SimpleArrayData::Data(o->engine()); newData->setAlloc(alloc - offset); newData->setType(newType); - newData->setArrayData(reinterpret_cast<Value *>(newData + 1) + offset); + newData->setArrayData(reinterpret_cast<Value *>(newData->d() + 1) + offset); newData->setAttrs(enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->arrayData() + alloc) + offset : 0); newData->offset() = offset; newData->len() = d ? static_cast<SimpleArrayData *>(d)->len() : 0; o->setArrayData(newData); } else { - size += sizeof(SparseArrayData); + size += sizeof(SparseArrayData::Data); SparseArrayData *newData = static_cast<SparseArrayData *>(o->engine()->memoryManager->allocManaged(size)); new (newData->d()) SparseArrayData::Data(o->engine()); newData->setAlloc(alloc); newData->setType(newType); - newData->setArrayData(reinterpret_cast<Value *>(newData + 1)); + newData->setArrayData(reinterpret_cast<Value *>(newData->d() + 1)); newData->setAttrs(enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->arrayData() + alloc) : 0); o->setArrayData(newData); } diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index c95f9b598d..aab9157ced 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -100,12 +100,6 @@ struct Q_QML_EXPORT ArrayData : public Managed PropertyAttributes *attrs; Value *arrayData; }; - struct { - uint alloc; - Type type; - PropertyAttributes *attrs; - Value *arrayData; - } __data; V4_MANAGED(Managed) uint alloc() const { return d()->alloc; } @@ -167,10 +161,6 @@ struct Q_QML_EXPORT SimpleArrayData : public ArrayData uint len; uint offset; }; - struct { - uint len; - uint offset; - } __data; V4_ARRAYDATA uint &len() { return d()->len; } @@ -205,10 +195,6 @@ struct Q_QML_EXPORT SparseArrayData : public ArrayData uint freeList; SparseArray *sparse; }; - struct { - uint freeList; - SparseArray *sparse; - } __data; V4_ARRAYDATA uint &freeList() { return d()->freeList; } diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 7d816f947e..7e67028364 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -117,22 +117,6 @@ struct Q_QML_EXPORT ExecutionContext : public Managed int lineNumber; }; - struct { - ContextType type; - bool strictMode; - - CallData *callData; - - ExecutionEngine *engine; - ExecutionContext *parent; - ExecutionContext *outer; - Lookup *lookups; - CompiledData::CompilationUnit *compilationUnit; - EvalCode *currentEvalCode; - - int lineNumber; - } __data; - V4_MANAGED(Managed) Q_MANAGED_TYPE(ExecutionContext) @@ -202,12 +186,6 @@ struct CallContext : public ExecutionContext Value *locals; Object *activation; }; - struct { - FunctionObject *function; - int realArgumentCount; - Value *locals; - Object *activation; - } __data; V4_MANAGED(ExecutionContext) // formals are in reverse order @@ -230,9 +208,6 @@ struct GlobalContext : public ExecutionContext Data(ExecutionEngine *engine); Object *global; }; - struct { - Object *global; - } __data; V4_MANAGED(ExecutionContext) }; @@ -244,10 +219,6 @@ struct CatchContext : public ExecutionContext StringValue exceptionVarName; Value exceptionValue; }; - struct { - StringValue exceptionVarName; - Value exceptionValue; - } __data; V4_MANAGED(ExecutionContext) }; @@ -257,9 +228,6 @@ struct WithContext : public ExecutionContext Data(ExecutionEngine *engine, Object *with); Object *withObject; }; - struct { - Object *withObject; - } __data; V4_MANAGED(ExecutionContext) }; @@ -315,7 +283,7 @@ inline Scope::Scope(ExecutionContext *ctx) /* Function *f, int argc */ #define requiredMemoryForExecutionContect(f, argc) \ - ((sizeof(CallContext) + 7) & ~7) + sizeof(Value) * (f->varCount() + qMax((uint)argc, f->formalParameterCount())) + sizeof(CallData) + ((sizeof(CallContext::Data) + 7) & ~7) + sizeof(Value) * (f->varCount() + qMax((uint)argc, f->formalParameterCount())) + sizeof(CallData) } // namespace QV4 diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index 0526154788..6df4da45c9 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -67,9 +67,6 @@ struct DateObject: Object { } Value value; }; - struct { - Value value; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(DateObject) diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index ea31241c9c..f2cfc3efd2 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -460,15 +460,15 @@ void ExecutionEngine::enableProfiler() void ExecutionEngine::initRootContext() { - GlobalContext::Data *r = reinterpret_cast<GlobalContext::Data *>(memoryManager->allocManaged(sizeof(GlobalContext) + sizeof(CallData))); - new (r) GlobalContext::Data(this); - r->callData = reinterpret_cast<CallData *>(r + 1); - r->callData->tag = QV4::Value::_Integer_Type; - r->callData->argc = 0; - r->callData->thisObject = globalObject; - r->callData->args[0] = Encode::undefined(); - - rootContext = reinterpret_cast<GlobalContext *>(r); + GlobalContext *r = static_cast<GlobalContext*>(memoryManager->allocManaged(sizeof(GlobalContext::Data) + sizeof(CallData))); + new (r->d()) GlobalContext::Data(this); + r->d()->callData = reinterpret_cast<CallData *>(r->d() + 1); + r->d()->callData->tag = QV4::Value::_Integer_Type; + r->d()->callData->argc = 0; + r->d()->callData->thisObject = globalObject; + r->d()->callData->args[0] = Encode::undefined(); + + rootContext = r; } InternalClass *ExecutionEngine::newClass(const InternalClass &other) diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h index e3fe6895a4..ddf30d2059 100644 --- a/src/qml/jsruntime/qv4errorobject_p.h +++ b/src/qml/jsruntime/qv4errorobject_p.h @@ -72,11 +72,6 @@ struct ErrorObject: Object { StackTrace stackTrace; String *stack; }; - struct { - StackTrace stackTrace; - String *stack; - } __data; - V4_OBJECT(Object) Q_MANAGED_TYPE(ErrorObject) diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index b7995e948e..86e4354269 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -105,11 +105,6 @@ struct Q_QML_EXPORT FunctionObject: Object { ExecutionContext *scope; Function *function; }; - struct { - ExecutionContext *scope; - Function *function; - - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(FunctionObject) enum { @@ -199,9 +194,6 @@ struct Q_QML_EXPORT BuiltinFunction: FunctionObject { Data(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *)); ReturnedValue (*code)(CallContext *); }; - struct { - ReturnedValue (*code)(CallContext *); - } __data; V4_OBJECT(FunctionObject) static BuiltinFunction *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *)) @@ -226,10 +218,6 @@ struct IndexedBuiltinFunction: FunctionObject ReturnedValue (*code)(CallContext *, uint index); uint index; }; - struct { - ReturnedValue (*code)(CallContext *, uint index); - uint index; - } __data; V4_OBJECT(FunctionObject) static ReturnedValue construct(Managed *m, CallData *) @@ -271,11 +259,6 @@ struct BoundFunction: FunctionObject { Value boundThis; Members boundArgs; }; - struct { - FunctionObject *target; - Value boundThis; - Members boundArgs; - } __data; V4_OBJECT(FunctionObject) static BoundFunction *create(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const QV4::Members &boundArgs) diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 3fd0676e62..b88531d8ed 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -63,7 +63,7 @@ template <typename T1, typename T2> inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} #ifdef Q_COMPILER_STATIC_ASSERT -#define V4_MANAGED_SIZE_TEST void __dataTest() { Q_STATIC_ASSERT(sizeof(*this) == sizeof(Data)); } +#define V4_MANAGED_SIZE_TEST void __dataTest() { Q_STATIC_ASSERT(sizeof(*this) == sizeof(Managed)); } #else #define V4_MANAGED_SIZE_TEST #endif diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp index 80b01b8b32..7eca47c3ce 100644 --- a/src/qml/jsruntime/qv4memberdata.cpp +++ b/src/qml/jsruntime/qv4memberdata.cpp @@ -58,10 +58,10 @@ void Members::ensureIndex(QV4::ExecutionEngine *e, uint idx) uint s = size(); if (idx >= s) { int newAlloc = qMax((uint)4, 2*idx); - uint alloc = sizeof(MemberData) + (newAlloc)*sizeof(Value); - MemberData *newMemberData = reinterpret_cast<MemberData *>(e->memoryManager->allocManaged(alloc)); + uint alloc = sizeof(MemberData::Data) + (newAlloc)*sizeof(Value); + MemberData *newMemberData = static_cast<MemberData *>(e->memoryManager->allocManaged(alloc)); if (d()) - memcpy(newMemberData, d(), sizeof(MemberData) + s*sizeof(Value)); + memcpy(newMemberData, d(), sizeof(MemberData::Data) + s*sizeof(Value)); else new (newMemberData) MemberData(e->memberDataClass); newMemberData->d()->size = newAlloc; diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h index 434683994f..cd8667adb7 100644 --- a/src/qml/jsruntime/qv4memberdata_p.h +++ b/src/qml/jsruntime/qv4memberdata_p.h @@ -57,14 +57,6 @@ struct MemberData : Managed }; Value data[1]; }; - struct { - union { - uint size; - double _dummy; - }; - Value data[1]; - } __data; - V4_MANAGED(Managed) MemberData(QV4::InternalClass *ic) : Managed(ic) {} diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 774cb5c4b4..67459d5e77 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -113,10 +113,6 @@ struct Q_QML_EXPORT Object: Managed { Members memberData; ArrayData *arrayData; }; - struct { - Members memberData; - ArrayData *arrayData; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(Object) @@ -333,9 +329,6 @@ struct BooleanObject: Object { } Value value; }; - struct { - Value value; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(BooleanObject) @@ -356,9 +349,6 @@ struct NumberObject: Object { } Value value; }; - struct { - Value value; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(NumberObject) diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index 93877b8f2a..f20ad17b4a 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -92,12 +92,6 @@ struct ForEachIteratorObject: Object { ObjectIterator it; Value workArea[2]; }; - struct _Data { - _Data(Object *o, uint flags) - : it(workArea, workArea + 1, o, flags) {} - ObjectIterator it; - Value workArea[2]; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(ForeachIteratorObject) diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 87c07ce66c..a774917713 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -81,10 +81,6 @@ struct Q_QML_EXPORT QObjectWrapper : public QV4::Object Data(ExecutionEngine *engine, QObject *object); QPointer<QObject> object; }; - struct { - QPointer<QObject> object; - } __data; - V4_OBJECT(QV4::Object) enum RevisionMode { IgnoreRevision, CheckRevision }; @@ -135,12 +131,6 @@ struct QObjectMethod : public QV4::FunctionObject int index; QV4::PersistentValue qmlGlobal; }; - struct { - QPointer<QObject> object; - int index; - QV4::PersistentValue qmlGlobal; - } __data; - V4_OBJECT(QV4::FunctionObject) enum { DestroyMethod = -1, ToStringMethod = -2 }; @@ -170,11 +160,6 @@ struct QmlSignalHandler : public QV4::Object QPointer<QObject> object; int signalIndex; }; - struct { - QPointer<QObject> object; - int signalIndex; - } __data; - V4_OBJECT(QV4::Object) diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index 289b5388ec..e1d3a9ef90 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -79,17 +79,6 @@ struct RegExp : public Managed bool ignoreCase; bool multiLine; }; - struct { - QString pattern; - OwnPtr<JSC::Yarr::BytecodePattern> byteCode; -#if ENABLE(YARR_JIT) - JSC::Yarr::YarrCodeBlock jitCode; -#endif - RegExpCache *cache; - int subPatternCount; - bool ignoreCase; - bool multiLine; - } __data; V4_MANAGED(Managed) Q_MANAGED_TYPE(RegExp) diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h index 4148ca07d4..ac07707b2f 100644 --- a/src/qml/jsruntime/qv4regexpobject_p.h +++ b/src/qml/jsruntime/qv4regexpobject_p.h @@ -72,11 +72,6 @@ struct RegExpObject: Object { RegExp *value; bool global; }; - struct { - RegExp *value; - bool global; - } __data; - V4_OBJECT(Object) Q_MANAGED_TYPE(RegExpObject) @@ -117,13 +112,6 @@ struct RegExpCtor: FunctionObject int lastMatchEnd; void clearLastMatch(); }; - struct { - Value lastMatch; - StringValue lastInput; - int lastMatchStart; - int lastMatchEnd; - } __data; - V4_OBJECT(FunctionObject) Value lastMatch() { return d()->lastMatch; } diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 810e05c7f4..e08a63bd1f 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -180,10 +180,6 @@ struct CompilationUnitHolder : public Object } QV4::CompiledData::CompilationUnit *unit; }; - struct { - QV4::CompiledData::CompilationUnit *unit; - } __data; - V4_OBJECT(Object) diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h index ae19397e54..6a749d1438 100644 --- a/src/qml/jsruntime/qv4script_p.h +++ b/src/qml/jsruntime/qv4script_p.h @@ -63,11 +63,6 @@ struct Q_QML_EXPORT QmlBindingWrapper : FunctionObject { Object *qml; CallContext *qmlContext; }; - struct { - Object *qml; - CallContext *qmlContext; - } __data; - V4_OBJECT(FunctionObject) static ReturnedValue call(Managed *that, CallData *); diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 475c8ad71b..b55cd2daad 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -195,13 +195,6 @@ struct QQmlSequence : public QV4::Object int propertyIndex; bool isReference; }; - struct { - mutable Container container; - QPointer<QObject> object; - int propertyIndex; - bool isReference; - } __data; - V4_OBJECT(QV4::Object) Q_MANAGED_TYPE(QmlSequence) public: diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index 3bcf1bdae1..56acd1f199 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -81,19 +81,6 @@ struct Q_QML_PRIVATE_EXPORT String : public Managed { private: QChar *recursiveAppend(QChar *ch) const; }; - struct { - union { - mutable QStringData *text; - mutable String *left; - }; - union { - mutable Identifier *identifier; - mutable String *right; - }; - mutable uint stringHash; - mutable uint largestSubLength; - uint len; - } __data; // ### FIXME: Should this be a V4_OBJECT V4_OBJECT(QV4::Managed) Q_MANAGED_TYPE(String) diff --git a/src/qml/jsruntime/qv4stringobject_p.h b/src/qml/jsruntime/qv4stringobject_p.h index f7a120bc74..0fc556f849 100644 --- a/src/qml/jsruntime/qv4stringobject_p.h +++ b/src/qml/jsruntime/qv4stringobject_p.h @@ -57,10 +57,6 @@ struct StringObject: Object { // ### get rid of tmpProperty mutable Property tmpProperty; }; - struct { - Value value; - mutable Property tmpProperty; - } __data; V4_OBJECT(Object) Q_MANAGED_TYPE(StringObject) diff --git a/src/qml/jsruntime/qv4variantobject_p.h b/src/qml/jsruntime/qv4variantobject_p.h index e94bcf23d3..18e93f6ca7 100644 --- a/src/qml/jsruntime/qv4variantobject_p.h +++ b/src/qml/jsruntime/qv4variantobject_p.h @@ -77,11 +77,6 @@ struct VariantObject : Object bool isScarce() const; int vmePropertyReferenceCount; }; - struct __Data : public ExecutionEngine::ScarceResourceData - { - int vmePropertyReferenceCount; - } __data; - V4_OBJECT(Object) static QVariant toVariant(const ValueRef v); |