Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4f65486bf9555e0ebb199e1facd0c09851912daa
https://github.com/WebKit/WebKit/commit/4f65486bf9555e0ebb199e1facd0c09851912daa
Author: Michael Saboff <[email protected]>
Date: 2024-11-13 (Wed, 13 Nov 2024)
Changed paths:
M Source/bmalloc/bmalloc/Map.h
M Source/bmalloc/bmalloc/TZoneHeap.h
M Source/bmalloc/bmalloc/TZoneHeapManager.cpp
M Source/bmalloc/bmalloc/TZoneHeapManager.h
Log Message:
-----------
[TZone] Add caching to unannotated subclass allocation path
https://bugs.webkit.org/show_bug.cgi?id=283083
rdar://problem/139827893
Reviewed by Yusuke Suzuki.
Added a new Map to cache the heaps created for unannotated subclasses of a
TZone annotated super classes.
When a type has a TZone annotation via one of the WTF_MAKE_TZONE_ALLOCATED_*
macros, a templated helper class
is created that static records the size and alignment of the annotated class.
When another class inherits
from such a class, that inheritance uses its super classes templated helpers to
perform its allocations.
If the size of the subclass is larger, due to added member variables, it cannot
reuse the super classes
normal helper because the derived class falls into a different TZone size
class. There is a seldom used
additional helper when the allocation size doesn't the static recorded size of
the annotated super class.
Added a global cache in TZoneHeapManager that caches the heaps created for such
unannotated derived classes.
Moved the log reporting out of the helper class code and put it in the newly
created method,
heapRefForTZoneTypeDifferentSize, for creating and caching these heap.
Also made the TZone type description created for an annotated class to be const
to save _DATA space in the
executable.
* Source/bmalloc/bmalloc/Map.h:
* Source/bmalloc/bmalloc/TZoneHeap.h:
(bmalloc::api::TZoneHeapBase::provideHeap):
* Source/bmalloc/bmalloc/TZoneHeapManager.cpp:
(bmalloc::api::TZoneHeapManager::tzoneBucketForKey):
(bmalloc::api::TZoneHeapManager::heapRefForTZoneType):
(bmalloc::api::TZoneHeapManager::TZoneHeapManager::heapRefForTZoneTypeDifferentSize):
* Source/bmalloc/bmalloc/TZoneHeapManager.h:
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::TZoneTypeAndSize):
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::key const):
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::hash):
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::operator== const):
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::operator< const):
(bmalloc::api::TZoneHeapManager::TZoneTypeAndSize::operator bool const):
(bmalloc::api::TZoneHeapManager::differentSizeMutex):
Canonical link: https://commits.webkit.org/286582@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes