2011-02-22 Andras Becsi <abecsi@webkit.org>
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2011-02-22  Andras Becsi  <abecsi@webkit.org>
2
3         Reviewed by Laszlo Gombos.
4
5         [Qt] Redesign the build system
6         https://bugs.webkit.org/show_bug.cgi?id=51339
7
8         Part 2.
9
10         Build WebCore as a static library, compile the WebKit API and WebKit2 API
11         in a final step and link to WebKit2, WebCore and JSC libraries to fix
12         linking issues resulting from stripped away symbols.
13
14         * JavaScriptCore.pri: Remove the workaround.
15
16 2011-02-21  Adam Roben  <aroben@apple.com>
17
18         Fix linker warning on Windows
19
20         r79135 tried to export JSObject::s_info by adding it to JavaScriptCore.def. This is the
21         obvious way (since it's how we export functions), but unfortunately it doesn't work correct.
22         r79222 made us export it the right way (using the JS_EXPORTDATA macro), but forgot to remove
23         it from JavaScriptCore.def. This caused us to get linker warnings about exporting the symbol
24         multiple times.
25
26         Rubber-stamped by Anders Carlsson.
27
28         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed JSObject::s_info.
29
30 2011-02-21  Brian Weinstein  <bweinstein@apple.com>
31
32         Reviewed by Adam Roben.
33
34         WebResourceCacheManager should be responsible for managing the CFURLCache as well
35         as the WebCore memory cache.
36         https://bugs.webkit.org/show_bug.cgi?id=54886
37         Part of <rdar://problem/8971738>
38
39         Add a new use flag for using the CFURLCache.
40
41         * wtf/Platform.h:
42
43 2011-02-21  Xan Lopez  <xlopez@igalia.com>
44
45         Reviewed by Gavin Barraclough.
46
47         Use ASSERT_JIT_OFFSET in JITPropertyAccess32_64.cpp
48         https://bugs.webkit.org/show_bug.cgi?id=54901
49
50         * jit/JIT.h: swap actual and expected values in message, they were
51         reversed.
52         * jit/JITCall32_64.cpp:
53         (JSC::JIT::compileOpCall): use ASSERT_JIT_OFFSET instead of
54         a simple ASSERT.
55         * jit/JITPropertyAccess32_64.cpp:
56         (JSC::JIT::emit_op_method_check): ditto.
57         (JSC::JIT::compileGetByIdHotPath): ditto.
58         (JSC::JIT::compileGetByIdSlowCase): ditto.
59         (JSC::JIT::emit_op_put_by_id): ditto.
60
61 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
62
63         Ruber stamped by Sam Weinig
64
65         Bug 54899 - Math.LOG10E should be 0.4342944819032518
66         This value is quoted in section 15.8.1.5 of the spec.
67
68         * runtime/MathObject.cpp:
69         (JSC::MathObject::MathObject):
70
71 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
72
73         Reviewed by Sam Weinig.
74
75         Bug 54894 - Make inheritance structure described by ClassInfo match C++ class hierarchy.
76
77         The ClassInfo objects describe an inheritance hierarchy, with each ClassInfo instance
78         containing a pointer to its parent class. These links should reflect the inheritance
79         hierarchy of C++ classes below JSObject. For the large part it does, but in some cases
80         entries in the C++ hierarchy are skipped over. This presently likely doesn't matter,
81         since intervening C++ classes may not have ClassInfo - but would be a potential bug
82         were ClassInfo were to be added.
83
84         * API/JSCallbackConstructor.cpp:
85         * API/JSCallbackFunction.cpp:
86         * API/JSCallbackObjectFunctions.h:
87         * runtime/Arguments.h:
88         * runtime/ArrayPrototype.cpp:
89         * runtime/BooleanObject.cpp:
90         * runtime/DateInstance.cpp:
91         * runtime/DatePrototype.cpp:
92         * runtime/ErrorInstance.cpp:
93         * runtime/InternalFunction.cpp:
94         * runtime/JSActivation.cpp:
95         * runtime/JSArray.cpp:
96         * runtime/JSFunction.cpp:
97         * runtime/JSONObject.cpp:
98         * runtime/JSObject.h:
99         * runtime/JSZombie.h:
100         * runtime/MathObject.cpp:
101         * runtime/NativeErrorConstructor.cpp:
102         * runtime/NumberConstructor.cpp:
103         * runtime/NumberObject.cpp:
104         * runtime/RegExpConstructor.cpp:
105         * runtime/RegExpObject.cpp:
106         * runtime/StringObject.cpp:
107         * runtime/StringPrototype.cpp:
108
109 2011-02-21  Adam Roben  <aroben@apple.com>
110
111         Export JSObject::s_info from JavaScriptCore.dll
112
113         This matches what we do for all other ClassInfo objects that WebCore needs access to.
114
115         Fixes <http://webkit.org/b/54881> REGRESSION (r79132): Lots of tests crashing in
116         JSCell::inherits on Windows
117
118         Reviewed by Sam Weinig.
119
120         * runtime/JSObject.h: Added JS_EXPORTDATA to s_info.
121
122 2011-02-21  Kristian Amlie  <kristian.amlie@nokia.com>
123
124         Reviewed by Andreas Kling.
125
126         Switched to compiler based detection, where the error actually is.
127
128         It is not the platform that needs the workaround, it is the compiler.
129
130         QtWebKit fails to compile on Windows XP with msvc-2008
131         https://bugs.webkit.org/show_bug.cgi?id=54746
132
133         * bytecode/CodeBlock.h:
134         * runtime/RegExpObject.h:
135
136 2011-02-20  Gavin Barraclough  <barraclough@apple.com>
137
138         Reviewed by Oliver Hunt.
139
140         https://bugs.webkit.org/show_bug.cgi?id=54839
141         Remove PrototypeFunction, NativeFunctionWrapper, and GlobalEvalFunction.
142
143         Historically, Native functions used to be represented by PrototypeFunctions, however
144         since introducing call optimizations to the JIT this has used JSFunctions for host
145         calls too. At the point this change was made, the interpreter continued to use
146         PrototypeFunctions, however since fallback from the JIT to interpreter was introduced
147         the interpreter has had to be able to run using host functions represented using
148         JSFunctions - leading to an unnecessary and redundant divergence in behaviour between 
149         interpreter only builds, and situations where the JIT has fallen back to interpreting.
150
151         NativeFunctionWrapper only existed to select between PrototypeFunction and JSFunction
152         for wrappers for host functions, and as such can also be removed.
153
154         GlobalEvalFunction is a redundant wrapper that happens to be derived from
155         PrototypeFunction. It existed to hold a reference to the global object - but since all
156         functions how derive from JSObjectWithGlobalObject, this no longer requires an
157         additional class to provide this functionality.
158
159         * JavaScriptCore.JSVALUE32_64only.exp:
160         * JavaScriptCore.JSVALUE64only.exp:
161         * JavaScriptCore.xcodeproj/project.pbxproj:
162             Removed symbols / references to files.
163
164         * runtime/GlobalEvalFunction.cpp: Removed.
165         * runtime/GlobalEvalFunction.h: Removed.
166         * runtime/NativeFunctionWrapper.h: Removed.
167         * runtime/PrototypeFunction.cpp: Removed.
168         * runtime/PrototypeFunction.h: Removed.
169             Removed.
170
171         * runtime/Executable.cpp:
172         (JSC::NativeExecutable::~NativeExecutable):
173         * runtime/Executable.h:
174         (JSC::NativeExecutable::create):
175         (JSC::NativeExecutable::NativeExecutable):
176         (JSC::JSFunction::nativeFunction):
177         * runtime/JSFunction.cpp:
178         (JSC::callHostFunctionAsConstructor):
179         (JSC::JSFunction::JSFunction):
180         (JSC::JSFunction::getCallData):
181         * runtime/JSFunction.h:
182         * runtime/JSGlobalData.cpp:
183         (JSC::JSGlobalData::getHostFunction):
184         * runtime/JSGlobalData.h:
185         (JSC::JSGlobalData::getCTIStub):
186             Added interpreter-friendly constructors for NativeExecutables.
187
188         * bytecompiler/BytecodeGenerator.cpp:
189         * interpreter/Interpreter.cpp:
190         * jit/JITStubs.cpp:
191         * jsc.cpp:
192         * runtime/ArrayConstructor.cpp:
193         * runtime/BooleanPrototype.cpp:
194         * runtime/BooleanPrototype.h:
195         * runtime/CallData.h:
196         * runtime/DateConstructor.cpp:
197         * runtime/DateConstructor.h:
198         * runtime/ErrorPrototype.cpp:
199         * runtime/ErrorPrototype.h:
200         * runtime/FunctionPrototype.cpp:
201         * runtime/FunctionPrototype.h:
202         * runtime/JSGlobalObject.cpp:
203         * runtime/JSGlobalObject.h:
204         * runtime/JSGlobalObjectFunctions.cpp:
205         * runtime/Lookup.cpp:
206         * runtime/NumberPrototype.cpp:
207         * runtime/NumberPrototype.h:
208         * runtime/ObjectConstructor.cpp:
209         * runtime/ObjectConstructor.h:
210         * runtime/ObjectPrototype.cpp:
211         * runtime/ObjectPrototype.h:
212         * runtime/RegExpPrototype.cpp:
213         * runtime/RegExpPrototype.h:
214         * runtime/SmallStrings.h:
215         * runtime/StringConstructor.cpp:
216         * runtime/StringConstructor.h:
217             Removed use of redundant classes.
218
219 2011-02-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
220
221         Unreviewed build fix for Symbian.
222
223         [Symbian] Revert the removal of linking 
224         against hal after r79126.
225
226         Dependency on the hal library can not be removed 
227         as it is still used (e.g. in MarkStackSymbian.cpp).
228
229         * JavaScriptCore.pri:
230
231 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
232
233         Interpreter build fix.
234
235         * runtime/ArrayConstructor.cpp:
236         * runtime/BooleanPrototype.cpp:
237         * runtime/DateConstructor.cpp:
238         * runtime/ErrorPrototype.cpp:
239         * runtime/FunctionPrototype.cpp:
240         * runtime/Lookup.cpp:
241         * runtime/NumberPrototype.cpp:
242         * runtime/ObjectConstructor.cpp:
243         * runtime/ObjectPrototype.cpp:
244         * runtime/RegExpPrototype.cpp:
245         * runtime/StringConstructor.cpp:
246
247 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
248
249         Build fix!!
250
251         * JavaScriptCore.exp:
252
253 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
254
255         Windows build fix!!
256
257         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
258
259 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
260
261         Windows build fix!
262
263         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
264
265 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
266
267         Build fix!
268
269         * JavaScriptCore.exp:
270
271 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
272
273         Reviewed by Sam Weinig.
274
275         Bug 54786 - Devirtualize JSCell::classInfo()
276
277         Instead of making a virtual function call, add a pointer to the ClassInfo
278         onto Structure.
279
280         This removes a virtual function call, and paves the way towards removing all
281         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
282         (these should be able to move onto ClassInfo).
283
284         Calls to Structure::create must now pass a pointer to the ClassInfo for the
285         structure. All objects now have a ClassInfo pointer, non-object cell types
286         still do not.
287
288         Changes are most mechanical, involving three steps:
289             * Remove virtual classInfo() methods.
290             * Add &s_info parameter to calls to Structure::create.
291             * Rename ClassInfo static members on classes from 'info' to 's_info',
292               for consistency.
293
294         * API/JSCallbackConstructor.cpp:
295         * API/JSCallbackConstructor.h:
296         * API/JSCallbackFunction.cpp:
297         * API/JSCallbackFunction.h:
298         * API/JSCallbackObject.cpp:
299         * API/JSCallbackObject.h:
300         * API/JSCallbackObjectFunctions.h:
301         * API/JSObjectRef.cpp:
302         * API/JSValueRef.cpp:
303         * API/JSWeakObjectMapRefPrivate.cpp:
304         * JavaScriptCore.exp:
305         * debugger/Debugger.cpp:
306         * debugger/DebuggerActivation.h:
307         * debugger/DebuggerCallFrame.cpp:
308         * interpreter/Interpreter.cpp:
309         * jit/JITCall32_64.cpp:
310         * jit/JITOpcodes.cpp:
311         * jit/JITStubs.cpp:
312         * profiler/Profiler.cpp:
313         * runtime/Arguments.cpp:
314         * runtime/Arguments.h:
315         * runtime/ArrayConstructor.cpp:
316         * runtime/ArrayPrototype.cpp:
317         * runtime/ArrayPrototype.h:
318         * runtime/BooleanObject.cpp:
319         * runtime/BooleanObject.h:
320         * runtime/BooleanPrototype.cpp:
321         * runtime/DateConstructor.cpp:
322         * runtime/DateInstance.cpp:
323         * runtime/DateInstance.h:
324         * runtime/DatePrototype.cpp:
325         * runtime/DatePrototype.h:
326         * runtime/ErrorInstance.cpp:
327         * runtime/ErrorInstance.h:
328         * runtime/ErrorPrototype.cpp:
329         * runtime/FunctionPrototype.cpp:
330         * runtime/FunctionPrototype.h:
331         * runtime/GetterSetter.h:
332         * runtime/GlobalEvalFunction.h:
333         * runtime/InternalFunction.cpp:
334         * runtime/InternalFunction.h:
335         * runtime/JSAPIValueWrapper.h:
336         * runtime/JSActivation.cpp:
337         * runtime/JSActivation.h:
338         * runtime/JSArray.cpp:
339         * runtime/JSArray.h:
340         * runtime/JSByteArray.cpp:
341         * runtime/JSByteArray.h:
342         * runtime/JSCell.cpp:
343         * runtime/JSCell.h:
344         * runtime/JSFunction.cpp:
345         * runtime/JSFunction.h:
346         * runtime/JSGlobalData.cpp:
347         * runtime/JSGlobalObject.cpp:
348         * runtime/JSGlobalObject.h:
349         * runtime/JSNotAnObject.h:
350         * runtime/JSONObject.cpp:
351         * runtime/JSONObject.h:
352         * runtime/JSObject.cpp:
353         * runtime/JSObject.h:
354         * runtime/JSObjectWithGlobalObject.h:
355         * runtime/JSPropertyNameIterator.h:
356         * runtime/JSStaticScopeObject.h:
357         * runtime/JSString.h:
358         * runtime/JSVariableObject.h:
359         * runtime/JSWrapperObject.h:
360         * runtime/JSZombie.cpp:
361         * runtime/JSZombie.h:
362         * runtime/Lookup.cpp:
363         * runtime/MathObject.cpp:
364         * runtime/MathObject.h:
365         * runtime/NativeErrorConstructor.cpp:
366         * runtime/NativeErrorConstructor.h:
367         * runtime/NumberConstructor.cpp:
368         * runtime/NumberConstructor.h:
369         * runtime/NumberObject.cpp:
370         * runtime/NumberObject.h:
371         * runtime/NumberPrototype.cpp:
372         * runtime/ObjectConstructor.cpp:
373         * runtime/ObjectPrototype.cpp:
374         * runtime/RegExpConstructor.cpp:
375         * runtime/RegExpConstructor.h:
376         * runtime/RegExpObject.cpp:
377         * runtime/RegExpObject.h:
378         * runtime/RegExpPrototype.cpp:
379         * runtime/ScopeChain.cpp:
380         * runtime/StringConstructor.cpp:
381         * runtime/StringObject.cpp:
382         * runtime/StringObject.h:
383         * runtime/StringObjectThatMasqueradesAsUndefined.h:
384         * runtime/StringPrototype.cpp:
385         * runtime/StringPrototype.h:
386         * runtime/Structure.cpp:
387         * runtime/Structure.h:
388
389 2011-02-19  David Kilzer  <ddkilzer@apple.com>
390
391         <http://webkit.org/b/54808> Change jsc target to build directly into JavaScriptCore.framework/Resources/jsc
392
393         Reviewed by Dan Bernstein.
394
395         * Configurations/Base.xcconfig: Added
396         JAVASCRIPTCORE_FRAMEWORKS_DIR variable.
397         * Configurations/JavaScriptCore.xcconfig: Used
398         JAVASCRIPTCORE_FRAMEWORKS_DIR to define INSTALL_PATH.
399         * JavaScriptCore.xcodeproj/project.pbxproj: Set the INSTALL_PATH
400         for Production configuration of jsc target.
401         (Copy Into Framework): Removed old build phase.
402         (Fix Framework Reference): Renamed build phase to "Copy Into
403         Framework".  Added "set -x" call to make the script print the
404         commands it is running.  Added code to exit early for Production
405         builds since this was never intended for them.  Added code to
406         copy jsc into the JavaScriptCore.framework/Resources directory.
407
408 2011-02-19  Siddharth Mathur  <siddharth.mathur@nokia.com>
409
410         Reviewed by Laszlo Gombos.
411
412         [Symbian] OSAllocator implementation for Symbian OS. 
413         Manages both data and code region requests. V8 and Sunspider tested
414         OK with interpreter. Not tested with JSC JIT yet as it has unrelated
415         failures. Also no thread safety yet.
416         https://bugs.webkit.org/show_bug.cgi?id=51128
417
418         * JavaScriptCore.pri: removed HAL linkage
419         * wtf/Bitmap.h:
420         (WTF::::findRunOfZeros): find run of zeros in a bitmap. quick n dirty
421         * wtf/OSAllocator.h:
422         (WTF::OSAllocator::decommitAndRelease): decommit explicitly 
423         * wtf/OSAllocatorSymbian.cpp: Impl. of OSAllocator interface 
424         (WTF::allocateCodeChunk): utility for code chunks
425         (WTF::deallocateCodeChunk): utility for code chunks
426         (WTF::dataAllocatorInstance): getter for data allocator instance
427         (WTF::OSAllocator::reserveUncommitted):
428         (WTF::OSAllocator::releaseDecommitted):
429         (WTF::OSAllocator::commit):
430         (WTF::OSAllocator::decommit):
431         (WTF::OSAllocator::reserveAndCommit):
432         (WTF::PageAllocatorSymbian::PageAllocatorSymbian): maps requests 
433         to one underlying Symbian chunk
434         (WTF::PageAllocatorSymbian::~PageAllocatorSymbian):
435         (WTF::PageAllocatorSymbian::reserve):
436         (WTF::PageAllocatorSymbian::release):
437         (WTF::PageAllocatorSymbian::commit):
438         (WTF::PageAllocatorSymbian::decommit):
439         (WTF::PageAllocatorSymbian::contains):
440         * wtf/PageAllocatorSymbian.h: Added.
441         (WTF::SymbianChunk::SymbianChunk): wrapper around RChunk  
442         (WTF::SymbianChunk::~SymbianChunk):
443         (WTF::SymbianChunk::contains):
444         
445 2011-02-19  Yong Li  <yoli@rim.com>
446
447         Reviewed by Eric Seidel.
448
449         https://bugs.webkit.org/show_bug.cgi?id=54687
450         When being built with armcc, "int" bit fields are treated as
451         unsigned integers, which will fail the comparisons like "m_offset == -1".
452         Using "signed" fixes the problem.
453
454         * assembler/ARMAssembler.h:
455         * assembler/ARMv7Assembler.h:
456
457 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
458
459         Reviewed by Sam Weinig.
460
461         Made MarkedSpace block iteration size-class agnostic
462         https://bugs.webkit.org/show_bug.cgi?id=54792
463         
464         SunSpider reports no change.
465
466         * runtime/MarkedSpace.cpp:
467         (JSC::MarkedSpace::clearMarks):
468         (JSC::MarkedSpace::sweep):
469         (JSC::MarkedSpace::objectCount):
470         (JSC::MarkedSpace::size):
471         (JSC::MarkedSpace::capacity):
472         * runtime/MarkedSpace.h:
473         (JSC::MarkedSpace::forEach): Iterate blocks in hashing order instead of
474         size class list order. This is a much simpler convention in a world
475         of many different size classes.
476
477 2011-02-18  Kristian Amlie  <kristian.amlie@nokia.com>
478
479         Reviewed by Andreas Kling.
480
481         Added friend exception to Qt platform, which also compiles Windows.
482
483         QtWebKit fails to compile on Windows XP with msvc-2008
484         https://bugs.webkit.org/show_bug.cgi?id=54746
485
486         * bytecode/CodeBlock.h:
487         * runtime/RegExpObject.h:
488
489 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
490
491         (Rolled back in r79022 with crash fixed.)
492
493         Reviewed by Sam Weinig.
494
495         Use hashing instead of linear search in the conservative pointer test
496         https://bugs.webkit.org/show_bug.cgi?id=54767
497         
498         SunSpider reports no change.
499
500         * runtime/MarkedSpace.cpp:
501         (JSC::MarkedSpace::destroy): No need to explicitly clear the blocks array,
502         since freeBlock removes items for us.
503
504         (JSC::MarkedSpace::freeBlock): Fixed a typo that always removed the last
505         block from the block set instead of the block being freed. Changed to
506         remove a block from our data structures before deallocating it, since
507         this is slightly cleaner.
508
509         * runtime/MarkedSpace.h:
510         (JSC::MarkedSpace::contains): Variable-sized objects will use more,
511         smaller blocks, so it's important for the contains check not to be O(n)
512         in the number of blocks.
513
514 2011-02-18  chris reiss  <christopher.reiss@nokia.com>
515
516         Reviewed by Andreas Kling.
517
518         REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
519         https://bugs.webkit.org/show_bug.cgi?id=49989
520
521         updated test fast/js/script-tests/date-parse-test.js
522
523         * wtf/DateMath.cpp:
524         (WTF::parseDateFromNullTerminatedCharacters):
525
526 2011-02-18  Sheriff Bot  <webkit.review.bot@gmail.com>
527
528         Unreviewed, rolling out r79022.
529         http://trac.webkit.org/changeset/79022
530         https://bugs.webkit.org/show_bug.cgi?id=54775
531
532         It broke the whole world (Requested by Ossy on #webkit).
533
534         * runtime/MarkedSpace.h:
535         (JSC::MarkedSpace::contains):
536
537 2011-02-18  Yael Aharon  <yael.aharon@nokia.com>
538
539         Reviewed by Dave Hyatt.
540
541         Add support for dir=auto
542         https://bugs.webkit.org/show_bug.cgi?id=50916
543
544         Change defaultWritingDirection() to return if the writing direction
545         was determined from a letter with strong directionality or not.
546
547         * JavaScriptCore.exp:
548         * JavaScriptCore.order:
549         * wtf/text/StringImpl.cpp:
550         (WTF::StringImpl::defaultWritingDirection):
551         * wtf/text/StringImpl.h:
552         * wtf/text/WTFString.h:
553         (WTF::String::defaultWritingDirection):
554
555 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
556
557         Reviewed by Sam Weinig.
558
559         Use hashing instead of linear search in the conservative pointer test
560         https://bugs.webkit.org/show_bug.cgi?id=54767
561         
562         SunSpider reports no change.
563
564         * runtime/MarkedSpace.h:
565         (JSC::MarkedSpace::contains): Variable-sized objects will use more,
566         smaller blocks, so it's important for the contains check not to be O(n)
567         in the number of blocks.
568
569 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
570
571         Reviewed by Sam Weinig.
572
573         Tightened some usage accounting code in MarkedSpace
574         https://bugs.webkit.org/show_bug.cgi?id=54761
575         
576         SunSpider reports no change.
577
578         * runtime/Heap.cpp:
579         (JSC::Heap::Heap): Initialize the marked space high water mark on
580         construction, instead of relying on some implicit subtleties to make
581         not initializing it work out OK.
582
583         * runtime/Heap.h: Fixed up includes.
584
585         * runtime/MarkedBlock.h: Made firstAtom() static so clients can call it
586         even without having allocated a block.
587
588         * runtime/MarkedSpace.cpp:
589         (JSC::MarkedSpace::MarkedSpace): Don't pre-allocate a block, since this
590         would be prohibitively expensive with multiple size classes.
591
592         (JSC::MarkedSpace::allocateBlock):
593         (JSC::MarkedSpace::freeBlock): Track allocated blocks in a hash set,
594         since linear search in the contains check will be prohibitively
595         expensive once we're using lots of smaller blocks.
596
597         (JSC::MarkedSpace::allocate): Don't assume that we always have a block
598         allocated, since we don't anymore. (See above.)
599
600         (JSC::MarkedSpace::reset):
601         * runtime/MarkedSpace.h: Updated for changes mentioned above.
602
603 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
604
605         Reviewed by Sam Weinig.
606
607         Made object allocation secretly variable-sized (Shhhh!)
608         https://bugs.webkit.org/show_bug.cgi?id=54721
609         
610         SunSpider reports no change.
611         
612         Internally, MarkedBlock now makes variable-sized allocations, even
613         though MarkedSpace doesn't take advantage of this yet.
614
615         * runtime/MarkedBlock.cpp:
616         (JSC::MarkedBlock::MarkedBlock): No need to ASSERT that allocations are
617         fixed-sized.
618
619         * runtime/MarkedBlock.h: Shrunk the atom size so we can allocate things
620         that are not multiples of 64 bytes.
621
622 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
623
624         Reviewed by Sam Weinig.
625
626         Fixed some math errors when when using variable-sized cells
627         https://bugs.webkit.org/show_bug.cgi?id=54717
628         
629         SunSpider reports no change.
630         
631         Computer Science Barbie says, "Math is not so hard afterall!"
632
633         * runtime/JSCell.h:
634         (JSC::JSCell::MarkedBlock::allocate): Round up when calculating the
635         minimum number of atoms required for a cell, since rounding down
636         will get you splinched.
637
638         * runtime/MarkedBlock.cpp:
639         (JSC::MarkedBlock::MarkedBlock):
640         (JSC::MarkedBlock::sweep):
641         * runtime/MarkedBlock.h:
642         (JSC::MarkedBlock::forEach): Changed a bunch of != tests to < tests
643         because m_endAtom is actually a fuzzy end -- iterating from firstAtom()
644         may not hit m_endAtom exactly.
645
646 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
647
648         Reviewed by Sam Weinig.
649
650         A little more abstraction for MarkedSpace::contains
651         https://bugs.webkit.org/show_bug.cgi?id=54715
652
653         * runtime/MarkedBlock.h:
654         (JSC::MarkedBlock::contains): Added a contains function, so MarkedSpace
655         doesn't have to know how MarkedBlock tracks containment internally.
656
657         * runtime/MarkedSpace.h:
658         (JSC::MarkedSpace::contains): Call through to MarkedBlock to figure out
659         if a cell that seems to be in a block is valid.
660
661 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
662
663         Reviewed by Sam Weinig.
664
665         Removed the invariant that the last cell in a block is always marked
666         https://bugs.webkit.org/show_bug.cgi?id=54713
667         
668         SunSpider reports no change.
669         
670         This adds one branch to allocation, but simplifies the mark invariant,
671         especially in a world of variable-sized cells. Now, it really is true
672         that any cell whose mark bit is set is a valid, live cell whose
673         constructor has run and whose destructor has not run.
674
675         * runtime/JSCell.h: 
676         (JSC::JSCell::MarkedBlock::allocate): Changed this do-while into a while
677         since we can no longer rely on a set mark bit to break out of this loop
678         before it reaches the end of the block.
679
680         * runtime/MarkedBlock.cpp:
681         (JSC::MarkedBlock::MarkedBlock):
682         (JSC::MarkedBlock::sweep): 
683         * runtime/MarkedBlock.h:
684         (JSC::MarkedBlock::isEmpty):
685         (JSC::MarkedBlock::clearMarks):
686         (JSC::MarkedBlock::markCount):
687         (JSC::MarkedBlock::forEach): No need to set a special last mark bit.
688
689 2011-02-17  Sheriff Bot  <webkit.review.bot@gmail.com>
690
691         Unreviewed, rolling out r78856 and r78907.
692         http://trac.webkit.org/changeset/78856
693         http://trac.webkit.org/changeset/78907
694         https://bugs.webkit.org/show_bug.cgi?id=54705
695
696         These seem to break tests on 32-bit builds. (Requested by
697         aroben on #webkit).
698
699         * JavaScriptCore.xcodeproj/project.pbxproj:
700         * collector/handles/Global.h:
701         (JSC::Global::internalSet):
702         * collector/handles/Handle.h:
703         (JSC::HandleTypes::getFromSlot):
704         (JSC::HandleTypes::toJSValue):
705         (JSC::HandleTypes::validateUpcast):
706         (JSC::HandleConverter::operator->):
707         (JSC::HandleConverter::operator*):
708         (JSC::Handle::Handle):
709         (JSC::Handle::get):
710         * runtime/JSArray.cpp:
711         (JSC::JSArray::sortNumeric):
712         * runtime/JSObject.h:
713         (JSC::JSObject::inlineGetOwnPropertySlot):
714         * runtime/SlotAccessor.h: Removed.
715         * runtime/WeakGCPtr.h:
716         (JSC::WeakGCPtr::get):
717         (JSC::WeakGCPtr::internalSet):
718         * runtime/WriteBarrier.h:
719         (JSC::DeprecatedPtr::DeprecatedPtr):
720         (JSC::DeprecatedPtr::get):
721         (JSC::DeprecatedPtr::operator*):
722         (JSC::DeprecatedPtr::operator->):
723         (JSC::DeprecatedPtr::slot):
724         (JSC::DeprecatedPtr::operator UnspecifiedBoolType*):
725         (JSC::DeprecatedPtr::operator!):
726         (JSC::WriteBarrierBase::set):
727         (JSC::WriteBarrierBase::get):
728         (JSC::WriteBarrierBase::operator*):
729         (JSC::WriteBarrierBase::operator->):
730         (JSC::WriteBarrierBase::clear):
731         (JSC::WriteBarrierBase::slot):
732         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
733         (JSC::WriteBarrierBase::operator!):
734         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
735         (JSC::WriteBarrier::WriteBarrier):
736
737 2011-02-17  Csaba Osztrogon√°c  <ossy@webkit.org>
738
739         Unreviewed.
740
741         [Qt] Buildfix.
742
743         * wtf/RetainPtr.h: Add missing PLATFORM(CF) guard.
744
745 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
746
747         Reviewed by Oliver Hunt.
748
749         Made MarkedBlock variable-sized
750         https://bugs.webkit.org/show_bug.cgi?id=54692
751         
752         SunSpider reports no change.
753         
754         Each MarkedBlock is now composed of a set of fixed-sized atoms, with one
755         mark bit per atom. A given cell may be composed of one or more atoms.
756         
757         * runtime/Heap.cpp:
758         (JSC::Heap::allocate): Made fixed-sizedness a property of MarkedSpace,
759         bubbling it up from MarkedBlock, since MarkedBlock now supports variable-
760         sizedness.
761
762         * runtime/JSCell.h:
763         (JSC::JSCell::MarkedBlock::allocate): Removed use of CELLS_PER_BLOCK and
764         (implicit) one constants -- these quantities are not constant anymore.
765         Updated for switch from cell to atom.
766
767         * runtime/MarkedBlock.cpp:
768         (JSC::MarkedBlock::create):
769         (JSC::MarkedBlock::destroy):
770         (JSC::MarkedBlock::MarkedBlock):
771         (JSC::MarkedBlock::sweep):
772         * runtime/MarkedBlock.h:
773         (JSC::MarkedBlock::firstAtom):
774         (JSC::MarkedBlock::atoms):
775         (JSC::MarkedBlock::isAtomAligned):
776         (JSC::MarkedBlock::blockFor):
777         (JSC::MarkedBlock::isEmpty):
778         (JSC::MarkedBlock::clearMarks):
779         (JSC::MarkedBlock::size):
780         (JSC::MarkedBlock::capacity):
781         (JSC::MarkedBlock::atomNumber):
782         (JSC::MarkedBlock::isMarked):
783         (JSC::MarkedBlock::testAndSetMarked):
784         (JSC::MarkedBlock::setMarked):
785         (JSC::MarkedBlock::forEach): Same as above. Also removed use of CELL_SIZE
786         and BLOCK_SIZE, and switched away from calling arbitrary pointers cells.
787
788         * runtime/MarkedSpace.cpp:
789         (JSC::MarkedSpace::MarkedSpace):
790         (JSC::MarkedSpace::allocateBlock):
791         (JSC::MarkedSpace::allocate):
792         (JSC::MarkedSpace::reset):
793         * runtime/MarkedSpace.h:
794         (JSC::CollectorHeap::CollectorHeap):
795         (JSC::MarkedSpace::contains): Updated for renames. Made fixed-sizedness
796         a property of MarkedSpace.
797
798 2011-02-17  Oliver Hunt  <oliver@apple.com>
799
800         Attempt to fix windows build
801
802         * runtime/WriteBarrier.h:
803
804 2011-02-17  Oliver Hunt  <oliver@apple.com>
805
806         Reviewed by Geoffrey Garen.
807
808         Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
809         https://bugs.webkit.org/show_bug.cgi?id=54608
810
811         Make use of the tricks used for Handle, et al to avoid duplicating all
812         of the logic for DeprecatedPtr and WriteBarrier simply to support known
813         vs. unknown types.
814
815         * JavaScriptCore.xcodeproj/project.pbxproj:
816         * collector/handles/Global.h:
817         (JSC::Global::internalSet):
818         * collector/handles/Handle.h:
819         (JSC::Handle::Handle):
820         (JSC::Handle::get):
821         * runtime/JSArray.cpp:
822         (JSC::JSArray::sortNumeric):
823         * runtime/JSObject.h:
824         (JSC::JSObject::inlineGetOwnPropertySlot):
825         * runtime/SlotAccessor.h: Added.
826         (JSC::SlotTypes::getFromBaseType):
827         (JSC::SlotTypes::convertToBaseType):
828         (JSC::SlotTypes::getFromSlot):
829         (JSC::SlotTypes::toJSValue):
830         (JSC::SlotTypes::validateUpcast):
831         (JSC::SlotAccessor::operator->):
832         (JSC::SlotAccessor::operator*):
833         * runtime/WeakGCPtr.h:
834         (JSC::WeakGCPtr::get):
835         (JSC::WeakGCPtr::internalSet):
836         * runtime/WriteBarrier.h:
837         (JSC::DeprecatedPtr::DeprecatedPtr):
838         (JSC::DeprecatedPtr::get):
839         (JSC::DeprecatedPtr::slot):
840         (JSC::DeprecatedPtr::operator=):
841         (JSC::WriteBarrierTranslator::convertToStorage):
842         (JSC::WriteBarrierTranslator::convertFromStorage):
843         (JSC::WriteBarrierBase::set):
844         (JSC::WriteBarrierBase::get):
845         (JSC::WriteBarrierBase::clear):
846         (JSC::WriteBarrierBase::slot):
847         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
848         (JSC::WriteBarrierBase::operator!):
849         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
850         (JSC::WriteBarrier::WriteBarrier):
851
852 2011-02-17  Kevin Ollivier  <kevino@theolliviers.com>
853
854         [wx] Revert incorrect blind fix and restore previous working code.
855
856         * wtf/wx/StringWx.cpp:
857         (WTF::String::String):
858
859 2011-02-16  Geoffrey Garen  <ggaren@apple.com>
860
861         Reviewed by Maciej Stachowiak.
862
863         Intermittent crashes beneath MarkStack::drain
864         https://bugs.webkit.org/show_bug.cgi?id=54614
865         <rdar://problem/8971070>
866         
867         The crashes were caused by a GC happening after the global object's
868         property table had grown (due to compilation), but before the properties
869         had been fully initialized by program execution.
870
871         * bytecompiler/BytecodeGenerator.cpp:
872         (JSC::BytecodeGenerator::BytecodeGenerator): Explicitly resize the global
873         object's register storage immediately, without waiting for program
874         execution to do it for us. This ensures that the global object's count
875         of global variables is consistent with the size of its global variable
876         storage at all times, and it ensures that all global variables are
877         properly initialized from the get-go.
878
879         * runtime/JSGlobalObject.cpp:
880         (JSC::JSGlobalObject::resizeRegisters):
881         * runtime/JSGlobalObject.h: Added a helper function for growing the
882         global object's register storage, and initializing new registers.
883
884 == Rolled over to ChangeLog-2011-02-16 ==