2011-02-18 chris reiss <christopher.reiss@nokia.com>
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2011-02-18  chris reiss  <christopher.reiss@nokia.com>
2
3         Reviewed by Andreas Kling.
4
5         REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
6         https://bugs.webkit.org/show_bug.cgi?id=49989
7
8         updated test fast/js/script-tests/date-parse-test.js
9
10         * wtf/DateMath.cpp:
11         (WTF::parseDateFromNullTerminatedCharacters):
12
13 2011-02-18  Sheriff Bot  <webkit.review.bot@gmail.com>
14
15         Unreviewed, rolling out r79022.
16         http://trac.webkit.org/changeset/79022
17         https://bugs.webkit.org/show_bug.cgi?id=54775
18
19         It broke the whole world (Requested by Ossy on #webkit).
20
21         * runtime/MarkedSpace.h:
22         (JSC::MarkedSpace::contains):
23
24 2011-02-18  Yael Aharon  <yael.aharon@nokia.com>
25
26         Reviewed by Dave Hyatt.
27
28         Add support for dir=auto
29         https://bugs.webkit.org/show_bug.cgi?id=50916
30
31         Change defaultWritingDirection() to return if the writing direction
32         was determined from a letter with strong directionality or not.
33
34         * JavaScriptCore.exp:
35         * JavaScriptCore.order:
36         * wtf/text/StringImpl.cpp:
37         (WTF::StringImpl::defaultWritingDirection):
38         * wtf/text/StringImpl.h:
39         * wtf/text/WTFString.h:
40         (WTF::String::defaultWritingDirection):
41
42 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
43
44         Reviewed by Sam Weinig.
45
46         Use hashing instead of linear search in the conservative pointer test
47         https://bugs.webkit.org/show_bug.cgi?id=54767
48         
49         SunSpider reports no change.
50
51         * runtime/MarkedSpace.h:
52         (JSC::MarkedSpace::contains): Variable-sized objects will use more,
53         smaller blocks, so it's important for the contains check not to be O(n)
54         in the number of blocks.
55
56 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
57
58         Reviewed by Sam Weinig.
59
60         Tightened some usage accounting code in MarkedSpace
61         https://bugs.webkit.org/show_bug.cgi?id=54761
62         
63         SunSpider reports no change.
64
65         * runtime/Heap.cpp:
66         (JSC::Heap::Heap): Initialize the marked space high water mark on
67         construction, instead of relying on some implicit subtleties to make
68         not initializing it work out OK.
69
70         * runtime/Heap.h: Fixed up includes.
71
72         * runtime/MarkedBlock.h: Made firstAtom() static so clients can call it
73         even without having allocated a block.
74
75         * runtime/MarkedSpace.cpp:
76         (JSC::MarkedSpace::MarkedSpace): Don't pre-allocate a block, since this
77         would be prohibitively expensive with multiple size classes.
78
79         (JSC::MarkedSpace::allocateBlock):
80         (JSC::MarkedSpace::freeBlock): Track allocated blocks in a hash set,
81         since linear search in the contains check will be prohibitively
82         expensive once we're using lots of smaller blocks.
83
84         (JSC::MarkedSpace::allocate): Don't assume that we always have a block
85         allocated, since we don't anymore. (See above.)
86
87         (JSC::MarkedSpace::reset):
88         * runtime/MarkedSpace.h: Updated for changes mentioned above.
89
90 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
91
92         Reviewed by Sam Weinig.
93
94         Made object allocation secretly variable-sized (Shhhh!)
95         https://bugs.webkit.org/show_bug.cgi?id=54721
96         
97         SunSpider reports no change.
98         
99         Internally, MarkedBlock now makes variable-sized allocations, even
100         though MarkedSpace doesn't take advantage of this yet.
101
102         * runtime/MarkedBlock.cpp:
103         (JSC::MarkedBlock::MarkedBlock): No need to ASSERT that allocations are
104         fixed-sized.
105
106         * runtime/MarkedBlock.h: Shrunk the atom size so we can allocate things
107         that are not multiples of 64 bytes.
108
109 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
110
111         Reviewed by Sam Weinig.
112
113         Fixed some math errors when when using variable-sized cells
114         https://bugs.webkit.org/show_bug.cgi?id=54717
115         
116         SunSpider reports no change.
117         
118         Computer Science Barbie says, "Math is not so hard afterall!"
119
120         * runtime/JSCell.h:
121         (JSC::JSCell::MarkedBlock::allocate): Round up when calculating the
122         minimum number of atoms required for a cell, since rounding down
123         will get you splinched.
124
125         * runtime/MarkedBlock.cpp:
126         (JSC::MarkedBlock::MarkedBlock):
127         (JSC::MarkedBlock::sweep):
128         * runtime/MarkedBlock.h:
129         (JSC::MarkedBlock::forEach): Changed a bunch of != tests to < tests
130         because m_endAtom is actually a fuzzy end -- iterating from firstAtom()
131         may not hit m_endAtom exactly.
132
133 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
134
135         Reviewed by Sam Weinig.
136
137         A little more abstraction for MarkedSpace::contains
138         https://bugs.webkit.org/show_bug.cgi?id=54715
139
140         * runtime/MarkedBlock.h:
141         (JSC::MarkedBlock::contains): Added a contains function, so MarkedSpace
142         doesn't have to know how MarkedBlock tracks containment internally.
143
144         * runtime/MarkedSpace.h:
145         (JSC::MarkedSpace::contains): Call through to MarkedBlock to figure out
146         if a cell that seems to be in a block is valid.
147
148 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
149
150         Reviewed by Sam Weinig.
151
152         Removed the invariant that the last cell in a block is always marked
153         https://bugs.webkit.org/show_bug.cgi?id=54713
154         
155         SunSpider reports no change.
156         
157         This adds one branch to allocation, but simplifies the mark invariant,
158         especially in a world of variable-sized cells. Now, it really is true
159         that any cell whose mark bit is set is a valid, live cell whose
160         constructor has run and whose destructor has not run.
161
162         * runtime/JSCell.h: 
163         (JSC::JSCell::MarkedBlock::allocate): Changed this do-while into a while
164         since we can no longer rely on a set mark bit to break out of this loop
165         before it reaches the end of the block.
166
167         * runtime/MarkedBlock.cpp:
168         (JSC::MarkedBlock::MarkedBlock):
169         (JSC::MarkedBlock::sweep): 
170         * runtime/MarkedBlock.h:
171         (JSC::MarkedBlock::isEmpty):
172         (JSC::MarkedBlock::clearMarks):
173         (JSC::MarkedBlock::markCount):
174         (JSC::MarkedBlock::forEach): No need to set a special last mark bit.
175
176 2011-02-17  Sheriff Bot  <webkit.review.bot@gmail.com>
177
178         Unreviewed, rolling out r78856 and r78907.
179         http://trac.webkit.org/changeset/78856
180         http://trac.webkit.org/changeset/78907
181         https://bugs.webkit.org/show_bug.cgi?id=54705
182
183         These seem to break tests on 32-bit builds. (Requested by
184         aroben on #webkit).
185
186         * JavaScriptCore.xcodeproj/project.pbxproj:
187         * collector/handles/Global.h:
188         (JSC::Global::internalSet):
189         * collector/handles/Handle.h:
190         (JSC::HandleTypes::getFromSlot):
191         (JSC::HandleTypes::toJSValue):
192         (JSC::HandleTypes::validateUpcast):
193         (JSC::HandleConverter::operator->):
194         (JSC::HandleConverter::operator*):
195         (JSC::Handle::Handle):
196         (JSC::Handle::get):
197         * runtime/JSArray.cpp:
198         (JSC::JSArray::sortNumeric):
199         * runtime/JSObject.h:
200         (JSC::JSObject::inlineGetOwnPropertySlot):
201         * runtime/SlotAccessor.h: Removed.
202         * runtime/WeakGCPtr.h:
203         (JSC::WeakGCPtr::get):
204         (JSC::WeakGCPtr::internalSet):
205         * runtime/WriteBarrier.h:
206         (JSC::DeprecatedPtr::DeprecatedPtr):
207         (JSC::DeprecatedPtr::get):
208         (JSC::DeprecatedPtr::operator*):
209         (JSC::DeprecatedPtr::operator->):
210         (JSC::DeprecatedPtr::slot):
211         (JSC::DeprecatedPtr::operator UnspecifiedBoolType*):
212         (JSC::DeprecatedPtr::operator!):
213         (JSC::WriteBarrierBase::set):
214         (JSC::WriteBarrierBase::get):
215         (JSC::WriteBarrierBase::operator*):
216         (JSC::WriteBarrierBase::operator->):
217         (JSC::WriteBarrierBase::clear):
218         (JSC::WriteBarrierBase::slot):
219         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
220         (JSC::WriteBarrierBase::operator!):
221         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
222         (JSC::WriteBarrier::WriteBarrier):
223
224 2011-02-17  Csaba Osztrogon√°c  <ossy@webkit.org>
225
226         Unreviewed.
227
228         [Qt] Buildfix.
229
230         * wtf/RetainPtr.h: Add missing PLATFORM(CF) guard.
231
232 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
233
234         Reviewed by Oliver Hunt.
235
236         Made MarkedBlock variable-sized
237         https://bugs.webkit.org/show_bug.cgi?id=54692
238         
239         SunSpider reports no change.
240         
241         Each MarkedBlock is now composed of a set of fixed-sized atoms, with one
242         mark bit per atom. A given cell may be composed of one or more atoms.
243         
244         * runtime/Heap.cpp:
245         (JSC::Heap::allocate): Made fixed-sizedness a property of MarkedSpace,
246         bubbling it up from MarkedBlock, since MarkedBlock now supports variable-
247         sizedness.
248
249         * runtime/JSCell.h:
250         (JSC::JSCell::MarkedBlock::allocate): Removed use of CELLS_PER_BLOCK and
251         (implicit) one constants -- these quantities are not constant anymore.
252         Updated for switch from cell to atom.
253
254         * runtime/MarkedBlock.cpp:
255         (JSC::MarkedBlock::create):
256         (JSC::MarkedBlock::destroy):
257         (JSC::MarkedBlock::MarkedBlock):
258         (JSC::MarkedBlock::sweep):
259         * runtime/MarkedBlock.h:
260         (JSC::MarkedBlock::firstAtom):
261         (JSC::MarkedBlock::atoms):
262         (JSC::MarkedBlock::isAtomAligned):
263         (JSC::MarkedBlock::blockFor):
264         (JSC::MarkedBlock::isEmpty):
265         (JSC::MarkedBlock::clearMarks):
266         (JSC::MarkedBlock::size):
267         (JSC::MarkedBlock::capacity):
268         (JSC::MarkedBlock::atomNumber):
269         (JSC::MarkedBlock::isMarked):
270         (JSC::MarkedBlock::testAndSetMarked):
271         (JSC::MarkedBlock::setMarked):
272         (JSC::MarkedBlock::forEach): Same as above. Also removed use of CELL_SIZE
273         and BLOCK_SIZE, and switched away from calling arbitrary pointers cells.
274
275         * runtime/MarkedSpace.cpp:
276         (JSC::MarkedSpace::MarkedSpace):
277         (JSC::MarkedSpace::allocateBlock):
278         (JSC::MarkedSpace::allocate):
279         (JSC::MarkedSpace::reset):
280         * runtime/MarkedSpace.h:
281         (JSC::CollectorHeap::CollectorHeap):
282         (JSC::MarkedSpace::contains): Updated for renames. Made fixed-sizedness
283         a property of MarkedSpace.
284
285 2011-02-17  Oliver Hunt  <oliver@apple.com>
286
287         Attempt to fix windows build
288
289         * runtime/WriteBarrier.h:
290
291 2011-02-17  Oliver Hunt  <oliver@apple.com>
292
293         Reviewed by Geoffrey Garen.
294
295         Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
296         https://bugs.webkit.org/show_bug.cgi?id=54608
297
298         Make use of the tricks used for Handle, et al to avoid duplicating all
299         of the logic for DeprecatedPtr and WriteBarrier simply to support known
300         vs. unknown types.
301
302         * JavaScriptCore.xcodeproj/project.pbxproj:
303         * collector/handles/Global.h:
304         (JSC::Global::internalSet):
305         * collector/handles/Handle.h:
306         (JSC::Handle::Handle):
307         (JSC::Handle::get):
308         * runtime/JSArray.cpp:
309         (JSC::JSArray::sortNumeric):
310         * runtime/JSObject.h:
311         (JSC::JSObject::inlineGetOwnPropertySlot):
312         * runtime/SlotAccessor.h: Added.
313         (JSC::SlotTypes::getFromBaseType):
314         (JSC::SlotTypes::convertToBaseType):
315         (JSC::SlotTypes::getFromSlot):
316         (JSC::SlotTypes::toJSValue):
317         (JSC::SlotTypes::validateUpcast):
318         (JSC::SlotAccessor::operator->):
319         (JSC::SlotAccessor::operator*):
320         * runtime/WeakGCPtr.h:
321         (JSC::WeakGCPtr::get):
322         (JSC::WeakGCPtr::internalSet):
323         * runtime/WriteBarrier.h:
324         (JSC::DeprecatedPtr::DeprecatedPtr):
325         (JSC::DeprecatedPtr::get):
326         (JSC::DeprecatedPtr::slot):
327         (JSC::DeprecatedPtr::operator=):
328         (JSC::WriteBarrierTranslator::convertToStorage):
329         (JSC::WriteBarrierTranslator::convertFromStorage):
330         (JSC::WriteBarrierBase::set):
331         (JSC::WriteBarrierBase::get):
332         (JSC::WriteBarrierBase::clear):
333         (JSC::WriteBarrierBase::slot):
334         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
335         (JSC::WriteBarrierBase::operator!):
336         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
337         (JSC::WriteBarrier::WriteBarrier):
338
339 2011-02-17  Kevin Ollivier  <kevino@theolliviers.com>
340
341         [wx] Revert incorrect blind fix and restore previous working code.
342
343         * wtf/wx/StringWx.cpp:
344         (WTF::String::String):
345
346 2011-02-16  Geoffrey Garen  <ggaren@apple.com>
347
348         Reviewed by Maciej Stachowiak.
349
350         Intermittent crashes beneath MarkStack::drain
351         https://bugs.webkit.org/show_bug.cgi?id=54614
352         <rdar://problem/8971070>
353         
354         The crashes were caused by a GC happening after the global object's
355         property table had grown (due to compilation), but before the properties
356         had been fully initialized by program execution.
357
358         * bytecompiler/BytecodeGenerator.cpp:
359         (JSC::BytecodeGenerator::BytecodeGenerator): Explicitly resize the global
360         object's register storage immediately, without waiting for program
361         execution to do it for us. This ensures that the global object's count
362         of global variables is consistent with the size of its global variable
363         storage at all times, and it ensures that all global variables are
364         properly initialized from the get-go.
365
366         * runtime/JSGlobalObject.cpp:
367         (JSC::JSGlobalObject::resizeRegisters):
368         * runtime/JSGlobalObject.h: Added a helper function for growing the
369         global object's register storage, and initializing new registers.
370
371 == Rolled over to ChangeLog-2011-02-16 ==