From f9022e847fd8717622a06ef042449be6436ce24a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 3 May 2022 14:54:22 +0200 Subject: QML: Port QV4::CompiledData::RegExp to new special integer bitfield Task-number: QTBUG-99545 Change-Id: I37be080387bf086d84761b056140cc5a99d161ed Reviewed-by: Fabian Kosmale Reviewed-by: Sami Shalayel (cherry picked from commit da09f7c3d8962b4521189c96adf1ed0e1da3e8dd) Reviewed-by: Qt Cherry-pick Bot --- src/qml/compiler/qv4compiler.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/qml/compiler/qv4compiler.cpp') diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index c3c5e69995..5e17c82dae 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -189,22 +189,19 @@ int QV4::Compiler::JSUnitGenerator::registerQmlContextPropertyGetterLookup(int n int QV4::Compiler::JSUnitGenerator::registerRegExp(QQmlJS::AST::RegExpLiteral *regexp) { - CompiledData::RegExp re; - re.stringIndex = registerString(regexp->pattern.toString()); - - re.flags = 0; + quint32 flags = 0; if (regexp->flags & QQmlJS::Lexer::RegExp_Global) - re.flags |= CompiledData::RegExp::RegExp_Global; + flags |= CompiledData::RegExp::RegExp_Global; if (regexp->flags & QQmlJS::Lexer::RegExp_IgnoreCase) - re.flags |= CompiledData::RegExp::RegExp_IgnoreCase; + flags |= CompiledData::RegExp::RegExp_IgnoreCase; if (regexp->flags & QQmlJS::Lexer::RegExp_Multiline) - re.flags |= CompiledData::RegExp::RegExp_Multiline; + flags |= CompiledData::RegExp::RegExp_Multiline; if (regexp->flags & QQmlJS::Lexer::RegExp_Unicode) - re.flags |= CompiledData::RegExp::RegExp_Unicode; + flags |= CompiledData::RegExp::RegExp_Unicode; if (regexp->flags & QQmlJS::Lexer::RegExp_Sticky) - re.flags |= CompiledData::RegExp::RegExp_Sticky; + flags |= CompiledData::RegExp::RegExp_Sticky; - regexps.append(re); + regexps.append(CompiledData::RegExp(flags, registerString(regexp->pattern.toString()))); return regexps.size() - 1; } -- cgit v1.2.3