mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:07:45 +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:
parent
28118623f5
commit
b1b2ca1485
28 changed files with 99 additions and 54 deletions
|
@ -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()) {
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
virtual JS::ThrowCompletionOr<bool> internal_has_property(JS::PropertyKey const& name) const override;
|
||||
virtual JS::ThrowCompletionOr<JS::Value> internal_get(JS::PropertyKey const&, JS::Value receiver, JS::CacheablePropertyMetadata*) const override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver) override;
|
||||
virtual JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) override;
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_real_cell_contents);
|
||||
JS_DECLARE_NATIVE_FUNCTION(set_real_cell_contents);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue