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

LibJS: Add basic monomorphic caching for PutById property access

This patch makes it possible for JS::Object::internal_set() to populate
a CacheablePropertyMetadata, and uses this to implement a basic
monomorphic cache for the most common form of property write access.
This commit is contained in:
Andreas Kling 2023-11-08 20:51:26 +01:00
parent 28118623f5
commit b1b2ca1485
28 changed files with 99 additions and 54 deletions

View file

@ -129,7 +129,7 @@ JS::ThrowCompletionOr<JS::Value> SheetGlobalObject::internal_get(const JS::Prope
return Base::internal_get(property_name, receiver);
}
JS::ThrowCompletionOr<bool> SheetGlobalObject::internal_set(const JS::PropertyKey& property_name, JS::Value value, JS::Value receiver)
JS::ThrowCompletionOr<bool> SheetGlobalObject::internal_set(const JS::PropertyKey& property_name, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*)
{
if (property_name.is_string()) {
if (auto pos = m_sheet.parse_cell_name(property_name.as_string()); pos.has_value()) {