7f0371f21b7bd2919aef564ce57cc97bd454c567
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2011-03-03  Oliver Hunt  <oliver@apple.com>
2
3         Reviewed by Geoffrey Garen.
4
5         JSVariableObject needs to use WriteBarrier for symboltable property storage
6         https://bugs.webkit.org/show_bug.cgi?id=55698
7
8         Replace the direct usage of Register in JSVariableObject (and descendents)
9         with WriteBarrier.  This requires updating the Arguments object to use
10         WriteBarrier as well.
11
12         * interpreter/Interpreter.cpp:
13         (JSC::Interpreter::unwindCallFrame):
14         (JSC::Interpreter::privateExecute):
15         (JSC::Interpreter::retrieveArguments):
16         * jit/JITStubs.cpp:
17         (JSC::DEFINE_STUB_FUNCTION):
18         * runtime/ArgList.h:
19         (JSC::MarkedArgumentBuffer::initialize):
20         * runtime/Arguments.cpp:
21         (JSC::Arguments::markChildren):
22         (JSC::Arguments::copyToRegisters):
23         (JSC::Arguments::fillArgList):
24         (JSC::Arguments::getOwnPropertySlot):
25         (JSC::Arguments::getOwnPropertyDescriptor):
26         (JSC::Arguments::put):
27         * runtime/Arguments.h:
28         (JSC::Arguments::setActivation):
29         (JSC::Arguments::Arguments):
30         (JSC::Arguments::copyRegisters):
31         (JSC::JSActivation::copyRegisters):
32         * runtime/JSActivation.cpp:
33         (JSC::JSActivation::markChildren):
34         (JSC::JSActivation::symbolTableGet):
35         (JSC::JSActivation::symbolTablePut):
36         (JSC::JSActivation::symbolTablePutWithAttributes):
37         (JSC::JSActivation::put):
38         (JSC::JSActivation::putWithAttributes):
39         (JSC::JSActivation::argumentsGetter):
40         * runtime/JSActivation.h:
41         * runtime/JSGlobalObject.cpp:
42         (JSC::JSGlobalObject::put):
43         (JSC::JSGlobalObject::putWithAttributes):
44         (JSC::JSGlobalObject::markChildren):
45         (JSC::JSGlobalObject::copyGlobalsFrom):
46         (JSC::JSGlobalObject::copyGlobalsTo):
47         (JSC::JSGlobalObject::resizeRegisters):
48         * runtime/JSGlobalObject.h:
49         (JSC::JSGlobalObject::setRegisters):
50         (JSC::JSGlobalObject::addStaticGlobals):
51         * runtime/JSStaticScopeObject.cpp:
52         (JSC::JSStaticScopeObject::put):
53         (JSC::JSStaticScopeObject::putWithAttributes):
54         * runtime/JSVariableObject.cpp:
55         (JSC::JSVariableObject::symbolTableGet):
56         * runtime/JSVariableObject.h:
57         (JSC::JSVariableObject::registerAt):
58         (JSC::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
59         (JSC::JSVariableObject::symbolTableGet):
60         (JSC::JSVariableObject::symbolTablePut):
61         (JSC::JSVariableObject::symbolTablePutWithAttributes):
62         (JSC::JSVariableObject::copyRegisterArray):
63         (JSC::JSVariableObject::setRegisters):
64
65 2011-03-03  Geoffrey Garen  <ggaren@apple.com>
66
67         Try to fix Windows build.
68
69         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed obsolete symbol.
70
71         * runtime/JSStaticScopeObject.cpp:
72         (JSC::JSStaticScopeObject::getOwnPropertySlot): Don't mark this function
73         inline -- it's virtual.
74
75 2011-03-02  Geoffrey Garen  <ggaren@apple.com>
76
77         Reviewed by Darin Adler.
78
79         Moved all variable object storage inline -- upping the object size limit to 1K
80         https://bugs.webkit.org/show_bug.cgi?id=55653
81
82         * JavaScriptCore.exp:
83         * bytecompiler/BytecodeGenerator.cpp:
84         * jit/JITOpcodes.cpp:
85         * runtime/Arguments.h:
86         * runtime/JSActivation.h: Removed out-of-line storage. Changed d-> to m_.
87
88         * runtime/JSCell.h:
89         (JSC::JSCell::MarkedSpace::sizeClassFor): Added an imprecise size class
90         to accomodate objects up to 1K.
91
92         * runtime/JSGlobalObject.cpp:
93         * runtime/JSGlobalObject.h: Removed out-of-line storage. Changed d-> to m_.
94
95         * runtime/JSObject.cpp: Don't ASSERT that JSFinalObject fills the maximum
96         object size, since it doesn't anymore.
97
98         * runtime/JSStaticScopeObject.cpp:
99         * runtime/JSStaticScopeObject.h:
100         * runtime/JSVariableObject.h: Removed out-of-line storage. Changed d-> to m_.
101
102         * runtime/MarkedSpace.cpp:
103         (JSC::MarkedSpace::MarkedSpace):
104         (JSC::MarkedSpace::reset):
105         * runtime/MarkedSpace.h: Added an imprecise size class to accomodate objects up to 1K.
106
107 2011-03-03  Timothy Hatcher  <timothy@apple.com>
108
109         Make APIShims usable from WebCore.
110
111         Reviewed by Oliver Hunt.
112
113         * ForwardingHeaders/JavaScriptCore/APIShims.h: Added.
114         * GNUmakefile.am:
115         * JavaScriptCore.exp:
116         * JavaScriptCore.gypi:
117         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
118         * JavaScriptCore.xcodeproj/project.pbxproj:
119
120 2011-03-03  Peter Varga  <pvarga@webkit.org>
121
122         Reviewed by Oliver Hunt.
123
124         Begin Characters Optimization Causes YARR Interpreter Errors
125         https://bugs.webkit.org/show_bug.cgi?id=55479
126
127         The addBeginTerm function is removed because it doesn't correctly handle those
128         cases when an "invalid" term has been
129         collected (e.g. CharacterClass). Move the removed function to the
130         setupAlternativeBeginTerms method's switch-case
131         where the non-allowed cases are correctly handled.
132
133         Reenable the Beginning Character Optimization in the YARR Interpreter again.
134
135         * yarr/YarrPattern.cpp:
136         (JSC::Yarr::YarrPatternConstructor::setupAlternativeBeginTerms):
137         (JSC::Yarr::YarrPattern::compile):
138
139 2011-03-02  Jessie Berlin  <jberlin@apple.com>
140
141         Reviewed by Adam Roben.
142
143         WebKit2: Use CFNetwork Sessions API.
144         https://bugs.webkit.org/show_bug.cgi?id=55435
145
146         Add the ability to create a Private Browsing storage session.
147
148         * wtf/Platform.h:
149         Add a new #define for using CF Storage Sessions.
150
151 2011-03-02  Oliver Hunt  <oliver@apple.com>
152
153         Reviewed by Gavin Barraclough.
154
155         Remove "register slot" concept from PropertySlot
156         https://bugs.webkit.org/show_bug.cgi?id=55621
157
158         PropertySlot had already stopped storing Register "slots"
159         so this patch is simply removing that api entirely.
160         This exposed a problem in the ProgramNode constructor for
161         BytecodeGenerator where it reads from the registerfile
162         before it has initialised it.
163
164         This bug wasn't a problem before as we were merely testing
165         for property existence rather than the actual value, and
166         used to work because setRegisterSlot didn't check that the
167         provided slot contained an initialised value.
168
169         To get around this issue we now use symbolTableHasProperty
170         to do the symbol table check without trying to read the
171         RegisterFile.
172
173         * JavaScriptCore.xcodeproj/project.pbxproj:
174         * bytecompiler/BytecodeGenerator.cpp:
175         (JSC::BytecodeGenerator::BytecodeGenerator):
176         * runtime/Arguments.cpp:
177         (JSC::Arguments::getOwnPropertySlot):
178         * runtime/JSActivation.cpp:
179         (JSC::JSActivation::symbolTableGet):
180         * runtime/JSGlobalObject.h:
181         (JSC::JSGlobalObject::symbolTableHasProperty):
182         * runtime/JSVariableObject.h:
183         (JSC::JSVariableObject::symbolTableGet):
184         * runtime/PropertySlot.h:
185
186 2011-03-02  Daniel Cheng  <dcheng@chromium.org>
187
188         Reviewed by David Levin.
189
190         Add feature define for data transfer items
191         https://bugs.webkit.org/show_bug.cgi?id=55510
192
193         * Configurations/FeatureDefines.xcconfig:
194         * wtf/Platform.h:
195
196 2011-03-02  Adam Roben  <aroben@apple.com>
197
198         Delete old .res files whenever any .vsprops file changes
199
200         Prospective fix for <http://webkit.org/b/55599> r80079 caused incremental Windows builds to
201         fail
202
203         Reviewed by Tony Chang.
204
205         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
206         (main): Restructured code to loop over a set of file extensions, deleting any old files that
207         have that extension. Now deletes .res files, too. (We previously deleted any file matching
208         *.manifest*, but that turned out to just be the union of *.manifest and *.res.)
209
210 2011-03-02  Adam Barth  <abarth@webkit.org>
211
212         Reviewed by Dimitri Glazkov.
213
214         Teach JavaScriptCore GYP build how to build minidom
215         https://bugs.webkit.org/show_bug.cgi?id=55536
216
217         * JavaScriptCore.gypi:
218         * gyp/JavaScriptCore.gyp:
219
220 2011-03-01  Adam Barth  <abarth@webkit.org>
221
222         Reviewed by Eric Seidel.
223
224         JavaScriptCore GYP build should copy some headers into the target framework
225         https://bugs.webkit.org/show_bug.cgi?id=55524
226
227         After this patch, all the framework headers are exported as public
228         headers.  We need to teach GYP how to handle private headers.
229
230         I struggled to determine how to store the information about whether a
231         header was public, private, or project (i.e., not exported).
232         Generally, the GYPI should just list the files, but it seemed siliy to
233         have an almost duplicated list of files in the GYP file itself.  If
234         this design doesn't scale, we might have to revisit it in the future.
235
236         * JavaScriptCore.gyp/JavaScriptCore.gyp:
237         * JavaScriptCore.gypi:
238         * gyp/JavaScriptCore.gyp:
239
240 2011-03-01  Sheriff Bot  <webkit.review.bot@gmail.com>
241
242         Unreviewed, rolling out r80079.
243         http://trac.webkit.org/changeset/80079
244         https://bugs.webkit.org/show_bug.cgi?id=55547
245
246         "Broke the Win debug build?" (Requested by dcheng on #webkit).
247
248         * wtf/Platform.h:
249
250 2011-03-01  Daniel Cheng  <dcheng@chromium.org>
251
252         Reviewed by David Levin.
253
254         Add feature define for data transfer items
255         https://bugs.webkit.org/show_bug.cgi?id=55510
256
257         * wtf/Platform.h:
258
259 2011-03-01  Oliver Hunt  <oliver@apple.com>
260
261         Reviewed by Joseph Pecoraro.
262
263         Misaligned memory access in CloneDeserializer on all ARM arch.
264         https://bugs.webkit.org/show_bug.cgi?id=48742
265
266         Add a CPU class for architectures that need aligned addresses
267         for memory access.
268
269         * wtf/Platform.h:
270
271 2011-03-01  Adam Barth  <abarth@webkit.org>
272
273         Reviewed by Dimitri Glazkov.
274
275         Add pre- and post-build actions for JavaScriptCore GYP build
276         https://bugs.webkit.org/show_bug.cgi?id=55507
277
278         After this patch, we have all the steps for building the main
279         JavaScriptCore framework except the "copy headers" step, which I'll do
280         next.
281
282         * gyp/JavaScriptCore.gyp:
283
284 2011-03-01  Geoffrey Garen  <ggaren@apple.com>
285
286         Reviewed by Sam Weinig.
287
288         Rolled back in r79627 now that the underlying cause for it crashing is fixed.
289         https://bugs.webkit.org/show_bug.cgi?id=55159
290
291         * JavaScriptCore.exp:
292         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
293         * JavaScriptCore.xcodeproj/project.pbxproj:
294         * runtime/Heap.cpp:
295         (JSC::Heap::allocateSlowCase):
296         * runtime/Heap.h:
297         * runtime/JSCell.h:
298         (JSC::JSCell::MarkedSpace::sizeClassFor):
299         (JSC::JSCell::Heap::allocate):
300         (JSC::JSCell::JSCell::operator new):
301         * runtime/MarkedBlock.h:
302         * runtime/MarkedSpace.cpp:
303         (JSC::MarkedSpace::MarkedSpace):
304         (JSC::MarkedSpace::allocateBlock):
305         (JSC::MarkedSpace::reset):
306         * runtime/MarkedSpace.h:
307         (JSC::MarkedSpace::SizeClass::SizeClass):
308
309 2011-03-01  Mark Rowe  <mrowe@apple.com>
310
311         Reviewed by Sam Weinig.
312
313         Replace two script phases that do nothing but copy files with copy files build phases.
314
315         This speeds up the build by a few seconds on high-end Mac Pros.
316
317         * JavaScriptCore.xcodeproj/project.pbxproj:
318
319 2011-03-01  David Kilzer  <ddkilzer@apple.com>
320
321         Spring cleaning!
322
323         Rubber-stamped by Mark Rowe.
324
325         * JavaScriptCore.xcodeproj/project.pbxproj:
326         (Copy Into Framework): Remove "set -x" and its comment.
327
328 2011-03-01  Michael Saboff  <msaboff@apple.com>
329
330         Reviewed by Darin Adler.
331
332         TinyMCE not working in nightlies
333         https://bugs.webkit.org/show_bug.cgi?id=54978
334
335         Disabling setupBeginChars() to temporarily work arround the test 
336         failure.  Filed https://bugs.webkit.org/show_bug.cgi?id=55479
337         to track fixing the issue.
338
339         * yarr/YarrPattern.cpp:
340         (JSC::Yarr::YarrPattern::compile):
341
342 2011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
343
344         Reviewed by Kenneth Rohde Christiansen.
345
346         Viewport parsing no longer accepts "1.0;" value as valid.
347         https://bugs.webkit.org/show_bug.cgi?id=53705
348
349         Include a didReadNumber parameter to String -> float / double
350         conversion functions. This way, if the "ok" boolean out
351         parameter is false, you can check to see if there in fact
352         was a valid number parsed with garbage at the end. Examples
353         of that would be parsing "123x456" would have ok = false,
354         but didReadNumber = true.
355
356         * JavaScriptCore.exp:
357         * wtf/text/StringImpl.cpp:
358         (WTF::StringImpl::toDouble):
359         (WTF::StringImpl::toFloat):
360         * wtf/text/StringImpl.h:
361         * wtf/text/WTFString.cpp:
362         (WTF::String::toDouble):
363         (WTF::String::toFloat):
364         (WTF::charactersToDouble):
365         (WTF::charactersToFloat):
366         * wtf/text/WTFString.h:
367
368 2011-02-28  Geoffrey Garen  <ggaren@apple.com>
369
370         Reviewed by Gavin Barraclough.
371
372         Past-the-end writes in VM exceptions (caused crashes in r79627)
373         https://bugs.webkit.org/show_bug.cgi?id=55448
374         
375         Some exceptions had the wrong structures, so they misoverestimated their
376         inline storage sizes.
377
378         * runtime/JSGlobalData.cpp:
379         (JSC::JSGlobalData::JSGlobalData): Use the right structure.
380
381         * runtime/JSObject.h:
382         (JSC::JSNonFinalObject::JSNonFinalObject):
383         (JSC::JSFinalObject::JSFinalObject): ASSERT that our structure capacity
384         is correct to verify this doesn't happen again.
385
386 2011-03-01  Andras Becsi  <abecsi@webkit.org>
387
388         Reviewed by Csaba Osztrogon√°c.
389
390         [Qt] Clean up the project files and move common options to WebKit.pri.
391
392         * JavaScriptCore.pri: Move options also needed in WebCore into WebKit.pri.
393         * JavaScriptCore.pro: Deduplicate options.
394         * jsc.pro: Ditto.
395
396 2011-03-01  Adam Barth  <abarth@webkit.org>
397
398         Reviewed by Eric Seidel.
399
400         Teach JavaScriptCore GYP build about DEPTH
401         https://bugs.webkit.org/show_bug.cgi?id=55425
402
403         In addition to teaching the JavaScriptCore GYP build about DEPTH, this
404         change overrides the GCC warning configuration to disable a warning
405         that's causing probems in Assertions.cpp.  With that warning disabled,
406         JavaScriptCore builds again.
407
408         * gyp/JavaScriptCore.gyp:
409
410 2011-02-28  Gavin Barraclough  <barraclough@apple.com>
411
412         Windows build fix.
413
414         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
415
416 2011-02-28  Sheriff Bot  <webkit.review.bot@gmail.com>
417
418         Unreviewed, rolling out r79948.
419         http://trac.webkit.org/changeset/79948
420         https://bugs.webkit.org/show_bug.cgi?id=55439
421
422         "caused crashes on the SL release bot" (Requested by ggaren on
423         #webkit).
424
425         * runtime/JSGlobalData.h:
426         * runtime/WriteBarrier.h:
427
428 2011-02-28  Gavin Barraclough  <barraclough@apple.com>
429
430         Windows build fix.
431
432         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
433
434 2011-02-28  Gavin Barraclough  <barraclough@apple.com>
435
436         Reviewed by Sam Weinig & Darin Adler.
437
438         Bug 55423 - Clean up property tables in Structure
439
440         Encapsulate, reduce duplication of table search code,
441         and reduce the size of the tables (remove the index,
442         just maintain the tables in the correct order).
443
444         Shows a 0.5% - 1% progression on sunspider.
445
446         * JavaScriptCore.exp:
447         * runtime/PropertyMapHashTable.h:
448         (JSC::isPowerOf2):
449         (JSC::nextPowerOf2):
450             bit ops used to calculate table size.
451         (JSC::PropertyMapEntry::PropertyMapEntry):
452         (JSC::PropertyTable::ordered_iterator::operator++):
453         (JSC::PropertyTable::ordered_iterator::operator==):
454         (JSC::PropertyTable::ordered_iterator::operator!=):
455         (JSC::PropertyTable::ordered_iterator::operator*):
456         (JSC::PropertyTable::ordered_iterator::operator->):
457         (JSC::PropertyTable::ordered_iterator::ordered_iterator):
458             implementation of the iterator types
459         (JSC::PropertyTable::PropertyTable):
460         (JSC::PropertyTable::~PropertyTable):
461             constructors take an initial capacity for the table,
462             a table to copy, or both.
463         (JSC::PropertyTable::begin):
464         (JSC::PropertyTable::end):
465             create in-order iterators.
466         (JSC::PropertyTable::find):
467             search the hash table
468         (JSC::PropertyTable::add):
469             add a value to the hash table
470         (JSC::PropertyTable::remove):
471             remove a value from the hash table
472         (JSC::PropertyTable::size):
473         (JSC::PropertyTable::isEmpty):
474             accessors.
475         (JSC::PropertyTable::propertyStorageSize):
476         (JSC::PropertyTable::clearDeletedOffsets):
477         (JSC::PropertyTable::hasDeletedOffset):
478         (JSC::PropertyTable::getDeletedOffset):
479         (JSC::PropertyTable::addDeletedOffset):
480             cache deleted (available) offsets in the property storage array.
481         (JSC::PropertyTable::copy):
482             take a copy of the PropertyTable, potentially expanding the capacity.
483         (JSC::PropertyTable::sizeInMemory):
484             used for DEBUG build statistics
485         (JSC::PropertyTable::reinsert):
486         (JSC::PropertyTable::rehash):
487         (JSC::PropertyTable::tableCapacity):
488         (JSC::PropertyTable::deletedEntryIndex):
489         (JSC::PropertyTable::skipDeletedEntries):
490         (JSC::PropertyTable::table):
491         (JSC::PropertyTable::usedCount):
492         (JSC::PropertyTable::dataSize):
493         (JSC::PropertyTable::sizeForCapacity):
494         (JSC::PropertyTable::canInsert):
495             these methods provide internal implementation.
496         * runtime/Structure.cpp:
497         (JSC::Structure::dumpStatistics):
498         (JSC::Structure::~Structure):
499         (JSC::Structure::materializePropertyMap):
500         (JSC::Structure::despecifyDictionaryFunction):
501         (JSC::Structure::addPropertyTransition):
502         (JSC::Structure::flattenDictionaryStructure):
503         (JSC::Structure::copyPropertyTable):
504         (JSC::Structure::get):
505         (JSC::Structure::despecifyFunction):
506         (JSC::Structure::despecifyAllFunctions):
507         (JSC::Structure::put):
508         (JSC::Structure::remove):
509         (JSC::Structure::createPropertyMap):
510         (JSC::Structure::getPropertyNames):
511         (JSC::PropertyTable::checkConsistency):
512         (JSC::Structure::checkConsistency):
513             factored out code to PropertyMapHashTable.h
514         * runtime/Structure.h:
515         (JSC::Structure::propertyStorageSize):
516         (JSC::Structure::isEmpty):
517         (JSC::Structure::get):
518             factored out code to PropertyMapHashTable.h
519
520 2011-02-28  Xan Lopez  <xlopez@igalia.com>
521
522         Another fix build :(
523
524         Fix typo.
525
526         * runtime/MachineStackMarker.cpp:
527         (JSC::freePlatformThreadRegisters):
528
529 2011-02-28  Xan Lopez  <xlopez@igalia.com>
530
531         Unreviewed build fix for Snow Leopard.
532
533         * runtime/MachineStackMarker.cpp:
534         (JSC::freePlatformThreadRegisters):
535
536 2011-02-28  Alejandro G. Castro  <alex@igalia.com>
537
538         Unreviewed, fix SnowLeopard compilation after r79952.
539
540         * runtime/MachineStackMarker.cpp:
541         (JSC::freePlatformThreadRegisters):
542
543 2011-02-28  Mark Rowe  <mrowe@apple.com>
544
545         Reviewed by Darin Adler.
546
547         <http://webkit.org/b/55430> OwnArrayPtr.h's LOOSE_OWN_ARRAY_PTR results in link errors.
548
549         * wtf/OwnArrayPtr.h:
550         (WTF::::set): Implement OwnArrayPtr::set.
551
552 2011-02-28  Martin Zoubek  <martin.zoubek@acision.com> and Alejandro G. Castro  <alex@igalia.com>
553
554         Reviewed by Martin Robinson.
555
556         Multithread support for JSC on UNIX
557         https://bugs.webkit.org/show_bug.cgi?id=26838
558
559         Implement suspendThread() and resumeThread() for systems with
560         pthread.h using thread signal handler.
561
562         * runtime/MachineStackMarker.cpp:
563         (JSC::pthreadSignalHandlerSuspendResume):
564         (JSC::MachineStackMarker::Thread::Thread):
565         (JSC::getCurrentPlatformThread):
566         (JSC::suspendThread):
567         (JSC::resumeThread):
568         (JSC::getPlatformThreadRegisters):
569         (JSC::otherThreadStackPointer):
570         (JSC::freePlatformThreadRegisters):
571         (JSC::MachineStackMarker::markOtherThreadConservatively):
572         * wtf/Platform.h: Added Gtk port to use
573         ENABLE_JSC_MULTIPLE_THREADS.
574
575 2011-02-28  Oliver Hunt  <oliver@apple.com>
576
577         Reviewed by Darin Adler.
578
579         Stop using DeprecatedPtr for the global exception slot
580         https://bugs.webkit.org/show_bug.cgi?id=55424
581
582         Create GCRootPtr to signify that the exception slot is
583         a gcroot, and so is exempt from the usual writebarrier
584         restrictions.
585
586         * runtime/JSGlobalData.h:
587         * runtime/WriteBarrier.h:
588         (JSC::GCRootPtr::GCRootPtr):
589         (JSC::GCRootPtr::operator=):
590
591 2011-02-28  Adam Barth  <abarth@webkit.org>
592
593         Reviewed by Dimitri Glazkov.
594
595         Use more xcconfig files in JavaScriptCore gyp build
596         https://bugs.webkit.org/show_bug.cgi?id=55391
597
598         The GYP experts tell me that we have have a total of two xcconfig
599         files: one for the xcodeproj as a whole and one for each target.  This
600         patch uses that technique to re-use the existing xcconfig files and
601         eliminate the duplication.
602
603         Technically, this patch introduces some build errors because the
604         xcconfig files assume that the xcodeproj file is one level higher in
605         the directory hierarchy.  Specifically, the xcodeproj file can no
606         longer find the Info.plist or the prefix header.  I plan to fix that in
607         a subsequent patch.
608
609         Also, this patch introduces the Release and Production configurations,
610         which should work correctly now.
611
612         * gyp/JavaScriptCore.gyp:
613
614 2011-02-28  Jon Honeycutt  <jhoneycutt@apple.com>
615
616         Windows build fix.
617
618         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
619         Add symbol to export.
620
621 2011-02-28  Oliver Hunt  <oliver@apple.com>
622
623         Reviewed by Gavin Barraclough.
624
625         Make ScopeChainNode GC allocated
626         https://bugs.webkit.org/show_bug.cgi?id=55283
627
628         Simplify lifetime and other issues with the scopechain
629         by making it gc allocated.  This allows us to simplify
630         function exit and unwinding, as well as making the
631         current iterative refcounting go away.
632
633         * JavaScriptCore.exp:
634         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
635         * bytecode/CodeBlock.cpp:
636         (JSC::CodeBlock::createActivation):
637         * bytecode/StructureStubInfo.cpp:
638         * bytecompiler/BytecodeGenerator.cpp:
639         (JSC::BytecodeGenerator::generate):
640         (JSC::BytecodeGenerator::BytecodeGenerator):
641         (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
642         (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
643         * bytecompiler/BytecodeGenerator.h:
644         * debugger/Debugger.cpp:
645         (JSC::Recompiler::operator()):
646         * debugger/DebuggerCallFrame.h:
647         (JSC::DebuggerCallFrame::scopeChain):
648         * interpreter/CachedCall.h:
649         (JSC::CachedCall::CachedCall):
650         * interpreter/CallFrame.h:
651         * interpreter/Interpreter.cpp:
652         (JSC::depth):
653         (JSC::Interpreter::unwindCallFrame):
654         (JSC::Interpreter::throwException):
655         (JSC::Interpreter::execute):
656         (JSC::Interpreter::executeCall):
657         (JSC::Interpreter::executeConstruct):
658         (JSC::Interpreter::privateExecute):
659         * jit/JITCall.cpp:
660         (JSC::JIT::compileOpCallInitializeCallFrame):
661         (JSC::JIT::compileOpCall):
662         * jit/JITCall32_64.cpp:
663         (JSC::JIT::compileOpCallInitializeCallFrame):
664         (JSC::JIT::emit_op_ret):
665         (JSC::JIT::emit_op_ret_object_or_this):
666         (JSC::JIT::compileOpCall):
667         * jit/JITOpcodes.cpp:
668         (JSC::JIT::emit_op_end):
669         (JSC::JIT::emit_op_ret):
670         (JSC::JIT::emit_op_ret_object_or_this):
671         * jit/JITOpcodes32_64.cpp:
672         (JSC::JIT::emit_op_end):
673         * jit/JITStubs.cpp:
674         (JSC::DEFINE_STUB_FUNCTION):
675         * jit/JITStubs.h:
676         * runtime/ArgList.cpp:
677         * runtime/Completion.cpp:
678         (JSC::evaluate):
679         * runtime/Completion.h:
680         * runtime/DateConversion.cpp:
681         * runtime/Executable.cpp:
682         (JSC::EvalExecutable::compileInternal):
683         (JSC::ProgramExecutable::compileInternal):
684         (JSC::FunctionExecutable::compileForCallInternal):
685         (JSC::FunctionExecutable::compileForConstructInternal):
686         * runtime/FunctionConstructor.cpp:
687         (JSC::constructFunction):
688         * runtime/GCActivityCallbackCF.cpp:
689         * runtime/Identifier.cpp:
690         * runtime/JSCell.h:
691         * runtime/JSChunk.cpp: Added.
692         * runtime/JSChunk.h: Added.
693         * runtime/JSFunction.cpp:
694         (JSC::JSFunction::JSFunction):
695         (JSC::JSFunction::markChildren):
696         (JSC::JSFunction::getCallData):
697         (JSC::JSFunction::getOwnPropertySlot):
698         (JSC::JSFunction::getConstructData):
699         * runtime/JSFunction.h:
700         (JSC::JSFunction::scope):
701         (JSC::JSFunction::setScope):
702         * runtime/JSGlobalData.cpp:
703         (JSC::JSGlobalData::JSGlobalData):
704         * runtime/JSGlobalData.h:
705         * runtime/JSGlobalObject.cpp:
706         (JSC::JSGlobalObject::init):
707         (JSC::JSGlobalObject::markChildren):
708         * runtime/JSGlobalObject.h:
709         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
710         (JSC::JSGlobalObject::globalScopeChain):
711         * runtime/JSGlobalObjectFunctions.cpp:
712         (JSC::globalFuncEval):
713         * runtime/JSLock.cpp:
714         * runtime/JSNumberCell.cpp:
715         * runtime/JSZombie.cpp:
716         * runtime/MarkedBlock.cpp:
717         * runtime/MarkedSpace.cpp:
718         * runtime/PropertyNameArray.cpp:
719         * runtime/ScopeChain.cpp:
720         (JSC::ScopeChainNode::print):
721         (JSC::ScopeChainNode::localDepth):
722         (JSC::ScopeChainNode::markChildren):
723         * runtime/ScopeChain.h:
724         (JSC::ScopeChainNode::ScopeChainNode):
725         (JSC::ScopeChainNode::createStructure):
726         (JSC::ScopeChainNode::push):
727         (JSC::ScopeChainNode::pop):
728         (JSC::ScopeChainIterator::ScopeChainIterator):
729         (JSC::ScopeChainIterator::operator*):
730         (JSC::ScopeChainIterator::operator->):
731         (JSC::ScopeChainIterator::operator++):
732         (JSC::ScopeChainNode::begin):
733         (JSC::ScopeChainNode::end):
734         (JSC::ExecState::globalData):
735         (JSC::ExecState::lexicalGlobalObject):
736         (JSC::ExecState::globalThisValue):
737         * runtime/ScopeChainMark.h:
738         * wtf/DateMath.cpp:
739
740 2011-02-27  Adam Barth  <abarth@webkit.org>
741
742         Reviewed by Eric Seidel.
743
744         Implement WTF::randomNumber in terms of WTF::cryptographicallyRandomNumber when possible
745         https://bugs.webkit.org/show_bug.cgi?id=55326
746
747         Currently, randomNumber does a bunch of platform-specific work that to
748         get a cryptographic randomness when available.  Instead, we should use
749         cryptographicallyRandomNumber, which abstracts this work.
750         Unfortunately, we can't remove all of the WTF::randomNumber
751         implementation because not every port has access to cryptographically
752         random numbers.
753
754         * wtf/RandomNumber.cpp:
755         (WTF::randomNumber):
756
757 2011-02-27  Benjamin Poulain  <ikipou@gmail.com>
758
759         Reviewed by Darin Adler.
760
761         Eliminate DeprecatedPtrList from RenderBlock
762         https://bugs.webkit.org/show_bug.cgi?id=54972
763
764         Add methods find() and contains() using an adaptor to ListHashSet.
765         Those method are like the one of HashSet, they allow to find objects
766         based on a different key than the one used to define the set.
767
768         Add convenience methods for direct access to the head and tail of the list.
769         Those methods are providing similar API/behavior as Vector.
770
771         * wtf/ListHashSet.h:
772         (WTF::::first):
773         (WTF::::last):
774         (WTF::::removeLast):
775         (WTF::ListHashSetTranslatorAdapter::hash):
776         (WTF::ListHashSetTranslatorAdapter::equal):
777         (WTF::::find):
778         (WTF::::contains):
779
780 2011-02-26  Patrick Gansterer  <paroga@webkit.org>
781
782         Reviewed by Andreas Kling.
783
784         Add support for DragonFly BSD
785         https://bugs.webkit.org/show_bug.cgi?id=54407
786
787         DragonFly BSD is based on FreeBSD, so handle it like FreeBSD.
788
789         * wtf/Platform.h:
790
791 2011-02-26  Adam Barth  <abarth@webkit.org>
792
793         Reviewed by Dimitri Glazkov.
794
795         JavaScriptCore should use the xcconfig file instead of importing that information into GYP
796         https://bugs.webkit.org/show_bug.cgi?id=55282
797
798         Technically, this breaks the build because I had removed one of the
799         warnings in this config file, but this change seems like an
800         improvement.
801
802         * gyp/JavaScriptCore.gyp:
803
804 2011-02-26  Thouraya ANDOLSI  <thouraya.andolsi@st.com>
805
806         Reviewed by Nikolas Zimmermann.
807
808         SH4 JIT SUPPORT
809         https://bugs.webkit.org/show_bug.cgi?id=44329
810
811         Provide an ExecutableAllocater::cacheFlush() implementation for
812         Linux/SH4.
813
814         * jit/ExecutableAllocator.h:
815         (JSC::ExecutableAllocator::cacheFlush):
816
817 2011-02-25  Sheriff Bot  <webkit.review.bot@gmail.com>
818
819         Unreviewed, rolling out r79627.
820         http://trac.webkit.org/changeset/79627
821         https://bugs.webkit.org/show_bug.cgi?id=55274
822
823         broke worker tests (Requested by olliej on #webkit).
824
825         * JavaScriptCore.exp:
826         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
827         * runtime/Heap.cpp:
828         (JSC::Heap::allocate):
829         * runtime/Heap.h:
830         * runtime/JSCell.h:
831         (JSC::JSCell::JSCell::operator new):
832         (JSC::JSCell::MarkedSpace::sizeClassFor):
833         (JSC::JSCell::MarkedSpace::allocate):
834         * runtime/MarkedBlock.h:
835         * runtime/MarkedSpace.cpp:
836         (JSC::MarkedSpace::MarkedSpace):
837         (JSC::MarkedSpace::allocateBlock):
838         (JSC::MarkedSpace::reset):
839         * runtime/MarkedSpace.h:
840         (JSC::MarkedSpace::SizeClass::SizeClass):
841
842 2011-02-25  Michael Saboff  <msaboff@apple.com>
843
844         Reviewed by Darin Adler.
845
846         Leak in JSParser::Scope of ScopeLabelInfo Vector
847         https://bugs.webkit.org/show_bug.cgi?id=55249
848
849         Changed m_labels to be an OwnPtr<>.  Added VectorTraits
850         and Scope copy constructor to support this change.
851
852         * parser/JSParser.cpp:
853         (JSC::JSParser::Scope::~Scope):
854
855 2011-02-25  Fumitoshi Ukai  <ukai@chromium.org>
856
857         Reviewed by Adam Barth.
858
859         WebSocket uses insecure random numbers
860         https://bugs.webkit.org/show_bug.cgi?id=54714
861
862         * JavaScriptCore.exp: Export WTF::cryptographicallyRandomNumber()
863
864 2011-02-25  Patrick Gansterer  <paroga@webkit.org>
865
866         Reviewed by Adam Roben.
867
868         Move timeBeginPeriod into OS(WINDOWS) section
869         https://bugs.webkit.org/show_bug.cgi?id=55247
870
871         * jsc.cpp:
872         (main): timeBeginPeriod is available on all Windows versions and not compiler specific.
873
874 2011-02-25  Patrick Gansterer  <paroga@webkit.org>
875
876         Unreviewed WinCE build fix for r79695.
877
878         * jsc.cpp:
879         (main): SetErrorMode isn't available on WinCE.
880
881 2011-02-25  Adam Roben  <aroben@apple.com>
882
883         Work around Cygwin's crash-suppression behavior
884
885         Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which any processes it launches will
886         inherit. This is bad for testing/debugging, as it causes the post-mortem debugger not to be
887         invoked. (Cygwin does this because it makes crashes more UNIX-y.) We reset the error mode
888         when our test apps launch to work around Cygwin's behavior.
889
890         Fixes <http://webkit.org/b/55222> Test apps crash silently (without invoking post-mortem
891         debugger) when launched from Cygwin 1.7
892
893         Reviewed by Darin Adler.
894
895         * API/tests/testapi.c: Added a now-needed #include.
896         (main):
897         * jsc.cpp:
898         (main):
899         Call ::SetErrorMode(0) to undo Cygwin's folly.
900
901         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Define NOMINMAX like many of our
902         other projects do so that windows.h won't define min/max macros that interfere with
903         std::numeric_limits<T>::min/max.
904
905 2011-02-24  Adam Barth  <abarth@webkit.org>
906
907         Reviewed by Eric Seidel.
908
909         Add GYP project for JavaScriptCore
910         https://bugs.webkit.org/show_bug.cgi?id=55027
911
912         Again, this GYP files is very rough, but it succeeds in building
913         JavaScriptCore.  There's a lot more work to do here, especially in the
914         area of sharing with JavaScriptGlue.gyp.  This patch is more of a
915         checkpoint so that other folks can help out if they wish.
916
917         * gyp: Added.
918         * gyp/JavaScriptCore.gyp: Added.
919         * gyp/generate-derived-sources.sh: Added.
920
921 2011-02-24  Adam Barth  <abarth@webkit.org>
922
923         Reviewed by Eric Seidel.
924
925         Add missing files to JavaScriptCore.gypi
926         https://bugs.webkit.org/show_bug.cgi?id=55193
927
928         I forgot to add mm files in my previous patch.
929
930         * JavaScriptCore.gyp/JavaScriptCore.gyp:
931         * JavaScriptCore.gypi:
932
933 2011-02-24  Adam Barth  <abarth@webkit.org>
934
935         Reviewed by Eric Seidel.
936
937         Remove unused parameter name in GCActivityCallback.cpp
938         https://bugs.webkit.org/show_bug.cgi?id=55194
939
940         This change is not strictly required for the GYP-based build system,
941         but I noticed this error when working on the new build system.
942
943         * runtime/GCActivityCallback.cpp:
944         (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
945
946 2011-02-24  James Robinson  <jamesr@chromium.org>
947
948         Reviewed by Darin Fisher.
949
950         Add a USE() macro to control use of the built-in UTF8 codec
951         https://bugs.webkit.org/show_bug.cgi?id=55189
952
953         Defaults USE(BUILTIN_UTF8_CODEC) to true for all platforms except chromium, which controls the flag via features.gypi.
954
955         * wtf/Platform.h:
956
957 2011-02-24  Geoffrey Garen  <ggaren@apple.com>
958
959         Reviewed by Darin Adler.
960
961         Variable-sized allocation (but still capped at 64 bytes)
962         https://bugs.webkit.org/show_bug.cgi?id=55159
963         
964         SunSpider reports no change.
965
966         * JavaScriptCore.exp: Some day, I hope not to have to edit this file.
967
968         * runtime/Heap.cpp:
969         (JSC::Heap::allocateSlowCase): Split allocation into a fast and slow
970         case, so the fast case can inline size class selection and turn it into
971         a compile-time constant.
972         
973         Changed the collect-on-every allocation debugging switch to collect only
974         on every slow allocation, so you can still flip the switch without
975         recompiling the world. This may also be preferable for debugging purposes,
976         since collecting after every single allocation can be unusably slow,
977         and can mask problems by running destructors early.
978
979         * runtime/Heap.h: Ditto.
980
981         * runtime/JSCell.h:
982         (JSC::JSCell::MarkedSpace::sizeClassFor):
983         (JSC::JSCell::Heap::allocate):
984         (JSC::JSCell::JSCell::operator new): The inlining mentioned above.
985
986         * runtime/MarkedBlock.h: Dropped the block size from 256KB to 16KB. With
987         multiple size classes, allocating a full 256KB for the first allocation
988         in a given class can be pathologically wasteful. (8KB, or 4KB Mac and
989         8KB Windows, would be even better, but that seems to be a peformance
990         regression for now.)
991         
992         * runtime/MarkedSpace.cpp:
993         (JSC::MarkedSpace::MarkedSpace):
994         (JSC::MarkedSpace::allocateBlock):
995         (JSC::MarkedSpace::reset): There's more than one size class now, and its
996         cell size is not constant.
997
998         * runtime/MarkedSpace.h:
999         (JSC::MarkedSpace::SizeClass::SizeClass): Ditto.
1000
1001 2011-02-23  Oliver Hunt  <oliver@apple.com>
1002
1003         Reviewed by Geoffrey Garen.
1004
1005         Make WeakGCMap use new handle infrastructure
1006         https://bugs.webkit.org/show_bug.cgi?id=55100
1007
1008         Remove old WeakGCMap implementation and move over to new handle
1009         based logic.
1010
1011         This has a number of benefits, most notably it makes a WeakGCMap
1012         always reflect the true state of the world by as all entries are
1013         removed at the first gc cycle that makes them dead.  This allows
1014         us to get rid of code in a wide variety of objects where the only
1015         purpose was to remove themselves from maps.
1016
1017         It also means that we no longer need to have special "unchecked"
1018         versions of any functions on WeakGCMap.  Alas in order to maintain
1019         compatibility with the JSWeakObjectMapClear API it is still
1020         necessary to have an api that resembles uncheckedRemove, this is
1021         now deprecatedRemove and will be dealt with in a later patch.
1022
1023         In order to get correct semantics in WeakGCMap we need more
1024         contextual information in the finalizer, so we've added an
1025         abstract class based finaliser and a context parameter to the
1026         calls.
1027
1028         The new an improved WeakGCMap also results in sigificantly more
1029         churn in the weak handle lists so exposed some potential problems
1030         during the post mark phase which have been rectified as well.
1031
1032         * API/JSWeakObjectMapRefPrivate.cpp:
1033         * API/JSWeakObjectMapRefPrivate.h:
1034         * runtime/Heap.cpp:
1035         (JSC::Heap::globalObjectCount):
1036         (JSC::Heap::protectedGlobalObjectCount):
1037         * runtime/JSGlobalData.cpp:
1038         (JSC::JSGlobalData::JSGlobalData):
1039         * runtime/JSGlobalData.h:
1040         * runtime/JSGlobalObject.cpp:
1041         (JSC::JSGlobalObject::~JSGlobalObject):
1042         (JSC::JSGlobalObject::init):
1043         * runtime/WeakGCMap.h:
1044         (JSC::WeakGCMap::iterator::iterator):
1045         (JSC::WeakGCMap::iterator::get):
1046         (JSC::WeakGCMap::iterator::getSlot):
1047         (JSC::WeakGCMap::iterator::operator++):
1048         (JSC::WeakGCMap::iterator::operator==):
1049         (JSC::WeakGCMap::iterator::operator!=):
1050         (JSC::WeakGCMap::WeakGCMap):
1051         (JSC::WeakGCMap::isEmpty):
1052         (JSC::WeakGCMap::clear):
1053         (JSC::WeakGCMap::get):
1054         (JSC::WeakGCMap::getSlot):
1055         (JSC::WeakGCMap::set):
1056         (JSC::WeakGCMap::take):
1057         (JSC::WeakGCMap::size):
1058         (JSC::WeakGCMap::deprecatedRemove):
1059         (JSC::WeakGCMap::begin):
1060         (JSC::WeakGCMap::end):
1061         (JSC::WeakGCMap::~WeakGCMap):
1062         (JSC::WeakGCMap::finalize):
1063         * runtime/WeakGCPtr.h:
1064         (JSC::WeakGCPtr::WeakGCPtr):
1065         (JSC::WeakGCPtr::set):
1066
1067 2011-02-24  Oliver Hunt  <oliver@apple.com>
1068
1069         Reviewed by Gavin Barraclough.
1070
1071         Make weaklist processing deal with weak handles being removed during the iteration
1072         https://bugs.webkit.org/show_bug.cgi?id=55105
1073
1074         It is possible for the handle heap to end up in a broken state if
1075         a handle's finalizer removes either the current or next handle
1076         to be visited during the post-gc cleanup.  This patch removes that
1077         problem by allowing the deallocate(Node*) routine to update the
1078         iterator if it is called during finalization.
1079
1080         * collector/handles/HandleHeap.cpp:
1081         (JSC::HandleHeap::HandleHeap):
1082         (JSC::HandleHeap::updateAfterMark):
1083         (JSC::HandleHeap::clearWeakPointers):
1084         (JSC::HandleHeap::writeBarrier):
1085         (JSC::HandleHeap::protectedGlobalObjectCount):
1086         * collector/handles/HandleHeap.h:
1087         (JSC::Finalizer::~Finalizer):
1088         (JSC::HandleHeap::getFinalizer):
1089         (JSC::HandleHeap::deallocate):
1090         (JSC::HandleHeap::makeWeak):
1091         (JSC::HandleHeap::makeSelfDestroying):
1092         (JSC::HandleHeap::Node::Node):
1093         (JSC::HandleHeap::Node::setFinalizer):
1094         (JSC::HandleHeap::Node::finalizer):
1095         (JSC::HandleHeap::Node::finalizerContext):
1096         * interpreter/RegisterFile.cpp:
1097         (JSC::RegisterFile::setGlobalObject):
1098         (JSC::GlobalObjectNotifier::finalize):
1099         (JSC::RegisterFile::globalObjectCollectedNotifier):
1100         * interpreter/RegisterFile.h:
1101         (JSC::RegisterFile::RegisterFile):
1102         * runtime/Heap.cpp:
1103         (JSC::Heap::destroy):
1104         * runtime/WeakGCPtr.h:
1105         (JSC::WeakGCPtr::WeakGCPtr):
1106         (JSC::WeakGCPtr::set):
1107
1108 2011-02-24  Michael Saboff  <msaboff@apple.com>
1109
1110         Reviewed by Oliver Hunt.
1111
1112         PatternAlternative leaked in YarrPatternConstructor::atomParenthesesEnd()
1113         https://bugs.webkit.org/show_bug.cgi?id=55156
1114
1115         Added code to delete unneeded PatternAlternative after it is removed
1116         from m_alternatives Vector.
1117
1118         * yarr/YarrPattern.cpp:
1119         (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
1120
1121 2011-02-24  Eric Seidel  <eric@webkit.org>
1122
1123         Reviewed by Anders Carlsson.
1124
1125         VectorBuffer should not call malloc(0)
1126         https://bugs.webkit.org/show_bug.cgi?id=55091
1127
1128         Turns out the malloc() call which was so hot in:
1129         https://bugs.webkit.org/show_bug.cgi?id=55005
1130         was actually just malloc(0).
1131
1132         We shouldn't be calling malloc(0) anyway, since there is no need to
1133         and it might actually do work on some systems.
1134         I believe on Mac it ends up taking the standard spinlocks (expensive)
1135         and the code on Brew actually does a malloc(1) instead.  Neither is desirable.
1136
1137         * wtf/Vector.h:
1138         (WTF::VectorBufferBase::allocateBuffer):
1139         (WTF::VectorBufferBase::tryAllocateBuffer):
1140
1141 2011-02-24  Patrick Gansterer  <paroga@webkit.org>
1142
1143         Reviewed by Darin Adler.
1144
1145         Remove obsolete PLATFORM(CI)
1146         https://bugs.webkit.org/show_bug.cgi?id=55082
1147
1148         * wtf/Platform.h:
1149
1150 2011-02-24  Martin Robinson  <mrobinson@igalia.com>
1151
1152         Reviewed by Xan Lopez.
1153
1154         [GTK] Remove the GFile GOwnPtr specialization
1155         https://bugs.webkit.org/show_bug.cgi?id=55154
1156
1157         Remove the GFile specialization of GOwnPtr. It's sufficient to use GRefPtr
1158         to track GFiles since they are just regular reference-counted GObjects.
1159
1160         * wtf/gobject/GOwnPtr.cpp: Remove GFile specialization.
1161         * wtf/gobject/GOwnPtr.h: Ditto.
1162
1163 2011-02-24  Patrick Gansterer  <paroga@webkit.org>
1164
1165         Reviewed by Eric Seidel.
1166
1167         Rename PLATFORM(SKIA) to USE(SKIA)
1168         https://bugs.webkit.org/show_bug.cgi?id=55090
1169
1170         * wtf/Platform.h:
1171
1172 2011-02-24  Patrick Gansterer  <paroga@webkit.org>
1173
1174         Reviewed by Alexey Proskuryakov.
1175
1176         Remove pthreads dependecy for JSLock
1177         https://bugs.webkit.org/show_bug.cgi?id=54832
1178
1179         JSLock is only needed to support an obsolete execution model where JavaScriptCore
1180         automatically protected against concurrent access from multiple threads.
1181         So it's safe to disable it on non-mac platforms where we don't have native pthreads.
1182
1183         * runtime/JSLock.cpp:
1184
1185 2011-02-24  Chao-ying Fu  <fu@mips.com>
1186
1187         Reviewed by Eric Seidel.
1188
1189         Fix MIPS build with new patchOffsetPut/GetByIdPropertyMapOffset1/2 values
1190         https://bugs.webkit.org/show_bug.cgi?id=54997
1191
1192         * jit/JIT.h:
1193         * jit/JITStubs.cpp:
1194         (JSC::JITThunks::JITThunks):
1195
1196 2011-02-24  Andras Becsi  <abecsi@webkit.org>
1197
1198         Reviewed by Laszlo Gombos.
1199
1200         [Qt] MinGW build fails to link
1201         https://bugs.webkit.org/show_bug.cgi?id=55050
1202
1203         Prepend the libraries of subcomponents instead of appending them
1204         to fix the library order according to the dependency of the libraries
1205
1206         * JavaScriptCore.pri: rename addJavaScriptCore to prependJavaScriptCore
1207         * jsc.pro: ditto
1208
1209 2011-02-24  Eric Seidel  <eric@webkit.org>
1210
1211         Reviewed by Adam Barth.
1212
1213         Deque<T> should support inline capacity
1214         https://bugs.webkit.org/show_bug.cgi?id=55032
1215
1216         The title says it all.  There are currently no places
1217         which use this code yet, however it's been tested in conjunction
1218         with code for bug 55005.
1219
1220         This also adds an ASSERT that capacity is never 1.  If you were able
1221         to set the capacity equal to 1, the Deque would just get confused
1222         and happily append your item but still think it had size 0.
1223
1224         * wtf/Deque.h:
1225         (WTF::DequeIterator::DequeIterator):
1226         (WTF::DequeConstIterator::DequeConstIterator):
1227         (WTF::DequeReverseIterator::DequeReverseIterator):
1228         (WTF::DequeConstReverseIterator::DequeConstReverseIterator):
1229         (WTF::::checkValidity):
1230         (WTF::::checkIndexValidity):
1231         (WTF::::invalidateIterators):
1232         (WTF::::Deque):
1233         (WTF::deleteAllValues):
1234         (WTF::::operator):
1235         (WTF::::destroyAll):
1236         (WTF::::~Deque):
1237         (WTF::::swap):
1238         (WTF::::clear):
1239         (WTF::::findIf):
1240         (WTF::::expandCapacityIfNeeded):
1241         (WTF::::expandCapacity):
1242         (WTF::::takeFirst):
1243         (WTF::::append):
1244         (WTF::::prepend):
1245         (WTF::::removeFirst):
1246         (WTF::::remove):
1247         (WTF::::addToIteratorsList):
1248         (WTF::::removeFromIteratorsList):
1249         (WTF::::DequeIteratorBase):
1250         (WTF::::~DequeIteratorBase):
1251         (WTF::::isEqual):
1252         (WTF::::increment):
1253         (WTF::::decrement):
1254         (WTF::::after):
1255         (WTF::::before):
1256         * wtf/Vector.h:
1257
1258 2011-02-22  Adam Barth  <abarth@webkit.org>
1259
1260         Reviewed by Ojan Vafai. 
1261
1262         Add missing files to JavaScriptCore.gypi 
1263         https://bugs.webkit.org/show_bug.cgi?id=55020 
1264
1265         gypi files are supposed to list every file under the sun.  This patch 
1266         adds some missing files and sorts the rest. 
1267
1268         * JavaScriptCore.gypi: 
1269
1270 2011-02-23  Geoffrey Garen  <ggaren@apple.com>
1271
1272         Reviewed by Darin Adler.
1273
1274         Refactored MarkedSpace to operate in terms of size classes
1275         https://bugs.webkit.org/show_bug.cgi?id=55106
1276         
1277         SunSpider reports no change.
1278
1279         * runtime/JSCell.h:
1280         (JSC::JSCell::MarkedSpace::sizeClassFor):
1281         (JSC::JSCell::MarkedSpace::allocate): Delegate allocation based on size
1282         class. Since these functions are inline, the compiler can constant fold
1283         them.
1284
1285         * runtime/MarkedBlock.h:
1286         (JSC::MarkedBlock::cellSize):
1287         (JSC::MarkedBlock::size): Factored out a cellSize() helper.
1288
1289         * runtime/MarkedSpace.cpp:
1290         (JSC::MarkedSpace::allocateBlock):
1291         (JSC::MarkedSpace::allocateFromSizeClass):
1292         (JSC::MarkedSpace::shrink):
1293         (JSC::MarkedSpace::reset):
1294         * runtime/MarkedSpace.h:
1295         (JSC::MarkedSpace::SizeClass::SizeClass):
1296         (JSC::MarkedSpace::SizeClass::reset): Changed to operate in terms of
1297         abstract SizeClass objects, which are independent linked lists of blocks
1298         of a certain size class, instead of a single m_heap object.
1299
1300 2011-02-23  Adam Barth  <abarth@webkit.org>
1301
1302         Reviewed by James Robinson.
1303
1304         [Chromium] Use WebKitClient for OSRandomSource instead of trying to talk to the file system in the sandbox
1305         https://bugs.webkit.org/show_bug.cgi?id=55093
1306
1307         Exclude OSRandomSource.cpp from the Chromium build.  This function is
1308         implemented in WebKit/chromium/src instead.
1309
1310         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1311
1312 2011-02-23  Oliver Hunt  <oliver@apple.com>
1313
1314         Roll out r64156 as it introduces incorrect behaviour.
1315
1316         * runtime/JSByteArray.h:
1317         (JSC::JSByteArray::setIndex):
1318
1319 2011-02-23  Geoffrey Garen  <ggaren@apple.com>
1320
1321         Reviewed by Oliver Hunt.
1322
1323         Moved the "nextAtom" allocation pointer into MarkedBlock for better encapsulation
1324         https://bugs.webkit.org/show_bug.cgi?id=55079
1325         
1326         SunSpider reports no change.
1327
1328         * runtime/Heap.cpp:
1329         (JSC::Heap::reset): Moved Zombie sweeping here, up from MarkedSpace,
1330         since we want Heap to logically control MarkedSpace. MarkedSpace should
1331         never choose to sweep itself.
1332
1333         * runtime/JSCell.h:
1334         (JSC::JSCell::MarkedBlock::allocate): Updated for nextAtom becoming a
1335         member of MarkedBlock. No need to reset nextAtom to firstAtom() when
1336         we reach the end of a block, since there's now an explicit reset pass
1337         during GC.
1338
1339         * runtime/MarkedBlock.cpp:
1340         (JSC::MarkedBlock::MarkedBlock):
1341         * runtime/MarkedBlock.h:
1342         (JSC::MarkedBlock::reset): Added the nextAtom data member, and reordered
1343         some data members to improve cache locality.
1344
1345         * runtime/MarkedSpace.cpp:
1346         (JSC::MarkedSpace::MarkedSpace):
1347         (JSC::MarkedSpace::allocate):
1348         (JSC::MarkedSpace::reset):
1349         * runtime/MarkedSpace.h:
1350         (JSC::CollectorHeap::CollectorHeap): Removed nextAtom, and added an
1351         explicit reset pass.
1352
1353 2011-02-23  James Robinson  <jamesr@chromium.org>
1354
1355         Unreviewed, rolling out r79428.
1356         http://trac.webkit.org/changeset/79428
1357         https://bugs.webkit.org/show_bug.cgi?id=54714
1358
1359         Does not work in the Chromium sandbox
1360
1361         * JavaScriptCore.exp:
1362
1363 2011-02-23  Adam Roben  <aroben@apple.com>
1364
1365         Fix an off-by-one error in JSC::appendSourceToError
1366
1367         Looks like this bug has been around since the code was first added in r35245.
1368
1369         Fixes <http://webkit.org/b/55052> <rdar://problem/9043512> Crash in JSC::appendSourceToError
1370         when running fast/dom/objc-big-method-name.html on Windows with full page heap enabled
1371
1372         Reviewed by Darin Adler.
1373
1374         * interpreter/Interpreter.cpp:
1375         (JSC::appendSourceToError): When trimming whitespace off the end of the string, examine the
1376         character at stop-1 rather than at stop. At this point in the code, stop represents the
1377         index just past the end of the characters we care about, and can even be just past the end
1378         of the entire data buffer.
1379
1380 2011-02-23  Geoffrey Garen  <ggaren@apple.com>
1381
1382         Reviewed by Darin Adler.
1383         
1384         Rolled back in r79367 with SnowLeopard Release bot crash fixed.
1385         https://bugs.webkit.org/show_bug.cgi?id=54999
1386         
1387         The crash was caused by failure to update the "nextBlock" pointer when
1388         removing a block from the list while shrinking. The fix is to update the
1389         "nextBlock" pointer.
1390         
1391         This crash was very rare because it only happened in cases where the very
1392         first block in the heap contained no marked cells.
1393
1394 2011-02-23  Dan Bernstein  <mitz@apple.com>
1395
1396         Reviewed by Gavin Barraclough.
1397
1398         Include frame numbers in backtraces.
1399         https://bugs.webkit.org/show_bug.cgi?id=55060
1400
1401         * wtf/Assertions.cpp:
1402
1403 2011-02-23  Xan Lopez  <xlopez@igalia.com>
1404
1405         Reviewed by Gavin Barraclough.
1406
1407         latest jsc for armv7 crashes in sunspider tests
1408         https://bugs.webkit.org/show_bug.cgi?id=54667
1409
1410         Update JIT offset values in ARMv7 after r78732. Fixes crashes in
1411         SunSpider and JavaScript tests.
1412
1413         * jit/JIT.h: update values.
1414
1415 2011-02-23  Sheriff Bot  <webkit.review.bot@gmail.com>
1416
1417         Unreviewed, rolling out r79418.
1418         http://trac.webkit.org/changeset/79418
1419         https://bugs.webkit.org/show_bug.cgi?id=55043
1420
1421         "breaks shlib linux build" (Requested by morrita on #webkit).
1422
1423         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1424         * JavaScriptCore.gypi:
1425
1426 2011-02-23  Patrick Gansterer  <paroga@webkit.org>
1427
1428         Reviewed by Alexey Proskuryakov.
1429
1430         Use DEFINE_STATIC_LOCAL for ignoreSetMutex in Structure.cpp
1431         https://bugs.webkit.org/show_bug.cgi?id=54831
1432
1433         * runtime/InitializeThreading.cpp:
1434         (JSC::initializeThreadingOnce):
1435         * runtime/Structure.cpp:
1436         (JSC::ignoreSetMutex):
1437         (JSC::Structure::Structure):
1438         (JSC::Structure::~Structure):
1439         (JSC::Structure::initializeThreading):
1440         * runtime/Structure.h:
1441
1442 2011-02-23  Patrick Gansterer  <paroga@webkit.org>
1443
1444         Reviewed by Darin Adler.
1445
1446         Rename PLATFORM(CF) to USE(CF)
1447         https://bugs.webkit.org/show_bug.cgi?id=53540
1448
1449         * runtime/DatePrototype.cpp:
1450         * runtime/GCActivityCallbackCF.cpp:
1451         * runtime/JSGlobalData.cpp:
1452         (JSC::JSGlobalData::JSGlobalData):
1453         * wtf/CurrentTime.cpp:
1454         * wtf/Platform.h:
1455         * wtf/text/AtomicString.h:
1456         * wtf/text/StringImpl.h:
1457         (WTF::StringImpl::computeHash):
1458         * wtf/text/WTFString.h:
1459         * wtf/unicode/icu/CollatorICU.cpp:
1460         (WTF::Collator::userDefault):
1461
1462 2011-02-23  Fumitoshi Ukai  <ukai@chromium.org>
1463
1464         Unreviewed build fix for Windows.
1465
1466         WebSocket uses insecure random numbers
1467         https://bugs.webkit.org/show_bug.cgi?id=54714
1468
1469         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export WTF::cryptographicallyRandomNumber()
1470
1471 2011-02-23  Fumitoshi Ukai  <ukai@chromium.org>
1472
1473         Reviewed by Adam Barth.
1474
1475         WebSocket uses insecure random numbers
1476         https://bugs.webkit.org/show_bug.cgi?id=54714
1477
1478         * JavaScriptCore.exp: Export WTF::cryptographicallyRandomNumber()
1479
1480 2011-02-22  Adam Barth  <abarth@webkit.org>
1481
1482         Reviewed by Ojan Vafai.
1483
1484         Add missing files to JavaScriptCore.gypi
1485         https://bugs.webkit.org/show_bug.cgi?id=55020
1486
1487         gypi files are supposed to list every file under the sun.  This patch
1488         adds some missing files and sorts the rest.
1489
1490         * JavaScriptCore.gypi:
1491
1492 2011-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
1493
1494         Unreviewed, rolling out r79367.
1495         http://trac.webkit.org/changeset/79367
1496         https://bugs.webkit.org/show_bug.cgi?id=55012
1497
1498         all layout tests are crashing on Snow Leopard (Requested by
1499         rniwa on #webkit).
1500
1501         * GNUmakefile.am:
1502         * JavaScriptCore.gypi:
1503         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1504         * JavaScriptCore.xcodeproj/project.pbxproj:
1505         * runtime/MarkedBlock.cpp:
1506         (JSC::MarkedBlock::MarkedBlock):
1507         * runtime/MarkedBlock.h:
1508         * runtime/MarkedSpace.cpp:
1509         (JSC::MarkedSpace::destroy):
1510         (JSC::MarkedSpace::allocateBlock):
1511         (JSC::MarkedSpace::freeBlock):
1512         (JSC::MarkedSpace::allocate):
1513         (JSC::MarkedSpace::shrink):
1514         (JSC::MarkedSpace::reset):
1515         * runtime/MarkedSpace.h:
1516         (JSC::CollectorHeap::collectorBlock):
1517         * wtf/CMakeLists.txt:
1518         * wtf/DoublyLinkedList.h: Removed.
1519
1520 2011-02-22  Geoffrey Garen  <ggaren@apple.com>
1521
1522         Reviewed by Oliver Hunt.
1523
1524         Manage MarkedBlocks in a linked list instead of a vector, so arbitrary removal is O(1)
1525         https://bugs.webkit.org/show_bug.cgi?id=54999
1526         
1527         SunSpider reports no change.
1528
1529         * GNUmakefile.am:
1530         * JavaScriptCore.gypi:
1531         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1532         * JavaScriptCore.xcodeproj/project.pbxproj: So many build systems, so little time.
1533         * wtf/CMakeLists.txt:
1534
1535         * runtime/MarkedBlock.cpp:
1536         (JSC::MarkedBlock::MarkedBlock):
1537         * runtime/MarkedBlock.h:
1538         (JSC::MarkedBlock::setPrev):
1539         (JSC::MarkedBlock::setNext):
1540         (JSC::MarkedBlock::prev):
1541         (JSC::MarkedBlock::next): Added linked list data members and accessors.
1542
1543         * runtime/MarkedSpace.cpp:
1544         (JSC::MarkedSpace::destroy):
1545         (JSC::MarkedSpace::allocateBlock): Stop using vector, since it doesn't exist anymore.
1546
1547         (JSC::MarkedSpace::freeBlocks): New helper function for updating relevant
1548         data structures when freeing blocks.
1549
1550         (JSC::MarkedSpace::allocate): Updated for nextBlock being a pointer and
1551         not a vector index.
1552
1553         (JSC::MarkedSpace::shrink): Construct a temporary list of empties and
1554         then free them, to avoid modifying our hash table while iterating it.
1555         This wasn't a concern before because we were using indirect array
1556         indexing, not direct pointer indexing.
1557
1558         (JSC::MarkedSpace::reset): Updated for nextBlock being a pointer and
1559         not a vector index.
1560
1561         * runtime/MarkedSpace.h:
1562         (JSC::CollectorHeap::CollectorHeap): Changed data type from vector to linked list.
1563
1564         * wtf/DoublyLinkedList.h: Added. New linked list class.
1565         (WTF::::DoublyLinkedList):
1566         (WTF::::isEmpty):
1567         (WTF::::head):
1568         (WTF::::append):
1569         (WTF::::remove):
1570
1571 2011-02-22  Gavin Barraclough  <barraclough@apple.com>
1572
1573         Windows build fix.
1574
1575         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1576
1577 2011-02-22  Gavin Barraclough  <barraclough@apple.com>
1578
1579         Reviewed by Sam Weinig.
1580
1581         Bug 54988 - Re-create StructureTransitionTable class, encapsulate transition table
1582
1583         The Structure class keeps a table of transitions to derived Structure types. Since
1584         this table commonly contains a single entry we employ an optimization where instead
1585         of holding a map, we may hold a pointer directly to a single instance of the mapped
1586         type. We use an additional bit of data to flag whether the pointer is currently
1587         pointing to a table of transitions, or a singleton transition. Previously we had
1588         commonly used a pattern of storing data in the low bits of pointers, but had moved
1589         away from this since it causes false leaks to be reported by the leaks tool. However
1590         in this case, the entries in the map are weak links - this pointer will never be
1591         responsible for keeping an object alive.  As such we can use this approach provided
1592         that the bit is set when a table is not in use (otherwise the table would appear to
1593         be leaked).
1594
1595         Additionally, the transition table currently allows two entries to exist for a given
1596         key - one specialized to a particular value, and one not specialized. This is
1597         unnecessary, wasteful, and a little inconsistent. (If you create an entry for a
1598         specialized value, then a non-specialized entry, both will exist.  If you create an
1599         entry for a non-specialized value, then try to create a specialized entry, only a
1600         non-specialized form will be allowed.)
1601
1602         This shows a small progression on v8.
1603
1604         * JavaScriptCore.exp:
1605         * runtime/JSObject.h:
1606         (JSC::JSObject::putDirectInternal):
1607         * runtime/Structure.cpp:
1608         (JSC::StructureTransitionTable::contains):
1609         (JSC::StructureTransitionTable::get):
1610         (JSC::StructureTransitionTable::remove):
1611         (JSC::StructureTransitionTable::add):
1612         (JSC::Structure::dumpStatistics):
1613         (JSC::Structure::Structure):
1614         (JSC::Structure::~Structure):
1615         (JSC::Structure::addPropertyTransitionToExistingStructure):
1616         (JSC::Structure::addPropertyTransition):
1617         * runtime/Structure.h:
1618         (JSC::Structure::get):
1619         * runtime/StructureTransitionTable.h:
1620         (JSC::StructureTransitionTable::Hash::hash):
1621         (JSC::StructureTransitionTable::Hash::equal):
1622         (JSC::StructureTransitionTable::HashTraits::emptyValue):
1623         (JSC::StructureTransitionTable::HashTraits::constructDeletedValue):
1624         (JSC::StructureTransitionTable::HashTraits::isDeletedValue):
1625         (JSC::StructureTransitionTable::StructureTransitionTable):
1626         (JSC::StructureTransitionTable::~StructureTransitionTable):
1627         (JSC::StructureTransitionTable::isUsingSingleSlot):
1628         (JSC::StructureTransitionTable::map):
1629         (JSC::StructureTransitionTable::setMap):
1630         (JSC::StructureTransitionTable::singleTransition):
1631         (JSC::StructureTransitionTable::setSingleTransition):
1632
1633 2011-02-22  Andras Becsi  <abecsi@webkit.org>
1634
1635         Reviewed by Laszlo Gombos.
1636
1637         [Qt] Redesign the build system
1638         https://bugs.webkit.org/show_bug.cgi?id=51339
1639
1640         Part 2.
1641
1642         Build WebCore as a static library, compile the WebKit API and WebKit2 API
1643         in a final step and link to WebKit2, WebCore and JSC libraries to fix
1644         linking issues resulting from stripped away symbols.
1645
1646         * JavaScriptCore.pri: Remove the workaround.
1647
1648 2011-02-21  Adam Roben  <aroben@apple.com>
1649
1650         Fix linker warning on Windows
1651
1652         r79135 tried to export JSObject::s_info by adding it to JavaScriptCore.def. This is the
1653         obvious way (since it's how we export functions), but unfortunately it doesn't work correct.
1654         r79222 made us export it the right way (using the JS_EXPORTDATA macro), but forgot to remove
1655         it from JavaScriptCore.def. This caused us to get linker warnings about exporting the symbol
1656         multiple times.
1657
1658         Rubber-stamped by Anders Carlsson.
1659
1660         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed JSObject::s_info.
1661
1662 2011-02-21  Brian Weinstein  <bweinstein@apple.com>
1663
1664         Reviewed by Adam Roben.
1665
1666         WebResourceCacheManager should be responsible for managing the CFURLCache as well
1667         as the WebCore memory cache.
1668         https://bugs.webkit.org/show_bug.cgi?id=54886
1669         Part of <rdar://problem/8971738>
1670
1671         Add a new use flag for using the CFURLCache.
1672
1673         * wtf/Platform.h:
1674
1675 2011-02-21  Xan Lopez  <xlopez@igalia.com>
1676
1677         Reviewed by Gavin Barraclough.
1678
1679         Use ASSERT_JIT_OFFSET in JITPropertyAccess32_64.cpp
1680         https://bugs.webkit.org/show_bug.cgi?id=54901
1681
1682         * jit/JIT.h: swap actual and expected values in message, they were
1683         reversed.
1684         * jit/JITCall32_64.cpp:
1685         (JSC::JIT::compileOpCall): use ASSERT_JIT_OFFSET instead of
1686         a simple ASSERT.
1687         * jit/JITPropertyAccess32_64.cpp:
1688         (JSC::JIT::emit_op_method_check): ditto.
1689         (JSC::JIT::compileGetByIdHotPath): ditto.
1690         (JSC::JIT::compileGetByIdSlowCase): ditto.
1691         (JSC::JIT::emit_op_put_by_id): ditto.
1692
1693 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
1694
1695         Ruber stamped by Sam Weinig
1696
1697         Bug 54899 - Math.LOG10E should be 0.4342944819032518
1698         This value is quoted in section 15.8.1.5 of the spec.
1699
1700         * runtime/MathObject.cpp:
1701         (JSC::MathObject::MathObject):
1702
1703 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
1704
1705         Reviewed by Sam Weinig.
1706
1707         Bug 54894 - Make inheritance structure described by ClassInfo match C++ class hierarchy.
1708
1709         The ClassInfo objects describe an inheritance hierarchy, with each ClassInfo instance
1710         containing a pointer to its parent class. These links should reflect the inheritance
1711         hierarchy of C++ classes below JSObject. For the large part it does, but in some cases
1712         entries in the C++ hierarchy are skipped over. This presently likely doesn't matter,
1713         since intervening C++ classes may not have ClassInfo - but would be a potential bug
1714         were ClassInfo were to be added.
1715
1716         * API/JSCallbackConstructor.cpp:
1717         * API/JSCallbackFunction.cpp:
1718         * API/JSCallbackObjectFunctions.h:
1719         * runtime/Arguments.h:
1720         * runtime/ArrayPrototype.cpp:
1721         * runtime/BooleanObject.cpp:
1722         * runtime/DateInstance.cpp:
1723         * runtime/DatePrototype.cpp:
1724         * runtime/ErrorInstance.cpp:
1725         * runtime/InternalFunction.cpp:
1726         * runtime/JSActivation.cpp:
1727         * runtime/JSArray.cpp:
1728         * runtime/JSFunction.cpp:
1729         * runtime/JSONObject.cpp:
1730         * runtime/JSObject.h:
1731         * runtime/JSZombie.h:
1732         * runtime/MathObject.cpp:
1733         * runtime/NativeErrorConstructor.cpp:
1734         * runtime/NumberConstructor.cpp:
1735         * runtime/NumberObject.cpp:
1736         * runtime/RegExpConstructor.cpp:
1737         * runtime/RegExpObject.cpp:
1738         * runtime/StringObject.cpp:
1739         * runtime/StringPrototype.cpp:
1740
1741 2011-02-21  Adam Roben  <aroben@apple.com>
1742
1743         Export JSObject::s_info from JavaScriptCore.dll
1744
1745         This matches what we do for all other ClassInfo objects that WebCore needs access to.
1746
1747         Fixes <http://webkit.org/b/54881> REGRESSION (r79132): Lots of tests crashing in
1748         JSCell::inherits on Windows
1749
1750         Reviewed by Sam Weinig.
1751
1752         * runtime/JSObject.h: Added JS_EXPORTDATA to s_info.
1753
1754 2011-02-21  Kristian Amlie  <kristian.amlie@nokia.com>
1755
1756         Reviewed by Andreas Kling.
1757
1758         Switched to compiler based detection, where the error actually is.
1759
1760         It is not the platform that needs the workaround, it is the compiler.
1761
1762         QtWebKit fails to compile on Windows XP with msvc-2008
1763         https://bugs.webkit.org/show_bug.cgi?id=54746
1764
1765         * bytecode/CodeBlock.h:
1766         * runtime/RegExpObject.h:
1767
1768 2011-02-20  Gavin Barraclough  <barraclough@apple.com>
1769
1770         Reviewed by Oliver Hunt.
1771
1772         https://bugs.webkit.org/show_bug.cgi?id=54839
1773         Remove PrototypeFunction, NativeFunctionWrapper, and GlobalEvalFunction.
1774
1775         Historically, Native functions used to be represented by PrototypeFunctions, however
1776         since introducing call optimizations to the JIT this has used JSFunctions for host
1777         calls too. At the point this change was made, the interpreter continued to use
1778         PrototypeFunctions, however since fallback from the JIT to interpreter was introduced
1779         the interpreter has had to be able to run using host functions represented using
1780         JSFunctions - leading to an unnecessary and redundant divergence in behaviour between 
1781         interpreter only builds, and situations where the JIT has fallen back to interpreting.
1782
1783         NativeFunctionWrapper only existed to select between PrototypeFunction and JSFunction
1784         for wrappers for host functions, and as such can also be removed.
1785
1786         GlobalEvalFunction is a redundant wrapper that happens to be derived from
1787         PrototypeFunction. It existed to hold a reference to the global object - but since all
1788         functions how derive from JSObjectWithGlobalObject, this no longer requires an
1789         additional class to provide this functionality.
1790
1791         * JavaScriptCore.JSVALUE32_64only.exp:
1792         * JavaScriptCore.JSVALUE64only.exp:
1793         * JavaScriptCore.xcodeproj/project.pbxproj:
1794             Removed symbols / references to files.
1795
1796         * runtime/GlobalEvalFunction.cpp: Removed.
1797         * runtime/GlobalEvalFunction.h: Removed.
1798         * runtime/NativeFunctionWrapper.h: Removed.
1799         * runtime/PrototypeFunction.cpp: Removed.
1800         * runtime/PrototypeFunction.h: Removed.
1801             Removed.
1802
1803         * runtime/Executable.cpp:
1804         (JSC::NativeExecutable::~NativeExecutable):
1805         * runtime/Executable.h:
1806         (JSC::NativeExecutable::create):
1807         (JSC::NativeExecutable::NativeExecutable):
1808         (JSC::JSFunction::nativeFunction):
1809         * runtime/JSFunction.cpp:
1810         (JSC::callHostFunctionAsConstructor):
1811         (JSC::JSFunction::JSFunction):
1812         (JSC::JSFunction::getCallData):
1813         * runtime/JSFunction.h:
1814         * runtime/JSGlobalData.cpp:
1815         (JSC::JSGlobalData::getHostFunction):
1816         * runtime/JSGlobalData.h:
1817         (JSC::JSGlobalData::getCTIStub):
1818             Added interpreter-friendly constructors for NativeExecutables.
1819
1820         * bytecompiler/BytecodeGenerator.cpp:
1821         * interpreter/Interpreter.cpp:
1822         * jit/JITStubs.cpp:
1823         * jsc.cpp:
1824         * runtime/ArrayConstructor.cpp:
1825         * runtime/BooleanPrototype.cpp:
1826         * runtime/BooleanPrototype.h:
1827         * runtime/CallData.h:
1828         * runtime/DateConstructor.cpp:
1829         * runtime/DateConstructor.h:
1830         * runtime/ErrorPrototype.cpp:
1831         * runtime/ErrorPrototype.h:
1832         * runtime/FunctionPrototype.cpp:
1833         * runtime/FunctionPrototype.h:
1834         * runtime/JSGlobalObject.cpp:
1835         * runtime/JSGlobalObject.h:
1836         * runtime/JSGlobalObjectFunctions.cpp:
1837         * runtime/Lookup.cpp:
1838         * runtime/NumberPrototype.cpp:
1839         * runtime/NumberPrototype.h:
1840         * runtime/ObjectConstructor.cpp:
1841         * runtime/ObjectConstructor.h:
1842         * runtime/ObjectPrototype.cpp:
1843         * runtime/ObjectPrototype.h:
1844         * runtime/RegExpPrototype.cpp:
1845         * runtime/RegExpPrototype.h:
1846         * runtime/SmallStrings.h:
1847         * runtime/StringConstructor.cpp:
1848         * runtime/StringConstructor.h:
1849             Removed use of redundant classes.
1850
1851 2011-02-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1852
1853         Unreviewed build fix for Symbian.
1854
1855         [Symbian] Revert the removal of linking 
1856         against hal after r79126.
1857
1858         Dependency on the hal library can not be removed 
1859         as it is still used (e.g. in MarkStackSymbian.cpp).
1860
1861         * JavaScriptCore.pri:
1862
1863 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
1864
1865         Interpreter build fix.
1866
1867         * runtime/ArrayConstructor.cpp:
1868         * runtime/BooleanPrototype.cpp:
1869         * runtime/DateConstructor.cpp:
1870         * runtime/ErrorPrototype.cpp:
1871         * runtime/FunctionPrototype.cpp:
1872         * runtime/Lookup.cpp:
1873         * runtime/NumberPrototype.cpp:
1874         * runtime/ObjectConstructor.cpp:
1875         * runtime/ObjectPrototype.cpp:
1876         * runtime/RegExpPrototype.cpp:
1877         * runtime/StringConstructor.cpp:
1878
1879 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
1880
1881         Build fix!!
1882
1883         * JavaScriptCore.exp:
1884
1885 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
1886
1887         Windows build fix!!
1888
1889         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1890
1891 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
1892
1893         Windows build fix!
1894
1895         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1896
1897 2011-02-19  Gavin Barraclough  <barraclough@apple.com>
1898
1899         Build fix!
1900
1901         * JavaScriptCore.exp:
1902
1903 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
1904
1905         Reviewed by Sam Weinig.
1906
1907         Bug 54786 - Devirtualize JSCell::classInfo()
1908
1909         Instead of making a virtual function call, add a pointer to the ClassInfo
1910         onto Structure.
1911
1912         This removes a virtual function call, and paves the way towards removing all
1913         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
1914         (these should be able to move onto ClassInfo).
1915
1916         Calls to Structure::create must now pass a pointer to the ClassInfo for the
1917         structure. All objects now have a ClassInfo pointer, non-object cell types
1918         still do not.
1919
1920         Changes are most mechanical, involving three steps:
1921             * Remove virtual classInfo() methods.
1922             * Add &s_info parameter to calls to Structure::create.
1923             * Rename ClassInfo static members on classes from 'info' to 's_info',
1924               for consistency.
1925
1926         * API/JSCallbackConstructor.cpp:
1927         * API/JSCallbackConstructor.h:
1928         * API/JSCallbackFunction.cpp:
1929         * API/JSCallbackFunction.h:
1930         * API/JSCallbackObject.cpp:
1931         * API/JSCallbackObject.h:
1932         * API/JSCallbackObjectFunctions.h:
1933         * API/JSObjectRef.cpp:
1934         * API/JSValueRef.cpp:
1935         * API/JSWeakObjectMapRefPrivate.cpp:
1936         * JavaScriptCore.exp:
1937         * debugger/Debugger.cpp:
1938         * debugger/DebuggerActivation.h:
1939         * debugger/DebuggerCallFrame.cpp:
1940         * interpreter/Interpreter.cpp:
1941         * jit/JITCall32_64.cpp:
1942         * jit/JITOpcodes.cpp:
1943         * jit/JITStubs.cpp:
1944         * profiler/Profiler.cpp:
1945         * runtime/Arguments.cpp:
1946         * runtime/Arguments.h:
1947         * runtime/ArrayConstructor.cpp:
1948         * runtime/ArrayPrototype.cpp:
1949         * runtime/ArrayPrototype.h:
1950         * runtime/BooleanObject.cpp:
1951         * runtime/BooleanObject.h:
1952         * runtime/BooleanPrototype.cpp:
1953         * runtime/DateConstructor.cpp:
1954         * runtime/DateInstance.cpp:
1955         * runtime/DateInstance.h:
1956         * runtime/DatePrototype.cpp:
1957         * runtime/DatePrototype.h:
1958         * runtime/ErrorInstance.cpp:
1959         * runtime/ErrorInstance.h:
1960         * runtime/ErrorPrototype.cpp:
1961         * runtime/FunctionPrototype.cpp:
1962         * runtime/FunctionPrototype.h:
1963         * runtime/GetterSetter.h:
1964         * runtime/GlobalEvalFunction.h:
1965         * runtime/InternalFunction.cpp:
1966         * runtime/InternalFunction.h:
1967         * runtime/JSAPIValueWrapper.h:
1968         * runtime/JSActivation.cpp:
1969         * runtime/JSActivation.h:
1970         * runtime/JSArray.cpp:
1971         * runtime/JSArray.h:
1972         * runtime/JSByteArray.cpp:
1973         * runtime/JSByteArray.h:
1974         * runtime/JSCell.cpp:
1975         * runtime/JSCell.h:
1976         * runtime/JSFunction.cpp:
1977         * runtime/JSFunction.h:
1978         * runtime/JSGlobalData.cpp:
1979         * runtime/JSGlobalObject.cpp:
1980         * runtime/JSGlobalObject.h:
1981         * runtime/JSNotAnObject.h:
1982         * runtime/JSONObject.cpp:
1983         * runtime/JSONObject.h:
1984         * runtime/JSObject.cpp:
1985         * runtime/JSObject.h:
1986         * runtime/JSObjectWithGlobalObject.h:
1987         * runtime/JSPropertyNameIterator.h:
1988         * runtime/JSStaticScopeObject.h:
1989         * runtime/JSString.h:
1990         * runtime/JSVariableObject.h:
1991         * runtime/JSWrapperObject.h:
1992         * runtime/JSZombie.cpp:
1993         * runtime/JSZombie.h:
1994         * runtime/Lookup.cpp:
1995         * runtime/MathObject.cpp:
1996         * runtime/MathObject.h:
1997         * runtime/NativeErrorConstructor.cpp:
1998         * runtime/NativeErrorConstructor.h:
1999         * runtime/NumberConstructor.cpp:
2000         * runtime/NumberConstructor.h:
2001         * runtime/NumberObject.cpp:
2002         * runtime/NumberObject.h:
2003         * runtime/NumberPrototype.cpp:
2004         * runtime/ObjectConstructor.cpp:
2005         * runtime/ObjectPrototype.cpp:
2006         * runtime/RegExpConstructor.cpp:
2007         * runtime/RegExpConstructor.h:
2008         * runtime/RegExpObject.cpp:
2009         * runtime/RegExpObject.h:
2010         * runtime/RegExpPrototype.cpp:
2011         * runtime/ScopeChain.cpp:
2012         * runtime/StringConstructor.cpp:
2013         * runtime/StringObject.cpp:
2014         * runtime/StringObject.h:
2015         * runtime/StringObjectThatMasqueradesAsUndefined.h:
2016         * runtime/StringPrototype.cpp:
2017         * runtime/StringPrototype.h:
2018         * runtime/Structure.cpp:
2019         * runtime/Structure.h:
2020
2021 2011-02-19  David Kilzer  <ddkilzer@apple.com>
2022
2023         <http://webkit.org/b/54808> Change jsc target to build directly into JavaScriptCore.framework/Resources/jsc
2024
2025         Reviewed by Dan Bernstein.
2026
2027         * Configurations/Base.xcconfig: Added
2028         JAVASCRIPTCORE_FRAMEWORKS_DIR variable.
2029         * Configurations/JavaScriptCore.xcconfig: Used
2030         JAVASCRIPTCORE_FRAMEWORKS_DIR to define INSTALL_PATH.
2031         * JavaScriptCore.xcodeproj/project.pbxproj: Set the INSTALL_PATH
2032         for Production configuration of jsc target.
2033         (Copy Into Framework): Removed old build phase.
2034         (Fix Framework Reference): Renamed build phase to "Copy Into
2035         Framework".  Added "set -x" call to make the script print the
2036         commands it is running.  Added code to exit early for Production
2037         builds since this was never intended for them.  Added code to
2038         copy jsc into the JavaScriptCore.framework/Resources directory.
2039
2040 2011-02-19  Siddharth Mathur  <siddharth.mathur@nokia.com>
2041
2042         Reviewed by Laszlo Gombos.
2043
2044         [Symbian] OSAllocator implementation for Symbian OS. 
2045         Manages both data and code region requests. V8 and Sunspider tested
2046         OK with interpreter. Not tested with JSC JIT yet as it has unrelated
2047         failures. Also no thread safety yet.
2048         https://bugs.webkit.org/show_bug.cgi?id=51128
2049
2050         * JavaScriptCore.pri: removed HAL linkage
2051         * wtf/Bitmap.h:
2052         (WTF::::findRunOfZeros): find run of zeros in a bitmap. quick n dirty
2053         * wtf/OSAllocator.h:
2054         (WTF::OSAllocator::decommitAndRelease): decommit explicitly 
2055         * wtf/OSAllocatorSymbian.cpp: Impl. of OSAllocator interface 
2056         (WTF::allocateCodeChunk): utility for code chunks
2057         (WTF::deallocateCodeChunk): utility for code chunks
2058         (WTF::dataAllocatorInstance): getter for data allocator instance
2059         (WTF::OSAllocator::reserveUncommitted):
2060         (WTF::OSAllocator::releaseDecommitted):
2061         (WTF::OSAllocator::commit):
2062         (WTF::OSAllocator::decommit):
2063         (WTF::OSAllocator::reserveAndCommit):
2064         (WTF::PageAllocatorSymbian::PageAllocatorSymbian): maps requests 
2065         to one underlying Symbian chunk
2066         (WTF::PageAllocatorSymbian::~PageAllocatorSymbian):
2067         (WTF::PageAllocatorSymbian::reserve):
2068         (WTF::PageAllocatorSymbian::release):
2069         (WTF::PageAllocatorSymbian::commit):
2070         (WTF::PageAllocatorSymbian::decommit):
2071         (WTF::PageAllocatorSymbian::contains):
2072         * wtf/PageAllocatorSymbian.h: Added.
2073         (WTF::SymbianChunk::SymbianChunk): wrapper around RChunk  
2074         (WTF::SymbianChunk::~SymbianChunk):
2075         (WTF::SymbianChunk::contains):
2076         
2077 2011-02-19  Yong Li  <yoli@rim.com>
2078
2079         Reviewed by Eric Seidel.
2080
2081         https://bugs.webkit.org/show_bug.cgi?id=54687
2082         When being built with armcc, "int" bit fields are treated as
2083         unsigned integers, which will fail the comparisons like "m_offset == -1".
2084         Using "signed" fixes the problem.
2085
2086         * assembler/ARMAssembler.h:
2087         * assembler/ARMv7Assembler.h:
2088
2089 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
2090
2091         Reviewed by Sam Weinig.
2092
2093         Made MarkedSpace block iteration size-class agnostic
2094         https://bugs.webkit.org/show_bug.cgi?id=54792
2095         
2096         SunSpider reports no change.
2097
2098         * runtime/MarkedSpace.cpp:
2099         (JSC::MarkedSpace::clearMarks):
2100         (JSC::MarkedSpace::sweep):
2101         (JSC::MarkedSpace::objectCount):
2102         (JSC::MarkedSpace::size):
2103         (JSC::MarkedSpace::capacity):
2104         * runtime/MarkedSpace.h:
2105         (JSC::MarkedSpace::forEach): Iterate blocks in hashing order instead of
2106         size class list order. This is a much simpler convention in a world
2107         of many different size classes.
2108
2109 2011-02-18  Kristian Amlie  <kristian.amlie@nokia.com>
2110
2111         Reviewed by Andreas Kling.
2112
2113         Added friend exception to Qt platform, which also compiles Windows.
2114
2115         QtWebKit fails to compile on Windows XP with msvc-2008
2116         https://bugs.webkit.org/show_bug.cgi?id=54746
2117
2118         * bytecode/CodeBlock.h:
2119         * runtime/RegExpObject.h:
2120
2121 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
2122
2123         (Rolled back in r79022 with crash fixed.)
2124
2125         Reviewed by Sam Weinig.
2126
2127         Use hashing instead of linear search in the conservative pointer test
2128         https://bugs.webkit.org/show_bug.cgi?id=54767
2129         
2130         SunSpider reports no change.
2131
2132         * runtime/MarkedSpace.cpp:
2133         (JSC::MarkedSpace::destroy): No need to explicitly clear the blocks array,
2134         since freeBlock removes items for us.
2135
2136         (JSC::MarkedSpace::freeBlock): Fixed a typo that always removed the last
2137         block from the block set instead of the block being freed. Changed to
2138         remove a block from our data structures before deallocating it, since
2139         this is slightly cleaner.
2140
2141         * runtime/MarkedSpace.h:
2142         (JSC::MarkedSpace::contains): Variable-sized objects will use more,
2143         smaller blocks, so it's important for the contains check not to be O(n)
2144         in the number of blocks.
2145
2146 2011-02-18  chris reiss  <christopher.reiss@nokia.com>
2147
2148         Reviewed by Andreas Kling.
2149
2150         REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
2151         https://bugs.webkit.org/show_bug.cgi?id=49989
2152
2153         updated test fast/js/script-tests/date-parse-test.js
2154
2155         * wtf/DateMath.cpp:
2156         (WTF::parseDateFromNullTerminatedCharacters):
2157
2158 2011-02-18  Sheriff Bot  <webkit.review.bot@gmail.com>
2159
2160         Unreviewed, rolling out r79022.
2161         http://trac.webkit.org/changeset/79022
2162         https://bugs.webkit.org/show_bug.cgi?id=54775
2163
2164         It broke the whole world (Requested by Ossy on #webkit).
2165
2166         * runtime/MarkedSpace.h:
2167         (JSC::MarkedSpace::contains):
2168
2169 2011-02-18  Yael Aharon  <yael.aharon@nokia.com>
2170
2171         Reviewed by Dave Hyatt.
2172
2173         Add support for dir=auto
2174         https://bugs.webkit.org/show_bug.cgi?id=50916
2175
2176         Change defaultWritingDirection() to return if the writing direction
2177         was determined from a letter with strong directionality or not.
2178
2179         * JavaScriptCore.exp:
2180         * JavaScriptCore.order:
2181         * wtf/text/StringImpl.cpp:
2182         (WTF::StringImpl::defaultWritingDirection):
2183         * wtf/text/StringImpl.h:
2184         * wtf/text/WTFString.h:
2185         (WTF::String::defaultWritingDirection):
2186
2187 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
2188
2189         Reviewed by Sam Weinig.
2190
2191         Use hashing instead of linear search in the conservative pointer test
2192         https://bugs.webkit.org/show_bug.cgi?id=54767
2193         
2194         SunSpider reports no change.
2195
2196         * runtime/MarkedSpace.h:
2197         (JSC::MarkedSpace::contains): Variable-sized objects will use more,
2198         smaller blocks, so it's important for the contains check not to be O(n)
2199         in the number of blocks.
2200
2201 2011-02-18  Geoffrey Garen  <ggaren@apple.com>
2202
2203         Reviewed by Sam Weinig.
2204
2205         Tightened some usage accounting code in MarkedSpace
2206         https://bugs.webkit.org/show_bug.cgi?id=54761
2207         
2208         SunSpider reports no change.
2209
2210         * runtime/Heap.cpp:
2211         (JSC::Heap::Heap): Initialize the marked space high water mark on
2212         construction, instead of relying on some implicit subtleties to make
2213         not initializing it work out OK.
2214
2215         * runtime/Heap.h: Fixed up includes.
2216
2217         * runtime/MarkedBlock.h: Made firstAtom() static so clients can call it
2218         even without having allocated a block.
2219
2220         * runtime/MarkedSpace.cpp:
2221         (JSC::MarkedSpace::MarkedSpace): Don't pre-allocate a block, since this
2222         would be prohibitively expensive with multiple size classes.
2223
2224         (JSC::MarkedSpace::allocateBlock):
2225         (JSC::MarkedSpace::freeBlock): Track allocated blocks in a hash set,
2226         since linear search in the contains check will be prohibitively
2227         expensive once we're using lots of smaller blocks.
2228
2229         (JSC::MarkedSpace::allocate): Don't assume that we always have a block
2230         allocated, since we don't anymore. (See above.)
2231
2232         (JSC::MarkedSpace::reset):
2233         * runtime/MarkedSpace.h: Updated for changes mentioned above.
2234
2235 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
2236
2237         Reviewed by Sam Weinig.
2238
2239         Made object allocation secretly variable-sized (Shhhh!)
2240         https://bugs.webkit.org/show_bug.cgi?id=54721
2241         
2242         SunSpider reports no change.
2243         
2244         Internally, MarkedBlock now makes variable-sized allocations, even
2245         though MarkedSpace doesn't take advantage of this yet.
2246
2247         * runtime/MarkedBlock.cpp:
2248         (JSC::MarkedBlock::MarkedBlock): No need to ASSERT that allocations are
2249         fixed-sized.
2250
2251         * runtime/MarkedBlock.h: Shrunk the atom size so we can allocate things
2252         that are not multiples of 64 bytes.
2253
2254 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
2255
2256         Reviewed by Sam Weinig.
2257
2258         Fixed some math errors when when using variable-sized cells
2259         https://bugs.webkit.org/show_bug.cgi?id=54717
2260         
2261         SunSpider reports no change.
2262         
2263         Computer Science Barbie says, "Math is not so hard afterall!"
2264
2265         * runtime/JSCell.h:
2266         (JSC::JSCell::MarkedBlock::allocate): Round up when calculating the
2267         minimum number of atoms required for a cell, since rounding down
2268         will get you splinched.
2269
2270         * runtime/MarkedBlock.cpp:
2271         (JSC::MarkedBlock::MarkedBlock):
2272         (JSC::MarkedBlock::sweep):
2273         * runtime/MarkedBlock.h:
2274         (JSC::MarkedBlock::forEach): Changed a bunch of != tests to < tests
2275         because m_endAtom is actually a fuzzy end -- iterating from firstAtom()
2276         may not hit m_endAtom exactly.
2277
2278 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
2279
2280         Reviewed by Sam Weinig.
2281
2282         A little more abstraction for MarkedSpace::contains
2283         https://bugs.webkit.org/show_bug.cgi?id=54715
2284
2285         * runtime/MarkedBlock.h:
2286         (JSC::MarkedBlock::contains): Added a contains function, so MarkedSpace
2287         doesn't have to know how MarkedBlock tracks containment internally.
2288
2289         * runtime/MarkedSpace.h:
2290         (JSC::MarkedSpace::contains): Call through to MarkedBlock to figure out
2291         if a cell that seems to be in a block is valid.
2292
2293 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
2294
2295         Reviewed by Sam Weinig.
2296
2297         Removed the invariant that the last cell in a block is always marked
2298         https://bugs.webkit.org/show_bug.cgi?id=54713
2299         
2300         SunSpider reports no change.
2301         
2302         This adds one branch to allocation, but simplifies the mark invariant,
2303         especially in a world of variable-sized cells. Now, it really is true
2304         that any cell whose mark bit is set is a valid, live cell whose
2305         constructor has run and whose destructor has not run.
2306
2307         * runtime/JSCell.h: 
2308         (JSC::JSCell::MarkedBlock::allocate): Changed this do-while into a while
2309         since we can no longer rely on a set mark bit to break out of this loop
2310         before it reaches the end of the block.
2311
2312         * runtime/MarkedBlock.cpp:
2313         (JSC::MarkedBlock::MarkedBlock):
2314         (JSC::MarkedBlock::sweep): 
2315         * runtime/MarkedBlock.h:
2316         (JSC::MarkedBlock::isEmpty):
2317         (JSC::MarkedBlock::clearMarks):
2318         (JSC::MarkedBlock::markCount):
2319         (JSC::MarkedBlock::forEach): No need to set a special last mark bit.
2320
2321 2011-02-17  Sheriff Bot  <webkit.review.bot@gmail.com>
2322
2323         Unreviewed, rolling out r78856 and r78907.
2324         http://trac.webkit.org/changeset/78856
2325         http://trac.webkit.org/changeset/78907
2326         https://bugs.webkit.org/show_bug.cgi?id=54705
2327
2328         These seem to break tests on 32-bit builds. (Requested by
2329         aroben on #webkit).
2330
2331         * JavaScriptCore.xcodeproj/project.pbxproj:
2332         * collector/handles/Global.h:
2333         (JSC::Global::internalSet):
2334         * collector/handles/Handle.h:
2335         (JSC::HandleTypes::getFromSlot):
2336         (JSC::HandleTypes::toJSValue):
2337         (JSC::HandleTypes::validateUpcast):
2338         (JSC::HandleConverter::operator->):
2339         (JSC::HandleConverter::operator*):
2340         (JSC::Handle::Handle):
2341         (JSC::Handle::get):
2342         * runtime/JSArray.cpp:
2343         (JSC::JSArray::sortNumeric):
2344         * runtime/JSObject.h:
2345         (JSC::JSObject::inlineGetOwnPropertySlot):
2346         * runtime/SlotAccessor.h: Removed.
2347         * runtime/WeakGCPtr.h:
2348         (JSC::WeakGCPtr::get):
2349         (JSC::WeakGCPtr::internalSet):
2350         * runtime/WriteBarrier.h:
2351         (JSC::DeprecatedPtr::DeprecatedPtr):
2352         (JSC::DeprecatedPtr::get):
2353         (JSC::DeprecatedPtr::operator*):
2354         (JSC::DeprecatedPtr::operator->):
2355         (JSC::DeprecatedPtr::slot):
2356         (JSC::DeprecatedPtr::operator UnspecifiedBoolType*):
2357         (JSC::DeprecatedPtr::operator!):
2358         (JSC::WriteBarrierBase::set):
2359         (JSC::WriteBarrierBase::get):
2360         (JSC::WriteBarrierBase::operator*):
2361         (JSC::WriteBarrierBase::operator->):
2362         (JSC::WriteBarrierBase::clear):
2363         (JSC::WriteBarrierBase::slot):
2364         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
2365         (JSC::WriteBarrierBase::operator!):
2366         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
2367         (JSC::WriteBarrier::WriteBarrier):
2368
2369 2011-02-17  Csaba Osztrogon√°c  <ossy@webkit.org>
2370
2371         Unreviewed.
2372
2373         [Qt] Buildfix.
2374
2375         * wtf/RetainPtr.h: Add missing PLATFORM(CF) guard.
2376
2377 2011-02-17  Geoffrey Garen  <ggaren@apple.com>
2378
2379         Reviewed by Oliver Hunt.
2380
2381         Made MarkedBlock variable-sized
2382         https://bugs.webkit.org/show_bug.cgi?id=54692
2383         
2384         SunSpider reports no change.
2385         
2386         Each MarkedBlock is now composed of a set of fixed-sized atoms, with one
2387         mark bit per atom. A given cell may be composed of one or more atoms.
2388         
2389         * runtime/Heap.cpp:
2390         (JSC::Heap::allocate): Made fixed-sizedness a property of MarkedSpace,
2391         bubbling it up from MarkedBlock, since MarkedBlock now supports variable-
2392         sizedness.
2393
2394         * runtime/JSCell.h:
2395         (JSC::JSCell::MarkedBlock::allocate): Removed use of CELLS_PER_BLOCK and
2396         (implicit) one constants -- these quantities are not constant anymore.
2397         Updated for switch from cell to atom.
2398
2399         * runtime/MarkedBlock.cpp:
2400         (JSC::MarkedBlock::create):
2401         (JSC::MarkedBlock::destroy):
2402         (JSC::MarkedBlock::MarkedBlock):
2403         (JSC::MarkedBlock::sweep):
2404         * runtime/MarkedBlock.h:
2405         (JSC::MarkedBlock::firstAtom):
2406         (JSC::MarkedBlock::atoms):
2407         (JSC::MarkedBlock::isAtomAligned):
2408         (JSC::MarkedBlock::blockFor):
2409         (JSC::MarkedBlock::isEmpty):
2410         (JSC::MarkedBlock::clearMarks):
2411         (JSC::MarkedBlock::size):
2412         (JSC::MarkedBlock::capacity):
2413         (JSC::MarkedBlock::atomNumber):
2414         (JSC::MarkedBlock::isMarked):
2415         (JSC::MarkedBlock::testAndSetMarked):
2416         (JSC::MarkedBlock::setMarked):
2417         (JSC::MarkedBlock::forEach): Same as above. Also removed use of CELL_SIZE
2418         and BLOCK_SIZE, and switched away from calling arbitrary pointers cells.
2419
2420         * runtime/MarkedSpace.cpp:
2421         (JSC::MarkedSpace::MarkedSpace):
2422         (JSC::MarkedSpace::allocateBlock):
2423         (JSC::MarkedSpace::allocate):
2424         (JSC::MarkedSpace::reset):
2425         * runtime/MarkedSpace.h:
2426         (JSC::CollectorHeap::CollectorHeap):
2427         (JSC::MarkedSpace::contains): Updated for renames. Made fixed-sizedness
2428         a property of MarkedSpace.
2429
2430 2011-02-17  Oliver Hunt  <oliver@apple.com>
2431
2432         Attempt to fix windows build
2433
2434         * runtime/WriteBarrier.h:
2435
2436 2011-02-17  Oliver Hunt  <oliver@apple.com>
2437
2438         Reviewed by Geoffrey Garen.
2439
2440         Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
2441         https://bugs.webkit.org/show_bug.cgi?id=54608
2442
2443         Make use of the tricks used for Handle, et al to avoid duplicating all
2444         of the logic for DeprecatedPtr and WriteBarrier simply to support known
2445         vs. unknown types.
2446
2447         * JavaScriptCore.xcodeproj/project.pbxproj:
2448         * collector/handles/Global.h:
2449         (JSC::Global::internalSet):
2450         * collector/handles/Handle.h:
2451         (JSC::Handle::Handle):
2452         (JSC::Handle::get):
2453         * runtime/JSArray.cpp:
2454         (JSC::JSArray::sortNumeric):
2455         * runtime/JSObject.h:
2456         (JSC::JSObject::inlineGetOwnPropertySlot):
2457         * runtime/SlotAccessor.h: Added.
2458         (JSC::SlotTypes::getFromBaseType):
2459         (JSC::SlotTypes::convertToBaseType):
2460         (JSC::SlotTypes::getFromSlot):
2461         (JSC::SlotTypes::toJSValue):
2462         (JSC::SlotTypes::validateUpcast):
2463         (JSC::SlotAccessor::operator->):
2464         (JSC::SlotAccessor::operator*):
2465         * runtime/WeakGCPtr.h:
2466         (JSC::WeakGCPtr::get):
2467         (JSC::WeakGCPtr::internalSet):
2468         * runtime/WriteBarrier.h:
2469         (JSC::DeprecatedPtr::DeprecatedPtr):
2470         (JSC::DeprecatedPtr::get):
2471         (JSC::DeprecatedPtr::slot):
2472         (JSC::DeprecatedPtr::operator=):
2473         (JSC::WriteBarrierTranslator::convertToStorage):
2474         (JSC::WriteBarrierTranslator::convertFromStorage):
2475         (JSC::WriteBarrierBase::set):
2476         (JSC::WriteBarrierBase::get):
2477         (JSC::WriteBarrierBase::clear):
2478         (JSC::WriteBarrierBase::slot):
2479         (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
2480         (JSC::WriteBarrierBase::operator!):
2481         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
2482         (JSC::WriteBarrier::WriteBarrier):
2483
2484 2011-02-17  Kevin Ollivier  <kevino@theolliviers.com>
2485
2486         [wx] Revert incorrect blind fix and restore previous working code.
2487
2488         * wtf/wx/StringWx.cpp:
2489         (WTF::String::String):
2490
2491 2011-02-16  Geoffrey Garen  <ggaren@apple.com>
2492
2493         Reviewed by Maciej Stachowiak.
2494
2495         Intermittent crashes beneath MarkStack::drain
2496         https://bugs.webkit.org/show_bug.cgi?id=54614
2497         <rdar://problem/8971070>
2498         
2499         The crashes were caused by a GC happening after the global object's
2500         property table had grown (due to compilation), but before the properties
2501         had been fully initialized by program execution.
2502
2503         * bytecompiler/BytecodeGenerator.cpp:
2504         (JSC::BytecodeGenerator::BytecodeGenerator): Explicitly resize the global
2505         object's register storage immediately, without waiting for program
2506         execution to do it for us. This ensures that the global object's count
2507         of global variables is consistent with the size of its global variable
2508         storage at all times, and it ensures that all global variables are
2509         properly initialized from the get-go.
2510
2511         * runtime/JSGlobalObject.cpp:
2512         (JSC::JSGlobalObject::resizeRegisters):
2513         * runtime/JSGlobalObject.h: Added a helper function for growing the
2514         global object's register storage, and initializing new registers.
2515
2516 == Rolled over to ChangeLog-2011-02-16 ==