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