1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:35:07 +00:00
serenity/Userland/Libraries/LibJS/Heap
Linus Groh 222e518a53 LibJS: Avoid pointless transitions and metadata lookups in storage_set()
- Replace the misleading abuse of the m_transitions_enabled flag for the
  fast path without lookup with a new m_initialized boolean that's set
  either by Heap::allocate() after calling the Object's initialize(), or
  by the GlobalObject in its special initialize_global_object(). This
  makes it work regardless of the shape's uniqueness.
- When we're adding a new property past the initialization phase,
  there's no need to do a second metadata lookup to retrieve the storage
  value offset - it's known to always be the shape's property count
  minus one. Also, instead of doing manual storage resizing and
  assignment via indexing, just use Vector::append().
- When we didn't add a new property but are overwriting an existing one,
  the property count and therefore storage value offset doesn't change,
  so we don't have to retrieve it either.

As a result, Object::set_shape() is now solely responsible for updating
the m_shape pointer and is not resizing storage anymore, so I moved it
into the header.
2021-08-28 23:17:01 +01:00
..
BlockAllocator.cpp LibJS: Remove unused header includes 2021-08-01 08:10:16 +02:00
BlockAllocator.h LibJS: Add inline capacity to BlockAllocator's blocks Vector 2021-05-28 00:07:24 +01:00
Cell.h LibJS: Remove unused includes out of Cell.h, move to the users 2021-08-01 08:10:16 +02:00
CellAllocator.cpp LibJS: Rename Allocator => CellAllocator 2021-05-27 19:56:12 +02:00
CellAllocator.h LibJS: Rename Allocator => CellAllocator 2021-05-27 19:56:12 +02:00
DeferGC.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Handle.cpp LibJS: Move Cell.{cpp,h} from Runtime/ to Heap/ 2021-05-17 19:53:00 +02:00
Handle.h LibJS: Use IntrusiveList for keeping track of HandleImpls 2021-07-21 19:45:21 +02:00
Heap.cpp Kernel: Make sys$perf_register_string() generate the string ID's 2021-08-12 00:03:39 +02:00
Heap.h LibJS: Avoid pointless transitions and metadata lookups in storage_set() 2021-08-28 23:17:01 +01:00
HeapBlock.cpp LibJS: Don't generate unused HeapBlock names on non-SerenityOS systems 2021-06-13 19:11:29 +02:00
HeapBlock.h LibJS: Instrument HeapBlock cell allocation for ASAN 2021-05-29 17:47:29 +01:00