diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-18 08:33:26 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-18 08:33:26 +0200 |
commit | f04c2c40fd7ee91e5cbff2ca4df0fdc30dfbbcd5 (patch) | |
tree | 4e96d097987deb8d4d1a963e911dcbd1641a8502 /src/qml/jsruntime/qv4regexp_p.h | |
parent | 0da811cdfebdae1d96c99fe681e6a776e73d2f7f (diff) | |
parent | e76ed6a2655894bd671ee7397a15f2e57cfc8d33 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/qml/jsruntime/qv4variantobject.cpp
src/qml/types/qquickworkerscript.cpp
src/quick/scenegraph/util/qsgdefaultpainternode_p.h
tools/qmljs/qmljs.cpp
Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
Diffstat (limited to 'src/qml/jsruntime/qv4regexp_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4regexp_p.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index b99d717847..d3e63375a5 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -76,12 +76,13 @@ struct RegExpCacheKey; namespace Heap { struct RegExp : Base { - RegExp(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline); - ~RegExp(); - QString pattern; - OwnPtr<JSC::Yarr::BytecodePattern> byteCode; + void init(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline); + void destroy(); + + QString *pattern; + JSC::Yarr::BytecodePattern *byteCode; #if ENABLE(YARR_JIT) - JSC::Yarr::YarrCodeBlock jitCode; + JSC::Yarr::YarrCodeBlock *jitCode; #endif RegExpCache *cache; int subPatternCount; @@ -90,6 +91,7 @@ struct RegExp : Base { int captureCount() const { return subPatternCount + 1; } }; +V4_ASSERT_IS_TRIVIAL(RegExp) } @@ -99,10 +101,10 @@ struct RegExp : public Managed Q_MANAGED_TYPE(RegExp) V4_NEEDS_DESTROY - QString pattern() const { return d()->pattern; } - OwnPtr<JSC::Yarr::BytecodePattern> &byteCode() { return d()->byteCode; } + QString pattern() const { return *d()->pattern; } + JSC::Yarr::BytecodePattern *byteCode() { return d()->byteCode; } #if ENABLE(YARR_JIT) - JSC::Yarr::YarrCodeBlock jitCode() const { return d()->jitCode; } + JSC::Yarr::YarrCodeBlock *jitCode() const { return d()->jitCode; } #endif RegExpCache *cache() const { return d()->cache; } int subPatternCount() const { return d()->subPatternCount; } @@ -111,7 +113,7 @@ struct RegExp : public Managed static Heap::RegExp *create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase = false, bool multiline = false); - bool isValid() const { return d()->byteCode.get(); } + bool isValid() const { return d()->byteCode; } uint match(const QString& string, int start, uint *matchOffsets); @@ -142,7 +144,7 @@ struct RegExpCacheKey }; inline RegExpCacheKey::RegExpCacheKey(const RegExp::Data *re) - : pattern(re->pattern) + : pattern(*re->pattern) , ignoreCase(re->ignoreCase) , multiLine(re->multiLine) {} |