summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-18 19:48:38 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-18 19:54:24 +0200
commit76bafe5542e354551b55974c375e90fd4e84646e (patch)
tree8cfd06fe0f079fc42a4a4f8fb678637213454187 /Userland/Libraries/LibJS
parent33f038ba7a81288765d97b26492bd39988220135 (diff)
downloadserenity-76bafe5542e354551b55974c375e90fd4e84646e.zip
LibJS: Always inline two hot (and trivial) functions in JS::Lexer
This improves parsing time on a large chunk of JS by ~5%.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Lexer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp
index f9c0d31de7..7c70b0410e 100644
--- a/Userland/Libraries/LibJS/Lexer.cpp
+++ b/Userland/Libraries/LibJS/Lexer.cpp
@@ -330,7 +330,7 @@ bool Lexer::is_eof() const
return m_eof;
}
-bool Lexer::is_line_terminator() const
+ALWAYS_INLINE bool Lexer::is_line_terminator() const
{
if (m_current_char == '\n' || m_current_char == '\r')
return true;
@@ -341,7 +341,7 @@ bool Lexer::is_line_terminator() const
return code_point == LINE_SEPARATOR || code_point == PARAGRAPH_SEPARATOR;
}
-bool Lexer::is_unicode_character() const
+ALWAYS_INLINE bool Lexer::is_unicode_character() const
{
return (m_current_char & 128) != 0;
}