aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function_p.h
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2024-12-10 10:26:34 +0100
committerUlf Hermann <[email protected]>2024-12-12 08:00:24 +0100
commitb4b691b040f2251820292a27bdcf01d4d7530bc6 (patch)
treeb44e3672f38dc53bb503fc336646ddc1ef050017 /src/qml/jsruntime/qv4function_p.h
parentc5b0fa28061fc3e99ce79ff9603d87791b41a197 (diff)
QtQml: Add some consistency to QV4::RegExp
The RegExp JIT should behave the same as the V4 JIT. In particular, it should honor the same JIT call threshold and not second guess any manually set thresholds. To do this we need to store the match count in 32 bits. In turn we can store the 5 flags we may have in 8 bits. To make this safe, pass typed flags to the initialization functions. Also, consider the flags when calculating hash values. Finally, in the init() function, we don't need to initialize members to zero, since that is already guaranteed by the memory manager. And we can delete the flagsAsString() method since it's unused. This requires shuffling some #includes into the places where they actually belong. [ChangeLog][QtQml] The JavaScript regular expression engine now honors QV4_JIT_CALL_THRESHOLD for its own JIT. If QV4_JIT_CALL_THRESHOLD is not set, it uses the JIT after 3 interpreted matches for any regular expression, rather than the previous 5. Matching a regular expression on a string longer than 1024 bytes counts as 3 matches. This is to retain the default behavior of JIT'ing regular expressions right away when encountering long strings. Task-number: QTBUG-131957 Change-Id: I269ccea55d34b191ef18d7cd5fccd4cad8aec7cd Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r--src/qml/jsruntime/qv4function_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 7543dd3c4b..8161c17406 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -132,6 +132,8 @@ public:
return nullptr;
return executableCompilationUnit()->runtimeFunctions[compiledFunction->nestedFunctionIndex];
}
+
+ bool isJittable() const { return kind != Function::AotCompiled && !isGenerator(); }
};
}