diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-28 13:58:51 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-29 07:51:41 +0000 |
commit | c5398fdb30bf07d06c533b980c7d7a08b3a9740d (patch) | |
tree | 4f10e3d198c83d77f37f877bc111d51dc6f9ef56 /src/qml/jsruntime/qv4regexp_p.h | |
parent | 88dc4ea1237fe6990b612c2e64142c665e5818f6 (diff) |
Don't compile both bytecode and JIT code for regexps
Usually one of the two is sufficient :)
Change-Id: Ib7ec021411839578c8dd0d7b50d9ec91460c4670
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4regexp_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4regexp_p.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index 7ab12fe245..59277ca3cd 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -76,7 +76,7 @@ struct RegExpCacheKey; namespace Heap { struct RegExp : Base { - void init(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline); + void init(const QString& pattern, bool ignoreCase, bool multiline); void destroy(); QString *pattern; @@ -84,10 +84,18 @@ struct RegExp : Base { #if ENABLE(YARR_JIT) JSC::Yarr::YarrCodeBlock *jitCode; #endif + bool hasValidJITCode() const { +#if ENABLE(YARR_JIT) + return jitCode && !jitCode->isFallBack() && jitCode->has16BitCode(); +#else + return false; +#endif + } RegExpCache *cache; int subPatternCount; bool ignoreCase; bool multiLine; + bool valid; int captureCount() const { return subPatternCount + 1; } }; @@ -114,7 +122,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; } + bool isValid() const { return d()->valid; } uint match(const QString& string, int start, uint *matchOffsets); |