diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-11-03 20:41:17 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-08 19:47:43 +0100 |
commit | 5117c8e79c6d3933a0724b78fde9297a03741239 (patch) | |
tree | f1711d94d4bbaa4782dba2e3b4ca4127a4239491 /src/qml/jsruntime/qv4regexpobject_p.h | |
parent | ef8ad8234b481d3985d748f7607ef486e1af086f (diff) |
Move more Data members over to the Heap namespace
Change-Id: I74347da3f0f47220bb1f8cf13b872b547fd18a4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject_p.h | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h index 42e6494199..e71e2c21fd 100644 --- a/src/qml/jsruntime/qv4regexpobject_p.h +++ b/src/qml/jsruntime/qv4regexpobject_p.h @@ -55,16 +55,35 @@ QT_BEGIN_NAMESPACE namespace QV4 { -struct RegExpObject: Object { - struct Data : Heap::Object { - Data(ExecutionEngine *engine, RegExp *value, bool global); - Data(ExecutionEngine *engine, const QRegExp &re); - Data(InternalClass *ic); +namespace Heap { - RegExp *value; - bool global; - }; - V4_OBJECT(Object) +struct RegExpObject : Object { + RegExpObject(QV4::ExecutionEngine *engine, QV4::RegExp *value, bool global); + RegExpObject(QV4::ExecutionEngine *engine, const QRegExp &re); + RegExpObject(InternalClass *ic); + + QV4::RegExp *value; + bool global; +}; + +struct RegExpCtor : FunctionObject { + RegExpCtor(QV4::ExecutionContext *scope); + Value lastMatch; + StringValue lastInput; + int lastMatchStart; + int lastMatchEnd; + void clearLastMatch(); +}; + +struct RegExpPrototype : RegExpObject +{ + inline RegExpPrototype(InternalClass *ic); +}; + +} + +struct RegExpObject: Object { + V4_OBJECT2(RegExpObject, Object) Q_MANAGED_TYPE(RegExpObject) // needs to be compatible with the flags in qv4jsir_p.h @@ -96,15 +115,7 @@ protected: struct RegExpCtor: FunctionObject { - struct Data : Heap::FunctionObject { - Data(ExecutionContext *scope); - Value lastMatch; - StringValue lastInput; - int lastMatchStart; - int lastMatchEnd; - void clearLastMatch(); - }; - V4_OBJECT(FunctionObject) + V4_OBJECT2(RegExpCtor, FunctionObject) Value lastMatch() { return d()->lastMatch; } StringValue lastInput() { return d()->lastInput; } @@ -118,14 +129,7 @@ struct RegExpCtor: FunctionObject struct RegExpPrototype: RegExpObject { - struct Data : RegExpObject::Data - { - Data(InternalClass *ic): RegExpObject::Data(ic) - { - setVTable(staticVTable()); - } - }; - V4_OBJECT(RegExpObject) + V4_OBJECT2(RegExpPrototype, RegExpObject) void init(ExecutionEngine *engine, Object *ctor); @@ -142,6 +146,12 @@ struct RegExpPrototype: RegExpObject static ReturnedValue method_get_rightContext(CallContext *ctx); }; +inline Heap::RegExpPrototype::RegExpPrototype(InternalClass *ic) + : RegExpObject(ic) +{ + setVTable(QV4::RegExpPrototype::staticVTable()); +} + } QT_END_NAMESPACE |