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

LibJS: Make DeclarativeEnvironment store bindings in a Vector

The previous storage for DeclarativeEnvironment looked like this:

    HashMap<FlyString, Binding> m_bindings;

This patch changes that to:

    HashMap<FlyString, size_t> m_names;
    Vector<Binding> m_bindings;

The main goal here is to give each binding an index that can ultimately
be cached and used for optimized environment accesses.
This commit is contained in:
Andreas Kling 2021-10-06 23:38:46 +02:00
parent 7aa3cfda09
commit 6ef5464015
2 changed files with 52 additions and 44 deletions

View file

@ -48,7 +48,8 @@ private:
bool initialized { false };
};
HashMap<FlyString, Binding> m_bindings;
HashMap<FlyString, size_t> m_names;
Vector<Binding> m_bindings;
};
template<>