a32c24342b7a4f1a5f519b1ab5098a910dfa6e76
[WebKit-https.git] / Source / bmalloc / ChangeLog
1 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
2
3         Build bmalloc on Mac
4         https://bugs.webkit.org/show_bug.cgi?id=131333
5
6         Reviewed by Mark Rowe.
7
8         * Makefile: Added. For make clients.
9
10         These files are required for building any project in WebKit. I copied
11         them from WTF:
12         * Configurations: Added.
13         * Configurations/Base.xcconfig: Added.
14         * Configurations/DebugRelease.xcconfig: Added.
15         * Configurations/bmalloc.xcconfig: Added.
16         * Configurations/iOS.xcconfig: Added.
17         * Configurations/mbmalloc.xcconfig: Added.
18
19         * bmalloc.xcodeproj/project.pbxproj: I removed per-project-file stuff
20         from here because everything is in .xcconfig files now.
21
22         I had to fix a bunch of minor warnings, since they're enabled in our
23         .xcconfig files:
24
25         * bmalloc/AsyncTask.h:
26         (bmalloc::Function>::AsyncTask):
27         * bmalloc/BAssert.h:
28         * bmalloc/BoundaryTagInlines.h:
29         (bmalloc::validate):
30         * bmalloc/Heap.cpp:
31         (bmalloc::Heap::Heap):
32         (bmalloc::Heap::allocateLarge):
33         (bmalloc::Heap::deallocateLarge):
34         * bmalloc/Mutex.h:
35         (bmalloc::Mutex::Mutex): Deleted.
36         * bmalloc/VMAllocate.h:
37         (bmalloc::vmValidate):
38         * bmalloc/mbmalloc.cpp:
39
40 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
41
42         bmalloc: Fixed a leak in the per-thread cache
43         https://bugs.webkit.org/show_bug.cgi?id=131330
44
45         Reviewed by Andreas Kling.
46
47         Remember to deallocate our line caches upon thread exit.
48
49         * bmalloc/Deallocator.cpp:
50         (bmalloc::Deallocator::~Deallocator):
51
52 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
53
54         bmalloc: rolled out the tryLock experiment
55         https://bugs.webkit.org/show_bug.cgi?id=131328
56
57         Reviewed by Andreas Kling.
58
59         It wasn't a speedup.
60
61         * bmalloc.xcodeproj/project.pbxproj:
62         * bmalloc/Allocator.cpp:
63         (bmalloc::Allocator::processSmallAllocatorLog):
64         (bmalloc::Allocator::processMediumAllocatorLog):
65         * bmalloc/Deallocator.cpp:
66         (bmalloc::Deallocator::processObjectLog):
67         (bmalloc::Deallocator::deallocateSlowCase):
68         (bmalloc::Deallocator::deallocateSmallLine):
69         (bmalloc::Deallocator::deallocateMediumLine):
70         * bmalloc/Deallocator.h:
71         (bmalloc::Deallocator::deallocateFastCase):
72         * bmalloc/Heap.h:
73         (bmalloc::Heap::deallocateSmallLine):
74         (bmalloc::Heap::deallocateMediumLine):
75         * bmalloc/Line.h:
76         (bmalloc::Line<Traits>::deref):
77         * bmalloc/Page.h:
78         (bmalloc::Page<Traits>::deref):
79
80 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
81
82         bmalloc
83         https://bugs.webkit.org/show_bug.cgi?id=131170
84
85         Reviewed by Andreas Kling.
86
87         Initial commit.
88
89         * bmalloc: Added.
90         * bmalloc.xcodeproj: Added.
91         * bmalloc.xcodeproj/project.pbxproj: Added.
92         * bmalloc/Algorithm.h: Added.
93         (bmalloc::max):
94         (bmalloc::min):
95         (bmalloc::mask):
96         (bmalloc::test):
97         (bmalloc::roundUpToMultipleOf):
98         (bmalloc::roundDownToMultipleOf):
99         (bmalloc::sizeOf):
100         (bmalloc::bitCount):
101         (bmalloc::isPowerOfTwo):
102         * bmalloc/Allocator.cpp: Added.
103         (bmalloc::Allocator::Allocator):
104         (bmalloc::Allocator::~Allocator):
105         (bmalloc::Allocator::log):
106         (bmalloc::Allocator::processSmallAllocatorLog):
107         (bmalloc::Allocator::processMediumAllocatorLog):
108         (bmalloc::Allocator::allocateLarge):
109         (bmalloc::Allocator::allocateXLarge):
110         (bmalloc::Allocator::allocateMedium):
111         (bmalloc::Allocator::allocateSlowCase):
112         * bmalloc/Allocator.h: Added.
113         (bmalloc::Allocator::smallAllocatorFor):
114         (bmalloc::Allocator::allocateFastCase):
115         (bmalloc::Allocator::allocate):
116         * bmalloc/AsyncTask.cpp: Added.
117         (bmalloc::AsyncTask<Function>::runSlowCase):
118         (bmalloc::AsyncTask<Function>::pthreadEntryPoint):
119         (bmalloc::AsyncTask<Function>::entryPoint):
120         * bmalloc/AsyncTask.h: Added.
121         (bmalloc::Function>::AsyncTask):
122         (bmalloc::Function>::join):
123         (bmalloc::Function>::run):
124         (bmalloc::Function>::runSlowCase):
125         (bmalloc::Function>::pthreadEntryPoint):
126         (bmalloc::Function>::entryPoint):
127         * bmalloc/BAssert.h: Added.
128         * bmalloc/BeginTag.h: Added.
129         (bmalloc::BeginTag::isInFreeList):
130         * bmalloc/BoundaryTag.h: Added.
131         (bmalloc::BoundaryTag::isXLarge):
132         (bmalloc::BoundaryTag::setXLarge):
133         (bmalloc::BoundaryTag::isFree):
134         (bmalloc::BoundaryTag::setFree):
135         (bmalloc::BoundaryTag::isEnd):
136         (bmalloc::BoundaryTag::setEnd):
137         (bmalloc::BoundaryTag::hasPhysicalPages):
138         (bmalloc::BoundaryTag::setHasPhysicalPages):
139         (bmalloc::BoundaryTag::isNull):
140         (bmalloc::BoundaryTag::clear):
141         (bmalloc::BoundaryTag::size):
142         (bmalloc::BoundaryTag::setSize):
143         (bmalloc::BoundaryTag::prev):
144         (bmalloc::BoundaryTag::next):
145         * bmalloc/BoundaryTagInlines.h: Added.
146         (bmalloc::validate):
147         (bmalloc::validatePrev):
148         (bmalloc::validateNext):
149         (bmalloc::BoundaryTag::init):
150         (bmalloc::BoundaryTag::mergeLargeLeft):
151         (bmalloc::BoundaryTag::mergeLargeRight):
152         (bmalloc::BoundaryTag::mergeLarge):
153         (bmalloc::BoundaryTag::deallocate):
154         (bmalloc::BoundaryTag::splitLarge):
155         (bmalloc::BoundaryTag::allocate):
156         * bmalloc/Cache.cpp: Added.
157         (bmalloc::Cache::operator new):
158         (bmalloc::Cache::operator delete):
159         (bmalloc::Cache::Cache):
160         (bmalloc::Cache::allocateSlowCase):
161         (bmalloc::Cache::allocateSlowCaseNullCache):
162         (bmalloc::Cache::deallocateSlowCase):
163         (bmalloc::Cache::deallocateSlowCaseNullCache):
164         * bmalloc/Cache.h: Added.
165         (bmalloc::Cache::allocator):
166         (bmalloc::Cache::deallocator):
167         (bmalloc::Cache::allocateFastCase):
168         (bmalloc::Cache::deallocateFastCase):
169         (bmalloc::Cache::allocate):
170         (bmalloc::Cache::deallocate):
171         * bmalloc/Chunk.h: Added.
172         (bmalloc::Chunk::begin):
173         (bmalloc::Chunk::end):
174         (bmalloc::Chunk::lines):
175         (bmalloc::Chunk::pages):
176         * bmalloc/Deallocator.cpp: Added.
177         (bmalloc::Deallocator::Deallocator):
178         (bmalloc::Deallocator::~Deallocator):
179         (bmalloc::Deallocator::deallocateLarge):
180         (bmalloc::Deallocator::deallocateXLarge):
181         (bmalloc::Deallocator::processObjectLog):
182         (bmalloc::Deallocator::deallocateSlowCase):
183         (bmalloc::Deallocator::deallocateSmallLine):
184         (bmalloc::Deallocator::allocateSmallLine):
185         (bmalloc::Deallocator::deallocateMediumLine):
186         (bmalloc::Deallocator::allocateMediumLine):
187         * bmalloc/Deallocator.h: Added.
188         (bmalloc::Deallocator::deallocateFastCase):
189         (bmalloc::Deallocator::deallocate):
190         * bmalloc/EndTag.h: Added.
191         (bmalloc::EndTag::operator=):
192         * bmalloc/FixedVector.h: Added.
193         (bmalloc::FixedVector::begin):
194         (bmalloc::FixedVector::end):
195         (bmalloc::FixedVector::size):
196         (bmalloc::FixedVector::capacity):
197         (bmalloc::FixedVector::clear):
198         (bmalloc::FixedVector::isEmpty):
199         (bmalloc::Capacity>::FixedVector):
200         (bmalloc::Capacity>::operator):
201         (bmalloc::Capacity>::push):
202         (bmalloc::Capacity>::pop):
203         (bmalloc::Capacity>::shrink):
204         * bmalloc/Heap.cpp: Added.
205         (bmalloc::sleep):
206         (bmalloc::Heap::Heap):
207         (bmalloc::Heap::concurrentScavenge):
208         (bmalloc::Heap::scavengeSmallPages):
209         (bmalloc::Heap::scavengeMediumPages):
210         (bmalloc::Heap::scavengeLargeRanges):
211         (bmalloc::Heap::allocateSmallLineSlowCase):
212         (bmalloc::Heap::allocateMediumLineSlowCase):
213         (bmalloc::Heap::allocateXLarge):
214         (bmalloc::Heap::deallocateXLarge):
215         (bmalloc::Heap::allocateLarge):
216         (bmalloc::Heap::deallocateLarge):
217         * bmalloc/Heap.h: Added.
218         (bmalloc::Heap::deallocateSmallLine):
219         (bmalloc::Heap::allocateSmallLine):
220         (bmalloc::Heap::deallocateMediumLine):
221         (bmalloc::Heap::allocateMediumLine):
222         * bmalloc/Inline.h: Added.
223         * bmalloc/LargeChunk.h: Added.
224         (bmalloc::LargeChunk::begin):
225         (bmalloc::LargeChunk::end):
226         (bmalloc::LargeChunk::create):
227         (bmalloc::LargeChunk::get):
228         (bmalloc::LargeChunk::beginTag):
229         (bmalloc::LargeChunk::endTag):
230         * bmalloc/Line.h: Added.
231         (bmalloc::Line<Traits>::begin):
232         (bmalloc::Line<Traits>::end):
233         (bmalloc::Line<Traits>::concurrentRef):
234         (bmalloc::Line<Traits>::deref):
235         * bmalloc/MediumAllocator.h: Added.
236         (bmalloc::MediumAllocator::isNull):
237         (bmalloc::MediumAllocator::MediumAllocator):
238         (bmalloc::MediumAllocator::line):
239         (bmalloc::MediumAllocator::allocate):
240         (bmalloc::MediumAllocator::derefCount):
241         (bmalloc::MediumAllocator::refill):
242         * bmalloc/MediumChunk.h: Added.
243         * bmalloc/MediumLine.h: Added.
244         * bmalloc/MediumPage.h: Added.
245         * bmalloc/MediumTraits.h: Added.
246         * bmalloc/Mutex.cpp: Added.
247         (bmalloc::Mutex::lockSlowCase):
248         * bmalloc/Mutex.h: Added.
249         (bmalloc::Mutex::Mutex):
250         (bmalloc::Mutex::try_lock):
251         (bmalloc::Mutex::lock):
252         (bmalloc::Mutex::unlock):
253         * bmalloc/ObjectType.cpp: Added.
254         (bmalloc::objectType):
255         * bmalloc/ObjectType.h: Added.
256         (bmalloc::isSmallOrMedium):
257         (bmalloc::isSmall):
258         * bmalloc/Page.h: Added.
259         (bmalloc::Page<Traits>::ref):
260         (bmalloc::Page<Traits>::deref):
261         (bmalloc::Page<Traits>::refCount):
262         * bmalloc/PerProcess.h: Added.
263         (bmalloc::PerProcess::mutex):
264         (bmalloc::PerProcess<T>::getFastCase):
265         (bmalloc::PerProcess<T>::get):
266         (bmalloc::PerProcess<T>::getSlowCase):
267         * bmalloc/PerThread.h: Added.
268         (bmalloc::PerThreadStorage<Cache>::get):
269         (bmalloc::PerThreadStorage<Cache>::init):
270         (bmalloc::PerThreadStorage::get):
271         (bmalloc::PerThreadStorage::init):
272         (bmalloc::PerThread<T>::getFastCase):
273         (bmalloc::PerThread<T>::get):
274         (bmalloc::PerThread<T>::destructor):
275         (bmalloc::PerThread<T>::getSlowCase):
276         * bmalloc/Range.h: Added.
277         (bmalloc::Range::Range):
278         (bmalloc::Range::begin):
279         (bmalloc::Range::end):
280         (bmalloc::Range::size):
281         (bmalloc::Range::operator!):
282         (bmalloc::Range::operator<):
283         * bmalloc/SegregatedFreeList.cpp: Added.
284         (bmalloc::SegregatedFreeList::SegregatedFreeList):
285         (bmalloc::SegregatedFreeList::insert):
286         (bmalloc::SegregatedFreeList::takeGreedy):
287         (bmalloc::SegregatedFreeList::take):
288         * bmalloc/SegregatedFreeList.h: Added.
289         * bmalloc/Sizes.h: Added.
290         * bmalloc/SmallAllocator.h: Added.
291         (bmalloc::SmallAllocator::isNull):
292         (bmalloc::SmallAllocator::canAllocate):
293         (bmalloc::SmallAllocator::SmallAllocator):
294         (bmalloc::SmallAllocator::line):
295         (bmalloc::SmallAllocator::allocate):
296         (bmalloc::SmallAllocator::objectCount):
297         (bmalloc::SmallAllocator::derefCount):
298         (bmalloc::SmallAllocator::refill):
299         * bmalloc/SmallChunk.h: Added.
300         * bmalloc/SmallLine.h: Added.
301         * bmalloc/SmallPage.h: Added.
302         * bmalloc/SmallTraits.h: Added.
303         * bmalloc/Syscall.h: Added.
304         * bmalloc/VMAllocate.h: Added.
305         (bmalloc::vmSize):
306         (bmalloc::vmValidate):
307         (bmalloc::vmAllocate):
308         (bmalloc::vmDeallocate):
309         (bmalloc::vmDeallocatePhysicalPages):
310         (bmalloc::vmAllocatePhysicalPages):
311         (bmalloc::vmDeallocatePhysicalPagesSloppy):
312         (bmalloc::vmAllocatePhysicalPagesSloppy):
313         * bmalloc/VMHeap.cpp: Added.
314         (bmalloc::VMHeap::VMHeap):
315         (bmalloc::VMHeap::allocateSmallChunk):
316         (bmalloc::VMHeap::allocateMediumChunk):
317         (bmalloc::VMHeap::allocateLargeChunk):
318         * bmalloc/VMHeap.h: Added.
319         (bmalloc::VMHeap::allocateSmallPage):
320         (bmalloc::VMHeap::allocateMediumPage):
321         (bmalloc::VMHeap::allocateLargeRange):
322         (bmalloc::VMHeap::deallocateSmallPage):
323         (bmalloc::VMHeap::deallocateMediumPage):
324         (bmalloc::VMHeap::deallocateLargeRange):
325         * bmalloc/Vector.h: Added.
326         (bmalloc::Vector::begin):
327         (bmalloc::Vector::end):
328         (bmalloc::Vector::size):
329         (bmalloc::Vector::capacity):
330         (bmalloc::Vector::last):
331         (bmalloc::Vector::pop):
332         (bmalloc::Vector<T>::Vector):
333         (bmalloc::Vector<T>::~Vector):
334         (bmalloc::Vector<T>::operator):
335         (bmalloc::Vector<T>::push):
336         (bmalloc::Vector<T>::pop):
337         (bmalloc::Vector<T>::shrink):
338         (bmalloc::Vector<T>::reallocateBuffer):
339         (bmalloc::Vector<T>::shrinkCapacity):
340         (bmalloc::Vector<T>::growCapacity):
341         * bmalloc/XLargeChunk.h: Added.
342         (bmalloc::XLargeChunk::get):
343         (bmalloc::XLargeChunk::begin):
344         (bmalloc::XLargeChunk::XLargeChunk):
345         (bmalloc::XLargeChunk::create):
346         (bmalloc::XLargeChunk::destroy):
347         (bmalloc::XLargeChunk::range):
348         (bmalloc::XLargeChunk::size):
349         * bmalloc/bmalloc.h: Added.
350         (bmalloc::api::malloc):
351         (bmalloc::api::free):
352         (bmalloc::api::realloc):
353         * bmalloc/mbmalloc.cpp: Added.
354