mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
LibJS: Stop making shapes unique
We previously had a concept of unique shapes, which meant that they couldn't be shared between multiple objects. Object shapes became unique in three situations: - They were the shape of the global object. - They had more than 100 properties added to them. - They had one or more properties deleted from them. Unfortunately, unique shapes presented an annoying problem for inline caches, and we added a "unique shape serial number" for being able to tell that a unique shape had been mutated. This patch gets rid of the concept of unique shapes, simplifying all the caching code, since inline caches can now simply perform a shape check and then we're good. To make this possible, we now have the concept of delete transitions, which occur when a property is deleted from a shape. Note that this patch by itself introduces a performance regression in some situtations, since we now create a lot more shapes, and marking their property keys can be very heavy. This will be addressed in a subsequent patch.
This commit is contained in:
parent
ef86cf4646
commit
3d92c26445
8 changed files with 63 additions and 214 deletions
|
@ -49,7 +49,6 @@ struct CacheablePropertyMetadata {
|
|||
};
|
||||
Type type { Type::NotCacheable };
|
||||
Optional<u32> property_offset;
|
||||
u64 unique_shape_serial_number { 0 };
|
||||
};
|
||||
|
||||
class Object : public Cell {
|
||||
|
@ -215,8 +214,6 @@ public:
|
|||
|
||||
static FlatPtr shape_offset() { return OFFSET_OF(Object, m_shape); }
|
||||
|
||||
void ensure_shape_is_unique();
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue