aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexp_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-04-06 12:51:56 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:48:56 +0200
commit3f39bc03f1fc3ba26eab7b1b0828d3cfa93abb2b (patch)
tree1a7a210d6e3430189b58d693e32a6c4b392d8a4a /src/qml/jsruntime/qv4regexp_p.h
parent36aa3f91177f41644422e07c338a26e688f5096c (diff)
Convert RegExp and RegExpObject to new data layout
Change-Id: I0c2bbab4b158069d5c1648edc38f7c5e38ee67ee Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexp_p.h')
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h
index 63d4ed3ed2..270fe9aa2d 100644
--- a/src/qml/jsruntime/qv4regexp_p.h
+++ b/src/qml/jsruntime/qv4regexp_p.h
@@ -95,19 +95,38 @@ class RegExp : public Managed
{
V4_MANAGED
Q_MANAGED_TYPE(RegExp)
-public:
+
+ struct Data {
+ 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 data;
+
+ QString pattern() const { return data.pattern; }
+ OwnPtr<JSC::Yarr::BytecodePattern> &byteCode() { return data.byteCode; }
+#if ENABLE(YARR_JIT)
+ JSC::Yarr::YarrCodeBlock jitCode() const { return data.jitCode; }
+#endif
+ RegExpCache *cache() const { return data.cache; }
+ int subPatternCount() const { return data.subPatternCount; }
+ bool ignoreCase() const { return data.ignoreCase; }
+ bool multiLine() const { return data.multiLine; }
+
static RegExp* create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase = false, bool multiline = false);
~RegExp();
- QString pattern() const { return m_pattern; }
-
- bool isValid() const { return m_byteCode.get(); }
+ bool isValid() const { return data.byteCode.get(); }
uint match(const QString& string, int start, uint *matchOffsets);
- bool ignoreCase() const { return m_ignoreCase; }
- bool multiLine() const { return m_multiLine; }
- int captureCount() const { return m_subPatternCount + 1; }
+ int captureCount() const { return subPatternCount() + 1; }
static void destroy(Managed *that);
static void markObjects(Managed *that, QV4::ExecutionEngine *e);
@@ -117,15 +136,6 @@ private:
Q_DISABLE_COPY(RegExp);
RegExp(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline);
- const QString m_pattern;
- OwnPtr<JSC::Yarr::BytecodePattern> m_byteCode;
-#if ENABLE(YARR_JIT)
- JSC::Yarr::YarrCodeBlock m_jitCode;
-#endif
- RegExpCache *m_cache;
- int m_subPatternCount;
- const bool m_ignoreCase;
- const bool m_multiLine;
};
inline RegExpCacheKey::RegExpCacheKey(const RegExp *re)