aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-04-29 10:49:54 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:00 +0200
commite74c19da8eb74132aba761f8b8fe0eac47fe2dcd (patch)
tree8e31ff501dde5916493e22c5977f3848c58965e1 /src/qml/jsruntime/qv4regexpobject_p.h
parentc4dee17a32ea4e5737ef20f942442bcadad77829 (diff)
Convert RegexpObject to new storage scheme
Change-Id: I7dbaa52d3898bbe44b5a865ded6361bcc7ec2acf 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.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h
index 909628cd72..2948dbda83 100644
--- a/src/qml/jsruntime/qv4regexpobject_p.h
+++ b/src/qml/jsruntime/qv4regexpobject_p.h
@@ -66,8 +66,18 @@ namespace QV4 {
class RegExp;
struct RegExpObject: Object {
- V4_OBJECT
+ struct Data : Object::Data {
+ RegExp* value;
+ bool global;
+ };
+ struct {
+ RegExp* value;
+ bool global;
+ } __data;
+
+ V4_OBJECT_NEW
Q_MANAGED_TYPE(RegExpObject)
+
// needs to be compatible with the flags in qv4jsir_p.h
enum Flags {
RegExp_Global = 0x01,
@@ -80,14 +90,8 @@ struct RegExpObject: Object {
Index_ArrayInput = Index_ArrayIndex + 1
};
- struct Data {
- RegExp* value;
- bool global;
- };
- Data data;
-
- RegExp* value() const { return data.value; }
- bool global() const { return data.global; }
+ RegExp *value() const { return d()->value; }
+ bool global() const { return d()->global; }
RegExpObject(ExecutionEngine *engine, RegExpRef value, bool global);
RegExpObject(ExecutionEngine *engine, const QRegExp &re);
@@ -109,21 +113,26 @@ DEFINE_REF(RegExp, Object);
struct RegExpCtor: FunctionObject
{
- V4_OBJECT
- RegExpCtor(ExecutionContext *scope);
-
- struct Data {
+ struct Data : FunctionObject::Data {
Value lastMatch;
StringValue lastInput;
int lastMatchStart;
int lastMatchEnd;
};
- Data data;
+ struct {
+ Value lastMatch;
+ StringValue lastInput;
+ int lastMatchStart;
+ int lastMatchEnd;
+ } __data;
+
+ V4_OBJECT_NEW
+ RegExpCtor(ExecutionContext *scope);
- Value lastMatch() { return data.lastMatch; }
- StringValue lastInput() { return data.lastInput; }
- int lastMatchStart() { return data.lastMatchStart; }
- int lastMatchEnd() { return data.lastMatchEnd; }
+ Value lastMatch() { return d()->lastMatch; }
+ StringValue lastInput() { return d()->lastInput; }
+ int lastMatchStart() { return d()->lastMatchStart; }
+ int lastMatchEnd() { return d()->lastMatchEnd; }
void clearLastMatch();
static ReturnedValue construct(Managed *m, CallData *callData);