aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-04-05 20:23:20 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:48:54 +0200
commitb11ec085703a0b019c8115ff505ee6e2553fd4f1 (patch)
tree3336b31ba690f9b200b7fee8cc133aa4bf2e7837 /src/qml/jsruntime/qv4string.cpp
parent05f17e841f971d3c8f635cc044c60c970c2055c9 (diff)
Move Managed data into it's own subclass
This prepares for moving over to a d pointer scheme, where Managed subclasses don't hold any data directly. This is required to be able to move over to a modern GC. Change-Id: I3f59633ac07a7da461bd2d4f0f9f3a8e3b0baf02 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r--src/qml/jsruntime/qv4string.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index d9aa881f21..e88888a71e 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -235,7 +235,7 @@ bool String::isEqualTo(Managed *t, Managed *o)
if (t == o)
return true;
- if (!o->internalClass->vtable->isString)
+ if (!o->internalClass()->vtable->isString)
return false;
String *that = static_cast<String *>(t);
@@ -244,7 +244,7 @@ bool String::isEqualTo(Managed *t, Managed *o)
return false;
if (that->identifier && that->identifier == other->identifier)
return true;
- if (that->subtype >= StringType_UInt && that->subtype == other->subtype)
+ if (that->subtype() >= StringType_UInt && that->subtype() == other->subtype())
return true;
return that->toQString() == other->toQString();
@@ -258,7 +258,7 @@ String::String(ExecutionEngine *engine, const QString &text)
{
_text->ref.ref();
len = _text->size;
- subtype = StringType_Unknown;
+ setSubtype(StringType_Unknown);
}
String::String(ExecutionEngine *engine, String *l, String *r)
@@ -267,7 +267,7 @@ String::String(ExecutionEngine *engine, String *l, String *r)
, stringHash(UINT_MAX), largestSubLength(qMax(l->largestSubLength, r->largestSubLength))
, len(l->len + r->len)
{
- subtype = StringType_Unknown;
+ setSubtype(StringType_Unknown);
if (!l->largestSubLength && l->len > largestSubLength)
largestSubLength = l->len;
@@ -283,9 +283,9 @@ uint String::toUInt(bool *ok) const
{
*ok = true;
- if (subtype == StringType_Unknown)
+ if (subtype() == StringType_Unknown)
createHashValue();
- if (subtype >= StringType_UInt)
+ if (subtype() >= StringType_UInt)
return stringHash;
// ### this conversion shouldn't be required
@@ -305,7 +305,7 @@ bool String::equals(const StringRef other) const
return false;
if (identifier && identifier == other->identifier)
return true;
- if (subtype >= StringType_UInt && subtype == other->subtype)
+ if (subtype() >= StringType_UInt && subtype() == other->subtype())
return true;
return toQString() == other->toQString();
@@ -358,7 +358,7 @@ void String::createHashValue() const
bool ok;
stringHash = ::toArrayIndex(ch, end, &ok);
if (ok) {
- subtype = (stringHash == UINT_MAX) ? StringType_UInt : StringType_ArrayIndex;
+ setSubtype((stringHash == UINT_MAX) ? StringType_UInt : StringType_ArrayIndex);
return;
}
@@ -369,7 +369,7 @@ void String::createHashValue() const
}
stringHash = h;
- subtype = StringType_Regular;
+ setSubtype(StringType_Regular);
}
uint String::createHashValue(const QChar *ch, int length)