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