1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibJS: Always inline two hot (and trivial) functions in JS::Lexer

This improves parsing time on a large chunk of JS by ~5%.
This commit is contained in:
Andreas Kling 2021-09-18 19:48:38 +02:00
parent 33f038ba7a
commit 76bafe5542

View file

@ -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;
}