aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-12-06 10:28:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-03 17:09:16 +0100
commit40fd9ff0ffcf72fb1f27d011dfe07fea764fcff2 (patch)
treea87d87fa83c4ba38bf807c18ad8415044be2513d /src/qml/jsruntime/qv4string_p.h
parent658a15a075de2b5a77c1d1b4455eaf0ea0f81f47 (diff)
Move Managed::type and some flags into the vtable
Move the type flag into the vtable to free up these bits in the Managed class, and not have to set them at object construction time. As we often need to know whether a Managed object is a Object, FunctionObject or String, add some bitflags to test for these to the vtable. Change-Id: I7d08ca044544debb307b55f124f34cb086ad9e84 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4string_p.h')
-rw-r--r--src/qml/jsruntime/qv4string_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 64e15b04c2..7e2824d8a0 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -53,6 +53,11 @@ struct Identifier;
struct Q_QML_EXPORT String : public Managed {
Q_MANAGED
+ Q_MANAGED_TYPE(String)
+ enum {
+ IsString = true
+ };
+
enum StringType {
StringType_Unknown,
StringType_Regular,
@@ -63,7 +68,7 @@ struct Q_QML_EXPORT String : public Managed {
String()
: Managed(0), _text(QStringData::sharedNull()), identifier(0)
, stringHash(UINT_MAX), largestSubLength(0), len(0)
- { type = Type_String; subtype = StringType_Unknown; }
+ { subtype = StringType_Unknown; }
String(ExecutionEngine *engine, const QString &text);
String(ExecutionEngine *engine, String *l, String *n);
~String() {