mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibRegex: Set a signpost on every executed regular expression
This commit is contained in:
parent
246ab432ff
commit
e4b1c0b8b1
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/e4b1c0b8b18 Pull-request: https://github.com/SerenityOS/serenity/pull/9976
1 changed files with 9 additions and 0 deletions
|
@ -11,6 +11,10 @@
|
|||
#include <LibRegex/RegexMatcher.h>
|
||||
#include <LibRegex/RegexParser.h>
|
||||
|
||||
#ifdef __serenity__
|
||||
# include <serenity.h>
|
||||
#endif
|
||||
|
||||
#if REGEX_DEBUG
|
||||
# include <LibRegex/RegexDebug.h>
|
||||
#endif
|
||||
|
@ -115,6 +119,11 @@ RegexResult Matcher<Parser>::match(RegexStringView const& view, Optional<typenam
|
|||
template<typename Parser>
|
||||
RegexResult Matcher<Parser>::match(Vector<RegexStringView> const& views, Optional<typename ParserTraits<Parser>::OptionsType> regex_options) const
|
||||
{
|
||||
#ifdef __serenity__
|
||||
auto perf_string_id = perf_register_string(m_pattern->pattern_value.characters(), m_pattern->pattern_value.length());
|
||||
perf_event(PERF_EVENT_SIGNPOST, perf_string_id, 0);
|
||||
#endif
|
||||
|
||||
// If the pattern *itself* isn't stateful, reset any changes to start_offset.
|
||||
if (!((AllFlags)m_regex_options.value() & AllFlags::Internal_Stateful))
|
||||
m_pattern->start_offset = 0;
|
||||
|
|
Loading…
Reference in a new issue