mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibJS: Cache PutById to setters in the prototype chain
This is *extremely* common on the web, but barely shows up at all in JavaScript benchmarks. A typical example is setting Element.innerHTML on a HTMLDivElement. HTMLDivElement doesn't have innerHTML, so it has to travel up the prototype chain until it finds it. Before this change, we didn't cache this at all, so we had to travel the prototype chain every time a setter like this was used. We now use the same mechanism we already had for GetBydId and cache PutById setter accesses in the prototype chain as well. 1.74x speedup on MicroBench/setter-in-prototype-chain.js
This commit is contained in:
committed by
Andreas Kling
parent
71665fa504
commit
183c847c80
Notes:
github-actions[bot]
2025-05-05 13:22:41 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/183c847c806 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4597
@@ -27,7 +27,7 @@ public:
|
||||
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
||||
virtual ThrowCompletionOr<bool> internal_has_property(PropertyKey const&) const override;
|
||||
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata* = nullptr, PropertyLookupPhase = PropertyLookupPhase::OwnProperty) const override;
|
||||
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
||||
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) override;
|
||||
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
||||
virtual ThrowCompletionOr<GC::RootVector<Value>> internal_own_property_keys() const override;
|
||||
virtual void initialize(Realm&) override;
|
||||
|
||||
Reference in New Issue
Block a user