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

LibJS/Bytecode: Add fast paths for equality checks with same-tag values

This commit is contained in:
Andreas Kling 2024-03-04 09:34:30 +01:00
parent 795149e585
commit 55e9df4954
2 changed files with 22 additions and 4 deletions

View file

@ -131,6 +131,8 @@ public:
Number,
};
[[nodiscard]] u16 tag() const { return m_value.tag; }
bool is_empty() const { return m_value.tag == EMPTY_TAG; }
bool is_undefined() const { return m_value.tag == UNDEFINED_TAG; }
bool is_null() const { return m_value.tag == NULL_TAG; }