From 76bafe5542e354551b55974c375e90fd4e84646e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 18 Sep 2021 19:48:38 +0200 Subject: [PATCH] LibJS: Always inline two hot (and trivial) functions in JS::Lexer This improves parsing time on a large chunk of JS by ~5%. --- Userland/Libraries/LibJS/Lexer.cpp | 4 ++-- 1 file 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; }