f1cdbc7c7a76b1f1938d6a3b814496272664cf03
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-02-16  Gavin Barraclough  <barraclough@apple.com>
2
3         Reviewed by Mark Rowe.
4
5         Fix a handful of other leaks seen on the buildbot.
6
7         * runtime/UStringImpl.h:
8         (JSC::UStringOrRopeImpl::deref): Delegate through to the subclass version of deref to ensure that
9         the correct cleanup takes place.  This function previously featured some code that attempted to
10         skip deletion of static UStringImpl's.  Closer inspection revealed that it was in fact equivalent
11         to "if (false)", meaning that UStringImpl's which had their final deref performed via this function
12         were leaked.
13
14 2010-02-16  Mark Rowe  <mrowe@apple.com>
15
16         Reviewed by Gavin Barraclough.
17
18         Fix a handful of leaks seen on the buildbot.
19
20         * runtime/UStringImpl.h:
21         (JSC::UStringOrRopeImpl::deref): Call URopeImpl::destructNonRecursive rather than delete
22         to ensure that the rope's fibers are also destroyed.
23
24 2010-02-16  Gavin Barraclough  <barraclough@apple.com>
25
26         Reviewed by Oliver Hunt.
27
28         https://bugs.webkit.org/show_bug.cgi?id=34964
29         Leaks tool reports false memory leaks due to Rope implementation.
30
31         A rope is a recursive data structure where each node in the rope holds a set of
32         pointers, each of which may reference either a string (in UStringImpl form) or
33         another rope node.  A low bit in each pointer is used to distinguish between
34         rope & string elements, in a fashion similar to the recently-removed
35         PtrAndFlags class (see https://bugs.webkit.org/show_bug.cgi?id=33731 ).  Again,
36         this causes a problem for Leaks – refactor to remove the magic pointer
37         mangling.
38
39         Move Rope out from JSString.h and rename to URopeImpl, to match UStringImpl.
40         Give UStringImpl and URopeImpl a common parent class, UStringOrRopeImpl.
41         Repurpose an otherwise invalid permutation to flags (static & should report
42         memory cost) to identify ropes.
43
44         This allows us to change the rope's fibers to interrogate the object rather
45         than storing a bool within the low bits of the pointer (or in some cases the
46         use of a common parent class removes the need to determine the type at all -
47         there is a common interface to ref or get the length of either ropes or strings).
48
49         * API/JSClassRef.cpp:
50         (OpaqueJSClass::OpaqueJSClass):
51         (OpaqueJSClassContextData::OpaqueJSClassContextData):
52         * bytecompiler/BytecodeGenerator.cpp:
53         (JSC::keyForCharacterSwitch):
54         * interpreter/Interpreter.cpp:
55         (JSC::Interpreter::privateExecute):
56         * jit/JITStubs.cpp:
57         (JSC::DEFINE_STUB_FUNCTION):
58         * runtime/ArrayPrototype.cpp:
59         (JSC::arrayProtoFuncToString):
60         * runtime/Identifier.cpp:
61         (JSC::Identifier::equal):
62         (JSC::Identifier::addSlowCase):
63         * runtime/JSString.cpp:
64         (JSC::JSString::resolveRope):
65         * runtime/JSString.h:
66         (JSC::):
67         (JSC::RopeBuilder::JSString):
68         (JSC::RopeBuilder::~JSString):
69         (JSC::RopeBuilder::appendStringInConstruct):
70         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
71         (JSC::RopeBuilder::JSStringFinalizerStruct::JSStringFinalizerStruct):
72         (JSC::RopeBuilder::JSStringFinalizerStruct::):
73         * runtime/UString.cpp:
74         (JSC::UString::toStrictUInt32):
75         (JSC::equal):
76         * runtime/UString.h:
77         (JSC::UString::isEmpty):
78         (JSC::UString::size):
79         * runtime/UStringImpl.cpp:
80         (JSC::URopeImpl::derefFibersNonRecursive):
81         (JSC::URopeImpl::destructNonRecursive):
82         * runtime/UStringImpl.h:
83         (JSC::UStringOrRopeImpl::isRope):
84         (JSC::UStringOrRopeImpl::length):
85         (JSC::UStringOrRopeImpl::ref):
86         (JSC::UStringOrRopeImpl::):
87         (JSC::UStringOrRopeImpl::operator new):
88         (JSC::UStringOrRopeImpl::UStringOrRopeImpl):
89         (JSC::UStringImpl::adopt):
90         (JSC::UStringImpl::createUninitialized):
91         (JSC::UStringImpl::tryCreateUninitialized):
92         (JSC::UStringImpl::data):
93         (JSC::UStringImpl::cost):
94         (JSC::UStringImpl::deref):
95         (JSC::UStringImpl::UStringImpl):
96         (JSC::UStringImpl::):
97         (JSC::URopeImpl::tryCreateUninitialized):
98         (JSC::URopeImpl::initializeFiber):
99         (JSC::URopeImpl::fiberCount):
100         (JSC::URopeImpl::fibers):
101         (JSC::URopeImpl::deref):
102         (JSC::URopeImpl::URopeImpl):
103         (JSC::URopeImpl::hasOneRef):
104         (JSC::UStringOrRopeImpl::deref):
105
106 2010-02-15  Gabor Loki  <loki@webkit.org>
107
108         Reviewed by Gavin Barraclough.
109
110         Fix the SP at ctiOpThrowNotCaught on Thumb2 (JSVALUE32)
111         https://bugs.webkit.org/show_bug.cgi?id=34939
112
113         * jit/JITStubs.cpp:
114
115 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
116
117         Reviewed by NOBODY (Build Fix!).
118
119         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
120
121 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
122
123         Reviewed by Oliver Hunt.
124
125         Some general Rope related refactoring.
126
127         Rename Rope::m_ropeLength to m_fiberCount, to be more descriptive.
128         Rename Rope::m_stringLength to simply m_length (since this is the
129         more conventional name for the length of a string).  Move append
130         behaviour out into a new RopeBuilder class, so that Rope no longer
131         needs any knowledge of the JSString or UString implementation.
132
133         Make Rope no longer be nested within JSString.
134         (Rope now no-longer need reside within JSString.h, but leaving
135         the change of moving this out to a different header as a separate
136         change from these renames).
137
138         * JavaScriptCore.exp:
139         * jit/JITOpcodes.cpp:
140         (JSC::JIT::privateCompileCTIMachineTrampolines):
141         * runtime/JSString.cpp:
142         (JSC::Rope::destructNonRecursive):
143         (JSC::Rope::~Rope):
144         (JSC::JSString::resolveRope):
145         (JSC::JSString::toBoolean):
146         (JSC::JSString::getStringPropertyDescriptor):
147         * runtime/JSString.h:
148         (JSC::Rope::Fiber::Fiber):
149         (JSC::Rope::Fiber::deref):
150         (JSC::Rope::Fiber::ref):
151         (JSC::Rope::Fiber::refAndGetLength):
152         (JSC::Rope::Fiber::isRope):
153         (JSC::Rope::Fiber::rope):
154         (JSC::Rope::Fiber::isString):
155         (JSC::Rope::Fiber::string):
156         (JSC::Rope::Fiber::nonFiber):
157         (JSC::Rope::tryCreateUninitialized):
158         (JSC::Rope::append):
159         (JSC::Rope::fiberCount):
160         (JSC::Rope::length):
161         (JSC::Rope::fibers):
162         (JSC::Rope::Rope):
163         (JSC::Rope::operator new):
164         (JSC::):
165         (JSC::RopeBuilder::JSString):
166         (JSC::RopeBuilder::~JSString):
167         (JSC::RopeBuilder::length):
168         (JSC::RopeBuilder::canGetIndex):
169         (JSC::RopeBuilder::appendStringInConstruct):
170         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
171         (JSC::RopeBuilder::isRope):
172         (JSC::RopeBuilder::fiberCount):
173         (JSC::JSString::getStringPropertySlot):
174         * runtime/Operations.h:
175         (JSC::jsString):
176
177 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
178
179         Reviewed by NOBODY (Build fix).
180
181         Add missing cast for !YARR (PPC) builds.
182
183         * runtime/RegExp.cpp:
184         (JSC::RegExp::match):
185
186 2010-02-14  Gavin Barraclough  <barraclough@apple.com>
187
188         Reviewed by Darin Adler.
189
190         https://bugs.webkit.org/show_bug.cgi?id=33731
191         Many false leaks in release builds due to PtrAndFlags
192
193         StructureTransitionTable was effectively a smart pointer type,
194         one machine word in size and wholly contained as a member of
195         of Structure.  It either pointed to an actual table, or could
196         be used to describe a single transtion entry without use of a
197         table.
198
199         This, however, worked by using a PtrAndFlags, which is not
200         compatible with the leaks tool.  Since there is no clear way to
201         obtain another bit for 'free' here, and since there are bits
202         available up in Structure, merge this functionality back up into
203         Structure.  Having this in a separate class was quite clean
204         from an enacapsulation perspective, but this solution doesn't
205         seem to bad - all table access is now intermediated through the
206         Structure::structureTransitionTableFoo methods, keeping the
207         optimization fairly well contained.
208
209         This was the last use of PtrAndFlags, so removing the file too.
210
211         * JavaScriptCore.xcodeproj/project.pbxproj:
212         * bytecode/CodeBlock.h:
213         * runtime/Structure.cpp:
214         (JSC::Structure::Structure):
215         (JSC::Structure::~Structure):
216         (JSC::Structure::addPropertyTransitionToExistingStructure):
217         (JSC::Structure::addPropertyTransition):
218         (JSC::Structure::hasTransition):
219         * runtime/Structure.h:
220         (JSC::Structure::):
221         (JSC::Structure::structureTransitionTableContains):
222         (JSC::Structure::structureTransitionTableGet):
223         (JSC::Structure::structureTransitionTableHasTransition):
224         (JSC::Structure::structureTransitionTableRemove):
225         (JSC::Structure::structureTransitionTableAdd):
226         (JSC::Structure::structureTransitionTable):
227         (JSC::Structure::setStructureTransitionTable):
228         (JSC::Structure::singleTransition):
229         (JSC::Structure::setSingleTransition):
230         * runtime/StructureTransitionTable.h:
231         * wtf/PtrAndFlags.h: Removed.
232
233 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
234
235         Rubber Stamped by Geoff Garen.
236
237         Bug 34948 - tryMakeString should fail on error in length calculation
238
239         Ooops! - "bool overflow" argument should have been "bool& overflow".
240
241         * runtime/UString.h:
242         (JSC::sumWithOverflow):
243         (JSC::tryMakeString):
244
245 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
246
247         Reviewed by NOBODY (Build Fix (pt 2!)).
248
249         Some symbol names have changed, remove, will readd if required.
250
251         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
252
253 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
254
255         Reviewed by NOBODY (Build Fix (pt 1?)).
256
257         Some symbol names have changed, remove, will readd if required.
258
259         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
260
261 2010-02-15  Geoffrey Garen  <ggaren@apple.com>
262
263         Reviewed by Oliver Hunt.
264
265         Removed some mistaken code added in http://trac.webkit.org/changeset/53860.
266
267         * API/APIShims.h:
268         (JSC::APICallbackShim::APICallbackShim):
269         (JSC::APICallbackShim::~APICallbackShim): No need to start/stop the
270         timeout checker when calling out from the API to the client; we want to
271         monitor the VM for timeouts, not the client. This mistake was harmless /
272         undetectable, since it's totally redundant with the APIEntryShim, which
273         also starts / stops the timeout checker.
274
275 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
276
277         Reviewed by Geoff Garen.
278
279         Bug 34952 - String lengths in UString should be unsigned.
280         This matches WebCore::StringImpl, and better unifies behaviour throughout JSC.
281
282         * JavaScriptCore.exp:
283         * bytecode/EvalCodeCache.h:
284         * runtime/Identifier.cpp:
285         (JSC::Identifier::equal):
286         * runtime/Identifier.h:
287         * runtime/JSGlobalObjectFunctions.cpp:
288         (JSC::globalFuncEscape):
289         * runtime/JSONObject.cpp:
290         (JSC::gap):
291         (JSC::Stringifier::indent):
292         * runtime/NumberPrototype.cpp:
293         (JSC::numberProtoFuncToFixed):
294         (JSC::numberProtoFuncToPrecision):
295         * runtime/RegExp.cpp:
296         (JSC::RegExp::match):
297         * runtime/StringPrototype.cpp:
298         (JSC::substituteBackreferencesSlow):
299         (JSC::stringProtoFuncReplace):
300         (JSC::stringProtoFuncSplit):
301         (JSC::trimString):
302         * runtime/UString.cpp:
303         (JSC::UString::UString):
304         (JSC::UString::from):
305         (JSC::UString::getCString):
306         (JSC::UString::ascii):
307         (JSC::UString::operator[]):
308         (JSC::UString::toStrictUInt32):
309         (JSC::UString::find):
310         (JSC::UString::rfind):
311         (JSC::UString::substr):
312         (JSC::operator<):
313         (JSC::operator>):
314         (JSC::compare):
315         (JSC::equal):
316         (JSC::UString::UTF8String):
317         * runtime/UString.h:
318         (JSC::UString::size):
319         (JSC::operator==):
320         * runtime/UStringImpl.cpp:
321         (JSC::UStringImpl::create):
322         * runtime/UStringImpl.h:
323         (JSC::UStringImpl::create):
324         (JSC::UStringImpl::size):
325         (JSC::UStringImpl::computeHash):
326         (JSC::UStringImpl::UStringImpl):
327
328 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
329
330         Reviewed by Geoff Garen.
331
332         Bug 34948 - tryMakeString should fail on error in length calculation
333
334         The sum of the length of substrings could overflow.
335
336         * runtime/UString.h:
337         (JSC::sumWithOverflow):
338         (JSC::tryMakeString):
339
340 2010-02-15  Geoffrey Garen  <ggaren@apple.com>
341
342         Reviewed by Oliver Hunt.
343
344         Fixed <rdar://problem/7628524> Crash beneath JSGlobalContextRelease when
345         typing in Google search field with GuardMalloc/full page heap enabled
346
347         * API/JSContextRef.cpp: Don't use APIEntryShim, since that requires
348         a JSGlobalData, which this function destroys. Do use setCurrentIdentifierTable
349         and JSLock instead, since those are the two features of APIEntryShim we
350         require.
351
352 2010-02-15  Patrick Gansterer  <paroga@paroga.com>
353
354         Reviewed by Laszlo Gombos.
355
356         Added additional parameter to create_rvct_stubs 
357         for setting the offset of thunkReturnAddress.
358         https://bugs.webkit.org/show_bug.cgi?id=34657
359
360         * create_rvct_stubs:
361         * jit/JITStubs.cpp:
362
363 2010-02-15  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
364
365         Reviewed by Simon Hausmann.
366
367         Fix QScriptValue::toIntXX methods.
368
369         More ECMA Script compliance.
370
371         [Qt] QScriptValue::toIntXX returns incorrect values
372         https://bugs.webkit.org/show_bug.cgi?id=34847
373
374         * qt/api/qscriptvalue_p.h:
375         (QScriptValuePrivate::toInteger):
376         (QScriptValuePrivate::toInt32):
377         (QScriptValuePrivate::toUInt32):
378         (QScriptValuePrivate::toUInt16):
379         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
380         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
381         (tst_QScriptValue::toInteger_initData):
382         (tst_QScriptValue::toInteger_makeData):
383         (tst_QScriptValue::toInteger_test):
384         (tst_QScriptValue::toInt32_initData):
385         (tst_QScriptValue::toInt32_makeData):
386         (tst_QScriptValue::toInt32_test):
387         (tst_QScriptValue::toUInt32_initData):
388         (tst_QScriptValue::toUInt32_makeData):
389         (tst_QScriptValue::toUInt32_test):
390         (tst_QScriptValue::toUInt16_initData):
391         (tst_QScriptValue::toUInt16_makeData):
392         (tst_QScriptValue::toUInt16_test):
393
394 2010-02-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
395
396         Reviewed by Adam Barth.
397
398         Implement NEVER_INLINE and NO_RETURN for RVCT
399         https://bugs.webkit.org/show_bug.cgi?id=34740
400
401         * wtf/AlwaysInline.h:
402
403 2010-02-12  Gavin Barraclough  <barraclough@apple.com>
404
405         Reviewed by Oliver Hunt.
406
407         https://bugs.webkit.org/show_bug.cgi?id=33731
408         Remove uses of PtrAndFlags from JIT data stuctures.
409
410         These break the OS X Leaks tool.  Free up a bit in CallLinkInfo, and invalid
411         permutation of pointer states in MethodCallLinkInfo to represent the removed bits.
412
413         * bytecode/CodeBlock.h:
414         (JSC::CallLinkInfo::seenOnce):
415         (JSC::CallLinkInfo::setSeen):
416         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
417         (JSC::MethodCallLinkInfo::seenOnce):
418         (JSC::MethodCallLinkInfo::setSeen):
419         * jit/JIT.cpp:
420         (JSC::JIT::unlinkCall):
421         * jit/JITPropertyAccess.cpp:
422         (JSC::JIT::patchMethodCallProto):
423         * runtime/UString.h:
424
425 2010-02-12  Gavin Barraclough  <barraclough@apple.com>
426
427         Reviewed by Darin Adler.
428
429         https://bugs.webkit.org/show_bug.cgi?id=33731
430         Many false leaks in release builds due to PtrAndFlags
431
432         Remove UntypedPtrAndBitfield (similar to PtrAndFlags) in UStringImpl,
433         and steal bits from the refCount instead.
434
435         * runtime/UStringImpl.cpp:
436         (JSC::UStringImpl::baseSharedBuffer):
437         (JSC::UStringImpl::~UStringImpl):
438         * runtime/UStringImpl.h:
439         (JSC::UStringImpl::cost):
440         (JSC::UStringImpl::isIdentifier):
441         (JSC::UStringImpl::setIsIdentifier):
442         (JSC::UStringImpl::ref):
443         (JSC::UStringImpl::deref):
444         (JSC::UStringImpl::UStringImpl):
445         (JSC::UStringImpl::bufferOwnerString):
446         (JSC::UStringImpl::bufferOwnership):
447         (JSC::UStringImpl::isStatic):
448         (JSC::UStringImpl::):
449
450 2010-02-12  Geoffrey Garen  <ggaren@apple.com>
451
452         Reviewed by Darin Adler.
453
454         Removed an unnecessary data dependency from my last patch.
455
456         * runtime/SmallStrings.cpp:
457         (JSC::SmallStrings::markChildren): Since isAnyStringMarked being false
458         is a condition of entering the loop, we can just use '=' instead of '|='.
459
460 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
461
462         Reviewed by Tor Arne Vestbø.
463
464         Additional refptr/passrefptr workarounds for WINSCW compiler
465         https://bugs.webkit.org/show_bug.cgi?id=28054
466
467         * wtf/PassRefPtr.h:
468         (WTF::refIfNotNull):
469         (WTF::PassRefPtr::PassRefPtr):
470         (WTF::PassRefPtr::~PassRefPtr):
471         (WTF::PassRefPtr::clear):
472         (WTF::::operator):
473         * wtf/RefPtr.h:
474         (WTF::RefPtr::RefPtr):
475         (WTF::::operator):
476
477 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
478
479         Reviewed by Simon Hausmann.
480
481         Don't import the cmath functions from std:: for WINSCW.
482
483         * wtf/MathExtras.h:
484
485 2010-02-12  Kwang Yul Seo  <skyul@company100.net>
486
487         Reviewed by Adam Barth.
488
489         Typedef both JSChar and UChar to wchar_t in RVCT.
490         https://bugs.webkit.org/show_bug.cgi?id=34560
491
492         Define both JSChar and UChar to wchar_t as the size
493         of wchar_t is 2 bytes in RVCT.
494
495         * API/JSStringRef.h:
496         * wtf/unicode/qt4/UnicodeQt4.h:
497
498 2010-02-11  Geoffrey Garen  <ggaren@apple.com>
499
500         Reviewed by Oliver Hunt and Darin Adler.
501
502         The rest of the fix for
503         https://bugs.webkit.org/show_bug.cgi?id=34864 | <rdar://problem/7594198>
504         Many objects left uncollected after visiting mail.google.com and closing
505         window
506         
507         Don't unconditionally hang onto small strings. Instead, hang onto all
508         small strings as long as any small string is still referenced.
509         
510         SunSpider reports no change.
511
512         * runtime/Collector.cpp:
513         (JSC::Heap::markRoots): Mark the small strings cache last, so it can
514         check if anything else has kept any strings alive.
515
516         * runtime/SmallStrings.cpp:
517         (JSC::isMarked):
518         (JSC::SmallStrings::markChildren): Only keep our strings alive if some
519         other reference to at least one of them exists, too.
520
521 2010-02-11  Geoffrey Garen  <ggaren@apple.com>
522
523         Reviewed by Gavin Barraclough.
524
525         Some progress toward fixing
526         https://bugs.webkit.org/show_bug.cgi?id=34864 | <rdar://problem/7594198>
527         Many objects left uncollected after visiting mail.google.com and closing
528         window
529         
530         SunSpider reports no change.
531         
532         Keep weak references, rather than protected references, to cached for-in
533         property name enumerators.
534         
535         One problem with protected references is that a chain like 
536             [ gc object 1 ] => [ non-gc object ] => [ gc object 2 ]
537         takes two GC passes to break, since the first pass collects [ gc object 1 ],
538         releasing [ non-gc object ] and unprotecting [ gc object 2 ], and only
539         then can a second pass collect [ gc object 2 ].
540         
541         Another problem with protected references is that they can keep a bunch
542         of strings alive long after they're useful. In SunSpider and a few popular
543         websites, the size-speed tradeoff seems to favor weak references.
544
545         * runtime/JSPropertyNameIterator.cpp:
546         (JSC::JSPropertyNameIterator::JSPropertyNameIterator): Moved this constructor
547         into the .cpp file, since it's not used elsewhere.
548
549         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator): Added a destructor
550         to support our weak reference.
551
552         * runtime/JSPropertyNameIterator.h:
553         (JSC::Structure::setEnumerationCache):
554         (JSC::Structure::clearEnumerationCache):
555         (JSC::Structure::enumerationCache): Added a function for clearing a
556         Structure's enumeration cache, used by our new destructor. Also fixed
557         indentation to match the rest of the file.
558
559         * runtime/Structure.h: Changed from protected pointer to weak pointer.
560
561 2010-02-11  Chris Rogers  <crogers@google.com>
562
563         Reviewed by David Levin.
564
565         audio engine: add Complex number class
566         https://bugs.webkit.org/show_bug.cgi?id=34538
567
568         * wtf/Complex.h: Added.
569         (WebCore::complexFromMagnitudePhase):
570
571 2010-02-10  Geoffrey Garen  <ggaren@apple.com>
572
573         Reviewed by Oliver Hunt.
574
575         Added an SPI for asking about all the different live objects on the heap.
576         Useful for memory debugging.
577
578         * JavaScriptCore.exp: Export the new SPI.
579
580         * runtime/Collector.cpp:
581         (JSC::typeName): Use a little capitalization. Don't crash in the case of
582         a non-object cell, since it might just be an uninitialized cell.
583
584         (JSC::Heap::objectTypeCounts): The new SPI.
585
586         * runtime/Collector.h:
587         * runtime/CollectorHeapIterator.h:
588         (JSC::CollectorHeapIterator::advance):
589         (JSC::LiveObjectIterator::operator++):
590         (JSC::DeadObjectIterator::operator++):
591         (JSC::ObjectIterator::operator++): Made 2 tweaks to these iterators:
592         (1) Skip the last cell in the block, since it's a dummy sentinel, and
593         we don't want it to confuse the object count; (2) Fixed a logic error
594         in LiveObjectIterator that could cause it to iterate dead objects if
595         m_block were equal to m_heap.nextBlock and m_cell were less than
596         m_heap.nextCell. No test for this since I can't think of a way that this
597         could make WebKit behave badly.
598
599 2010-02-11  Steve Block  <steveblock@google.com>
600
601         Reviewed by Darin Adler.
602
603         Guard cmath using declarations in MathExtras.h on Android
604         https://bugs.webkit.org/show_bug.cgi?id=34840
605
606         Android does not provide these functions.
607
608         * wtf/MathExtras.h:
609
610 2010-02-08  Maciej Stachowiak  <mjs@apple.com>
611
612         Reviewed by Cameron Zwarich.
613
614         Restore ENABLE_RUBY flag so vendors can ship with Ruby disabled if they choose.
615         https://bugs.webkit.org/show_bug.cgi?id=34698
616
617         * Configurations/FeatureDefines.xcconfig:
618
619 2010-02-10  Kevin Watters  <kevinwatters@gmail.com>
620
621         Reviewed by Kevin Ollivier.
622
623         [wx] Add Windows complex text support and Mac support for containsCharacters.
624         
625         https://bugs.webkit.org/show_bug.cgi?id=34759
626
627         * wscript:
628
629 2010-02-10  Alexey Proskuryakov  <ap@apple.com>
630
631         Addressing issues found by style bot.
632
633         * wtf/ValueCheck.h: Renamed header guard to match final file name.
634
635         * wtf/Vector.h: (WTF::::checkConsistency): Remove braces around a one-line clause.
636
637 2010-02-09  Alexey Proskuryakov  <ap@apple.com>
638
639         Reviewed by Geoffrey Garen.
640
641         https://bugs.webkit.org/show_bug.cgi?id=34490
642         WebCore::ImageEventSender::dispatchPendingEvents() crashes in certain conditions
643
644         * GNUmakefile.am:
645         * JavaScriptCore.gypi:
646         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
647         * JavaScriptCore.xcodeproj/project.pbxproj:
648         Added ValueCheck.h.
649
650         * wtf/ValueCheck.h: Added. Moved code out of HashTraits, since it would be awkward to
651         include that from Vector.h.
652         (WTF::ValueCheck::checkConsistency): Allow null pointers, those are pretty consistent.
653
654         * wtf/HashTraits.h: Moved value checking code out of here.
655
656         * wtf/HashTable.h: (WTF::::checkTableConsistencyExceptSize): Updated for the above changes.
657
658         * wtf/Vector.h:
659         (WTF::::checkConsistency): Check all vector elements.
660         (WTF::ValueCheck): Support checking a Vector as an element in other containers. Currently
661         unused.
662
663 2010-02-10  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
664
665         Reviewed by Simon Hausmann.
666
667         Fix QScriptValue::toBool.
668
669         Fix ECMA compliance in the QScriptValue for values like 0, NaN and
670         empty strings.
671
672         [Qt] QScriptValue::toBool problem
673         https://bugs.webkit.org/show_bug.cgi?id=34793
674
675         * qt/api/qscriptvalue_p.h:
676         (QScriptValuePrivate::toBool):
677         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
678         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
679         (tst_QScriptValue::toBool_initData):
680         (tst_QScriptValue::toBool_makeData):
681         (tst_QScriptValue::toBool_test):
682         (tst_QScriptValue::toBoolean_initData):
683         (tst_QScriptValue::toBoolean_makeData):
684         (tst_QScriptValue::toBoolean_test):
685
686 2009-10-06  Yongjun Zhang  <yongjun.zhang@nokia.com>
687
688         Reviewed by Simon Hausmann.
689
690         Use derefIfNotNull() to work around WINSCW compiler forward declaration bug
691
692         The compiler bug is reported at
693         https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.
694
695         The change should be reverted when the above bug is fixed in WINSCW compiler.
696
697         https://bugs.webkit.org/show_bug.cgi?id=28054
698
699 2009-10-06  Yongjun Zhang  <yongjun.zhang@nokia.com>
700
701         Reviewed by Simon Hausmann.
702
703         Get rid of WINSCW hack for UnSpecifiedBoolType
704
705         Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make the WINSCW
706         compiler work with the default UnSpecifiedBoolType() operator.
707
708         https://bugs.webkit.org/show_bug.cgi?id=28054
709
710         * wtf/RefPtr.h:
711
712 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
713
714         Reviewed by Simon Hausmann.
715
716         New functions nullValue() and undefinedValue().
717
718         [Qt] QScriptEngine should contain nullValue and undefinedValue methods
719         https://bugs.webkit.org/show_bug.cgi?id=34749
720
721         * qt/api/qscriptengine.cpp:
722         (QScriptEngine::nullValue):
723         (QScriptEngine::undefinedValue):
724         * qt/api/qscriptengine.h:
725         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
726         (tst_QScriptEngine::nullValue):
727         (tst_QScriptEngine::undefinedValue):
728
729 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
730
731         Reviewed by Simon Hausmann.
732
733         Fixes for QScriptValue::toNumber().
734
735         Fix ECMA compliance in QScriptValue for values unbound
736         to a QScriptEngine.
737
738         [Qt] QScriptValue::toNumber() is broken
739         https://bugs.webkit.org/show_bug.cgi?id=34592
740
741         * qt/api/qscriptvalue_p.h:
742         (QScriptValuePrivate::toNumber):
743         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
744         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
745         (tst_QScriptValue::toNumber_initData):
746         (tst_QScriptValue::toNumber_makeData):
747         (tst_QScriptValue::toNumber_test):
748
749 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
750
751         Reviewed by Simon Hausmann.
752
753         Fix QScriptValue::isNumber().
754
755         The isNumber() should return 'true' if the value is in the CNumber
756         state.
757
758         [Qt] QScriptValue::isNumber() returns an incorrect value
759         https://bugs.webkit.org/show_bug.cgi?id=34575
760
761         * qt/api/qscriptvalue_p.h:
762         (QScriptValuePrivate::isNumber):
763         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
764         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
765         (tst_QScriptValue::isNumber_initData):
766         (tst_QScriptValue::isNumber_makeData):
767         (tst_QScriptValue::isNumber_test):
768
769 2010-02-09  Geoffrey Garen  <ggaren@apple.com>
770
771         Reviewed by Oliver Hunt.
772
773         Small refactoring to the small strings cache to allow it to be cleared
774         dynamically.
775
776         * runtime/SmallStrings.cpp:
777         (JSC::SmallStrings::SmallStrings):
778         (JSC::SmallStrings::clear):
779         * runtime/SmallStrings.h: Moved initialization code into a shared function,
780         and changed the constructor to call it.
781
782 2010-02-09  Gavin Barraclough  <barraclough@apple.com>
783
784         Rubber Stamped by Geoff Garen.
785
786         Rename StringBuilder::release && JSStringBuilder::releaseJSString
787         to 'build()'.
788
789         * runtime/ArrayPrototype.cpp:
790         (JSC::arrayProtoFuncToLocaleString):
791         (JSC::arrayProtoFuncJoin):
792         * runtime/Executable.cpp:
793         (JSC::FunctionExecutable::paramString):
794         * runtime/FunctionConstructor.cpp:
795         (JSC::constructFunction):
796         * runtime/JSGlobalObjectFunctions.cpp:
797         (JSC::encode):
798         (JSC::decode):
799         (JSC::globalFuncEscape):
800         (JSC::globalFuncUnescape):
801         * runtime/JSONObject.cpp:
802         (JSC::Stringifier::stringify):
803         * runtime/JSStringBuilder.h:
804         (JSC::JSStringBuilder::build):
805         * runtime/LiteralParser.cpp:
806         (JSC::LiteralParser::Lexer::lexString):
807         * runtime/NumberPrototype.cpp:
808         (JSC::integerPartNoExp):
809         (JSC::numberProtoFuncToFixed):
810         * runtime/StringBuilder.h:
811         (JSC::StringBuilder::build):
812
813 2010-02-09  John Sullivan  <sullivan@apple.com>
814
815         https://bugs.webkit.org/show_bug.cgi?id=34772
816         Overzealous new assertion in URStringImpl::adopt()
817
818         Reviewed by Adam Barth.
819
820         * runtime/UStringImpl.h:
821         (JSC::UStringImpl::adopt):
822         Only assert that vector.data() is non-zero if vector.size() is non-zero.
823
824 2010-02-09  Nikolas Zimmermann  <nzimmermann@rim.com>
825
826         Not reviewed. Try to fix build problem on SnowLeopard slaves to bring them back.
827
828         * API/JSClassRef.cpp:
829         (tryCreateStringFromUTF8): Mark method as 'static inline' to suppress "warning: no previous prototype for ..."
830
831 2010-02-09  Gavin Barraclough  <barraclough@apple.com>
832
833         Reviewed by Oliver Hunt.
834
835         Three small string fixes:
836         (1) StringBuilder::release should CRASH if the buffer allocation failed.
837         (2) Remove weird, dead code from JSString::tryGetValue, replace with an ASSERT.
838         (3) Move UString::createFromUTF8 out to the API, as tryCreateStringFromUTF8.
839             This is only used from the API, and (now) unlike other UString::create
840             methods may return UString::null() to indicate failure cases.  Better
841             handle these in the API.
842
843         * API/JSClassRef.cpp:
844         (tryCreateStringFromUTF8):
845         (OpaqueJSClass::OpaqueJSClass):
846         (OpaqueJSClassContextData::OpaqueJSClassContextData):
847         * runtime/JSString.h:
848         (JSC::Fiber::tryGetValue):
849         * runtime/StringBuilder.h:
850         (JSC::StringBuilder::release):
851         * runtime/UString.cpp:
852         (JSC::UString::UString):
853         (JSC::UString::from):
854         (JSC::UString::find):
855         * runtime/UString.h:
856
857 2010-02-09  Janne Koskinen  <janne.p.koskinen@digia.com>
858
859         Reviewed by Laszlo Gombos.
860
861         [Qt] use nanval() for Symbian as nonInlineNaN
862         https://bugs.webkit.org/show_bug.cgi?id=34170
863
864         numeric_limits<double>::quiet_NaN is broken in Symbian
865         causing NaN to be evaluated as a number.
866
867         * runtime/JSValue.cpp:
868         (JSC::nonInlineNaN):
869
870 2010-02-09  Tamas Szirbucz  <szirbucz@inf.u-szeged.hu>
871
872         Reviewed by Gavin Barraclough.
873
874         Add a soft modulo operation to ARM JIT using a trampoline function.
875         The performance progression is about ~1.8% on ARMv7
876         https://bugs.webkit.org/show_bug.cgi?id=34424
877
878         Developed in cooperation with Gabor Loki.
879
880         * jit/JIT.h:
881         * jit/JITArithmetic.cpp:
882         (JSC::JIT::emit_op_mod):
883         (JSC::JIT::emitSlow_op_mod):
884         * jit/JITOpcodes.cpp:
885         (JSC::JIT::softModulo):
886         * jit/JITStubs.h:
887         (JSC::JITThunks::ctiSoftModulo):
888         * wtf/Platform.h:
889
890 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
891
892         Reviewed by NOBODY (SL/win build fixes).
893
894         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
895         * runtime/StringPrototype.cpp:
896
897 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
898
899         Reviewed by Oliver Hunt
900
901         Make String.replace throw an exception on out-of-memory, rather than
902         returning a null (err, empty-ish) string.  Move String::replaceRange
903         and String::spliceSubstringsWithSeparators out to StringPrototype -
904         these were fairly specific use anyway, and we can better integrate
905         throwing the JS expcetion this way.
906
907         Also removes redundant assignment operator from UString.
908
909         * JavaScriptCore.exp:
910         * runtime/StringPrototype.cpp:
911         (JSC::StringRange::StringRange):
912         (JSC::jsSpliceSubstringsWithSeparators):
913         (JSC::jsReplaceRange):
914         (JSC::stringProtoFuncReplace):
915         * runtime/UString.cpp:
916         * runtime/UString.h:
917
918 2010-02-08  Kwang Yul Seo  <skyul@company100.net>
919
920         Reviewed by Eric Seidel.
921
922         [BREWMP] Undefine WTF_OS_WINDOWS and WTF_PLATFORM_WIN
923         https://bugs.webkit.org/show_bug.cgi?id=34561
924
925         As the binary for simulator is built with MSVC 2005,
926         WTF_OS_WINDOWS and WTF_PLATFORM_WIN are defined.
927         Undefine them as we don't target Windows.
928
929         * wtf/Platform.h:
930
931 2010-02-08  Chris Rogers  <crogers@google.com>
932
933         Reviewed by Darin Adler.
934
935         audio engine: add Vector3 class
936         https://bugs.webkit.org/show_bug.cgi?id=34548
937
938         * wtf/Vector3.h: Added.
939         (WebCore::Vector3::Vector3):
940         (WebCore::Vector3::abs):
941         (WebCore::Vector3::isZero):
942         (WebCore::Vector3::normalize):
943         (WebCore::Vector3::x):
944         (WebCore::Vector3::y):
945         (WebCore::Vector3::z):
946         (WebCore::operator+):
947         (WebCore::operator-):
948         (WebCore::operator*):
949         (WebCore::dot):
950         (WebCore::cross):
951         (WebCore::distance):
952
953 2010-02-08  Oliver Hunt  <oliver@apple.com>
954
955         Reviewed by Gavin Barraclough.
956
957         Fix warning in clang++
958
959         * runtime/Structure.h:
960         (JSC::Structure::propertyStorageSize):
961
962 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
963
964         Reviewed by Geoff Garen.
965
966         Make makeString CRASH if we fail to allocate a string.
967
968         (tryMakeString or jsMakeNontrivialString can be used where we
969         expect allocation may fail and want to handle the error).
970
971         * runtime/JSStringBuilder.h:
972         (JSC::jsMakeNontrivialString):
973         * runtime/UString.h:
974         (JSC::tryMakeString):
975         (JSC::makeString):
976
977 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
978
979         Rubber Stamped by Oliver Hunt.
980
981         Remove a couple of unnecesary C-style casts spotted by Darin.
982
983         * runtime/JSGlobalObjectFunctions.cpp:
984         (JSC::encode):
985         (JSC::globalFuncEscape):
986
987 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
988
989         Reviewed by Geoff Garen.
990
991         Switch some more StringBuilder/jsNontrivialString code to use
992         JSStringBuilder/jsMakeNontrivialString - these methods will
993         throw an exception if we hit out-of-memory, rather than just
994         CRASHing.
995
996         * runtime/FunctionPrototype.cpp:
997         (JSC::functionProtoFuncToString):
998         * runtime/JSGlobalObjectFunctions.cpp:
999         (JSC::encode):
1000         (JSC::decode):
1001         (JSC::globalFuncEscape):
1002
1003 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
1004
1005         Reviewed by Sam Weinig.
1006
1007         Use an empty identifier instead of a null identifier for parse
1008         tokens without an identifier.
1009
1010         This helps encapsulate the null UStringImpl within UString.
1011
1012         * parser/Grammar.y:
1013         * parser/NodeConstructors.h:
1014         (JSC::ContinueNode::ContinueNode):
1015         (JSC::BreakNode::BreakNode):
1016         (JSC::ForInNode::ForInNode):
1017         * runtime/CommonIdentifiers.cpp:
1018         (JSC::CommonIdentifiers::CommonIdentifiers):
1019         * runtime/CommonIdentifiers.h:
1020         * runtime/FunctionPrototype.cpp:
1021         (JSC::FunctionPrototype::FunctionPrototype):
1022
1023 2010-02-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1024
1025         Build fix for make distcheck.
1026
1027         * GNUmakefile.am:
1028
1029 2010-02-08  Simon Hausmann  <simon.hausmann@nokia.com>
1030
1031         Unreviewed RVCT build fix.
1032
1033         Similar to r54391, don't import the cmath functions from std:: for RVCT.
1034
1035         * wtf/MathExtras.h:
1036
1037 2010-02-05  Gavin Barraclough  <barraclough@apple.com>
1038
1039         Reviewed by Geoff Garen.
1040
1041         Change UStringImpl::create to CRASH if the string cannot be allocated,
1042         rather than returning a null string (which will behave like a zero-length
1043         string if used).
1044
1045         Also move createRep function from UString to become new overloaded
1046         UStringImpl::create methods.  In doing so, bring their behaviour closer to
1047         being in line with WebCore::StringImpl, in removing the behaviour that they
1048         can be used to produce null UStrings (ASSERT the char* provided is non-null).
1049         This behaviour of converting null C-strings to null UStrings is inefficient
1050         (cmompared to just using UString::null()), incompatible with WebCore::StringImpl's
1051         behaviour, and may generate unexpected behaviour, since in many cases a null
1052         UString can be used like an empty string.
1053
1054         With these changes UStringImpl need not have a concept of null impls, we can
1055         start transitioning this to become an implementation detail of UString, that
1056         internally it chooses to use a null-object rather than an actually zero impl
1057         pointer.
1058
1059         * JavaScriptCore.exp:
1060         * debugger/Debugger.cpp:
1061         (JSC::Debugger::recompileAllJSFunctions):
1062         * debugger/DebuggerCallFrame.cpp:
1063         (JSC::DebuggerCallFrame::calculatedFunctionName):
1064         * parser/Parser.cpp:
1065         (JSC::Parser::parse):
1066         * profiler/Profile.cpp:
1067         (JSC::Profile::Profile):
1068         * profiler/ProfileGenerator.cpp:
1069         (JSC::ProfileGenerator::stopProfiling):
1070         * runtime/Error.cpp:
1071         (JSC::Error::create):
1072         (JSC::throwError):
1073         * runtime/ExceptionHelpers.cpp:
1074         (JSC::createError):
1075         * runtime/Identifier.cpp:
1076         (JSC::Identifier::add):
1077         * runtime/PropertyNameArray.cpp:
1078         (JSC::PropertyNameArray::add):
1079         * runtime/UString.cpp:
1080         (JSC::initializeUString):
1081         (JSC::UString::UString):
1082         (JSC::UString::operator=):
1083         * runtime/UString.h:
1084         (JSC::UString::isNull):
1085         (JSC::UString::null):
1086         (JSC::UString::rep):
1087         (JSC::UString::UString):
1088         * runtime/UStringImpl.cpp:
1089         (JSC::UStringImpl::create):
1090         * runtime/UStringImpl.h:
1091
1092 2010-02-05  Kwang Yul Seo  <skyul@company100.net>
1093
1094         Reviewed by Eric Seidel.
1095
1096         [BREWMP] Define SYSTEM_MALLOC 1
1097         https://bugs.webkit.org/show_bug.cgi?id=34640
1098
1099         Make BREWMP use system malloc because FastMalloc is not ported.
1100
1101         * wtf/Platform.h:
1102
1103 2010-02-05  Kwang Yul Seo  <skyul@company100.net>
1104
1105         Reviewed by Alexey Proskuryakov.
1106
1107         Don't call CRASH() in fastMalloc and fastCalloc when the requested memory size is 0
1108         https://bugs.webkit.org/show_bug.cgi?id=34569
1109
1110         With USE_SYSTEM_MALLOC=1, fastMalloc and fastCalloc call CRASH()
1111         if the return value of malloc and calloc is 0.
1112         
1113         However, these functions can return 0 when the request size is 0.
1114         Libc manual says, "If size is 0, then malloc() returns either NULL,
1115         or a unique pointer value that can later be successfully passed to free()."
1116         Though malloc returns a unique pointer in most systems,
1117         0 can be returned in some systems. For instance, BREW's MALLOC returns 0
1118         when size is 0.
1119
1120         If malloc or calloc returns 0 due to allocation size, increase the size
1121         to 1 and try again.
1122
1123         * wtf/FastMalloc.cpp:
1124         (WTF::fastMalloc):
1125         (WTF::fastCalloc):
1126
1127 2010-02-04  Mark Rowe  <mrowe@apple.com>
1128
1129         Reviewed by Timothy Hatcher.
1130
1131         Build fix.  Remove a symbol corresponding to an inline function from the linker export
1132         file to prevent a weak external failure.
1133
1134         * JavaScriptCore.xcodeproj/project.pbxproj: Accommodate rename of script.
1135
1136 2010-02-04  Daniel Bates  <dbates@webkit.org>
1137
1138         [Qt] Unreviewed, build fix for Qt bot.
1139
1140         * runtime/JSStringBuilder.h: Changed #include <X.h> notation #include "X.h".
1141
1142 2010-02-04  Geoffrey Garen  <ggaren@apple.com>
1143
1144         Reviewed by Oliver Hunt.
1145
1146         Clearing a WeakGCPtr is weird
1147         https://bugs.webkit.org/show_bug.cgi?id=34627
1148
1149         Added a WeakGCPtr::clear interface.
1150         
1151         As discussed in https://bugs.webkit.org/show_bug.cgi?id=33383, the old
1152         interface made it pretty weird for a client to conditionally clear a
1153         WeakGCPtr, which is exactly what clients want to do when objects are
1154         finalized.
1155
1156         * API/JSClassRef.cpp:
1157         (clearReferenceToPrototype): Use the new WeakGCPtr::clear() interface. 
1158
1159         * runtime/WeakGCPtr.h:
1160         (JSC::WeakGCPtr::clear): Added an interface for clearing a WeakGCPtr,
1161         iff its current value is the value passed in. It's cumbersome for the
1162         client to do this test, since WeakGCPtr sometimes pretends to be null.
1163
1164 2010-02-04  Geoffrey Garen  <ggaren@apple.com>
1165
1166         Build fix: export a header.
1167
1168         * JavaScriptCore.xcodeproj/project.pbxproj:
1169
1170 2010-02-04  Gavin Barraclough  <barraclough@apple.com>
1171
1172         Reviewed by Oliver Hunt.
1173
1174         Add a JSStringBuilder class (similar-to, and derived-from StringBuilder) to
1175         construct JSStrings, throwing a JS exception should we run out of memory whilst
1176         allocating storage for the string.
1177
1178         Similarly, add jsMakeNontrivialString methods to use in cases where previously
1179         we were calling makeString & passing the result to jsNontrivialString.  Again,
1180         these new methods throw if we hit an out of memory condition.
1181
1182         Move throwOutOfMemoryError into ExceptionHelpers, to make it more widely available.
1183
1184         * JavaScriptCore.xcodeproj/project.pbxproj:
1185         * runtime/ArrayPrototype.cpp:
1186         (JSC::arrayProtoFuncToString):
1187         (JSC::arrayProtoFuncToLocaleString):
1188         (JSC::arrayProtoFuncJoin):
1189         * runtime/DateConstructor.cpp:
1190         (JSC::callDate):
1191         * runtime/DatePrototype.cpp:
1192         (JSC::dateProtoFuncToString):
1193         (JSC::dateProtoFuncToUTCString):
1194         (JSC::dateProtoFuncToGMTString):
1195         * runtime/ErrorPrototype.cpp:
1196         (JSC::errorProtoFuncToString):
1197         * runtime/ExceptionHelpers.cpp:
1198         (JSC::throwOutOfMemoryError):
1199         * runtime/ExceptionHelpers.h:
1200         * runtime/JSStringBuilder.h: Added.
1201         (JSC::JSStringBuilder::releaseJSString):
1202         (JSC::jsMakeNontrivialString):
1203         * runtime/NumberPrototype.cpp:
1204         (JSC::numberProtoFuncToPrecision):
1205         * runtime/ObjectPrototype.cpp:
1206         (JSC::objectProtoFuncToString):
1207         * runtime/Operations.cpp:
1208         * runtime/Operations.h:
1209         * runtime/RegExpPrototype.cpp:
1210         (JSC::regExpProtoFuncToString):
1211         * runtime/StringBuilder.h:
1212         (JSC::StringBuilder::append):
1213         * runtime/StringPrototype.cpp:
1214         (JSC::stringProtoFuncBig):
1215         (JSC::stringProtoFuncSmall):
1216         (JSC::stringProtoFuncBlink):
1217         (JSC::stringProtoFuncBold):
1218         (JSC::stringProtoFuncFixed):
1219         (JSC::stringProtoFuncItalics):
1220         (JSC::stringProtoFuncStrike):
1221         (JSC::stringProtoFuncSub):
1222         (JSC::stringProtoFuncSup):
1223         (JSC::stringProtoFuncFontcolor):
1224         (JSC::stringProtoFuncFontsize):
1225         (JSC::stringProtoFuncAnchor):
1226
1227 2010-02-04  Steve Falkenburg  <sfalken@apple.com>
1228
1229         Windows build fix.
1230
1231         * wtf/MathExtras.h:
1232
1233 2010-02-04  Darin Adler  <darin@apple.com>
1234
1235         Reviewed by David Levin.
1236
1237         Make MathExtras.h compatible with <cmath>
1238         https://bugs.webkit.org/show_bug.cgi?id=34618
1239
1240         * wtf/MathExtras.h: Include <cmath> instead of <math.h>.
1241         Use "using" as we do elsewhere in WTF for the four functions from <cmath>
1242         we want to use without the prefix. Later we could consider making the std
1243         explicit at call sites instead.
1244
1245 2010-02-04  Tamas Szirbucz  <szirbucz@inf.u-szeged.hu>
1246
1247         Reviewed by Gavin Barraclough.
1248
1249         Use an easily appendable structure for trampolines instead of pointer parameters.
1250         https://bugs.webkit.org/show_bug.cgi?id=34424
1251
1252         * assembler/ARMAssembler.cpp:
1253         (JSC::ARMAssembler::executableCopy):
1254         * jit/JIT.h:
1255         (JSC::JIT::compileCTIMachineTrampolines):
1256         * jit/JITOpcodes.cpp:
1257         (JSC::JIT::privateCompileCTIMachineTrampolines):
1258         * jit/JITStubs.cpp:
1259         (JSC::JITThunks::JITThunks):
1260         * jit/JITStubs.h:
1261         (JSC::JITThunks::ctiStringLengthTrampoline):
1262         (JSC::JITThunks::ctiVirtualCallLink):
1263         (JSC::JITThunks::ctiVirtualCall):
1264         (JSC::JITThunks::ctiNativeCallThunk):
1265
1266 2010-02-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1267
1268         Reviewed by Simon Hausmann.
1269
1270         Increase test coverage for the QScriptValue.
1271
1272         https://bugs.webkit.org/show_bug.cgi?id=34533
1273
1274         * qt/tests/qscriptvalue/qscriptvalue.pro:
1275         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
1276         (tst_QScriptValue::tst_QScriptValue):
1277         (tst_QScriptValue::~tst_QScriptValue):
1278         (tst_QScriptValue::dataHelper):
1279         (tst_QScriptValue::newRow):
1280         (tst_QScriptValue::testHelper):
1281         (tst_QScriptValue::ctor):
1282         * qt/tests/qscriptvalue/tst_qscriptvalue.h: Added.
1283         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp: Added.
1284         (tst_QScriptValue::initScriptValues):
1285         (tst_QScriptValue::isValid_initData):
1286         (tst_QScriptValue::isValid_makeData):
1287         (tst_QScriptValue::isValid_test):
1288         (tst_QScriptValue::isBool_initData):
1289         (tst_QScriptValue::isBool_makeData):
1290         (tst_QScriptValue::isBool_test):
1291         (tst_QScriptValue::isBoolean_initData):
1292         (tst_QScriptValue::isBoolean_makeData):
1293         (tst_QScriptValue::isBoolean_test):
1294         (tst_QScriptValue::isFunction_initData):
1295         (tst_QScriptValue::isFunction_makeData):
1296         (tst_QScriptValue::isFunction_test):
1297         (tst_QScriptValue::isNull_initData):
1298         (tst_QScriptValue::isNull_makeData):
1299         (tst_QScriptValue::isNull_test):
1300         (tst_QScriptValue::isString_initData):
1301         (tst_QScriptValue::isString_makeData):
1302         (tst_QScriptValue::isString_test):
1303         (tst_QScriptValue::isUndefined_initData):
1304         (tst_QScriptValue::isUndefined_makeData):
1305         (tst_QScriptValue::isUndefined_test):
1306         (tst_QScriptValue::isObject_initData):
1307         (tst_QScriptValue::isObject_makeData):
1308         (tst_QScriptValue::isObject_test):
1309
1310 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
1311
1312         Reviewed by Eric Seidel.
1313
1314         [BREWMP] Define WTF_PLATFORM_BREWMP_SIMULATOR when AEE_SIMULATOR is defined
1315         https://bugs.webkit.org/show_bug.cgi?id=34514
1316
1317         PLATFORM(BREWMP_SIMULATOR) guard is needed to make distinction between BREWMP
1318         and BREWMP simulator.
1319
1320         * wtf/Platform.h:
1321
1322 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
1323
1324         Reviewed by Eric Seidel.
1325
1326         [BREWMP] Remove COMPILE_ASSERT conflict with the underlying PLATFORM
1327         https://bugs.webkit.org/show_bug.cgi?id=34190
1328
1329         COMPILE_ASSERT conflicts with the underlying PLATFORM because it is defined
1330         both in WTF's Assertions.h and BREWMP's AEEClassIDs.h. Include AEEClassIDs.h
1331         in Assertions.h and undef COMPILE_ASSERT to avoid redefining COMPILE_ASSERT.
1332
1333         * wtf/Assertions.h:
1334
1335 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
1336
1337         Reviewed by Eric Seidel.
1338
1339         [BREWMP] Implement OwnPtrBrew to make sure BREW instances are freed.
1340         https://bugs.webkit.org/show_bug.cgi?id=34518
1341
1342         Add OwnPtrBrew to release IFile, IFileMgr and IBitmap instances.
1343
1344         * wtf/brew/OwnPtrBrew.cpp: Added.
1345         (WTF::IFileMgr):
1346         (WTF::IFile):
1347         (WTF::IBitmap):
1348         (WTF::freeOwnedPtrBrew):
1349         * wtf/brew/OwnPtrBrew.h: Added.
1350         (WTF::OwnPtrBrew::OwnPtrBrew):
1351         (WTF::OwnPtrBrew::~OwnPtrBrew):
1352         (WTF::OwnPtrBrew::get):
1353         (WTF::OwnPtrBrew::release):
1354         (WTF::OwnPtrBrew::outPtr):
1355         (WTF::OwnPtrBrew::set):
1356         (WTF::OwnPtrBrew::clear):
1357         (WTF::OwnPtrBrew::operator*):
1358         (WTF::OwnPtrBrew::operator->):
1359         (WTF::OwnPtrBrew::operator!):
1360         (WTF::OwnPtrBrew::operator UnspecifiedBoolType):
1361         (WTF::OwnPtrBrew::swap):
1362         (WTF::swap):
1363         (WTF::operator==):
1364         (WTF::operator!=):
1365         (WTF::getPtr):
1366
1367 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
1368
1369         Reviewed by Darin Adler.
1370
1371         Export WTF::fastStrDup symbol
1372         https://bugs.webkit.org/show_bug.cgi?id=34526
1373
1374         * JavaScriptCore.exp:
1375
1376 2010-02-03  Kevin Watters  <kevinwatters@gmail.com>
1377
1378         Reviewed by Kevin Ollivier.
1379
1380         [wx] Enable JIT compilation for wx.
1381         
1382         https://bugs.webkit.org/show_bug.cgi?id=34536
1383
1384         * wtf/Platform.h:
1385
1386 2010-02-02  Oliver Hunt  <oliver@apple.com>
1387
1388         Reviewed by Geoffrey Garen.
1389
1390         Crash in CollectorBitmap::get at nbcolympics.com
1391         https://bugs.webkit.org/show_bug.cgi?id=34504
1392
1393         This was caused by the use of m_offset to determine the offset of
1394         a new property into the property storage.  This patch corrects
1395         the effected cases by incorporating the anonymous slot count. It
1396         also removes the duplicate copy of anonymous slot count from the
1397         property table as keeping this up to date merely increased the
1398         chance of a mismatch.  Finally I've added a large number of
1399         assertions in an attempt to prevent such a bug from happening
1400         again.
1401
1402         With the new assertions in place the existing anonymous slot tests
1403         all fail without the m_offset fixes.
1404
1405         * runtime/PropertyMapHashTable.h:
1406         * runtime/Structure.cpp:
1407         (JSC::Structure::materializePropertyMap):
1408         (JSC::Structure::addPropertyTransitionToExistingStructure):
1409         (JSC::Structure::addPropertyTransition):
1410         (JSC::Structure::removePropertyTransition):
1411         (JSC::Structure::flattenDictionaryStructure):
1412         (JSC::Structure::addPropertyWithoutTransition):
1413         (JSC::Structure::removePropertyWithoutTransition):
1414         (JSC::Structure::copyPropertyTable):
1415         (JSC::Structure::get):
1416         (JSC::Structure::put):
1417         (JSC::Structure::remove):
1418         (JSC::Structure::insertIntoPropertyMapHashTable):
1419         (JSC::Structure::createPropertyMapHashTable):
1420         (JSC::Structure::rehashPropertyMapHashTable):
1421         (JSC::Structure::checkConsistency):
1422
1423 2010-02-02  Steve Falkenburg  <sfalken@apple.com>
1424
1425         Reviewed by Darin Adler.
1426
1427         Copyright year updating for Windows version resources should be automatic
1428         https://bugs.webkit.org/show_bug.cgi?id=34503
1429
1430         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
1431
1432 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
1433
1434         Reviewed by Eric Seidel.
1435
1436         [BREWMP] Add dummy main thread functions
1437         https://bugs.webkit.org/show_bug.cgi?id=33569
1438
1439         Add dummy initializeMainThreadPlatform and
1440         scheduleDispatchFunctionsOnMainThread.
1441
1442         * wtf/brew/MainThreadBrew.cpp: Added.
1443         (WTF::initializeMainThreadPlatform):
1444         (WTF::scheduleDispatchFunctionsOnMainThread):
1445
1446 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
1447
1448         Reviewed by Darin Adler.
1449
1450         Add using WTF::getLocalTime to CurrentTime.h
1451         https://bugs.webkit.org/show_bug.cgi?id=34493
1452
1453         * wtf/CurrentTime.h:
1454
1455 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
1456
1457         Reviewed by Eric Seidel.
1458
1459         [BREWMP] Add HAVE_XXX definitions
1460         https://bugs.webkit.org/show_bug.cgi?id=34414
1461
1462         Add HAVE_ERRNO_H=1
1463
1464         * wtf/Platform.h:
1465
1466 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
1467
1468         Reviewed by Eric Seidel.
1469
1470         [BREWMP] Don't define HAVE_TM_GMTOFF, HAVE_TM_ZONE and HAVE_TIMEGM
1471         https://bugs.webkit.org/show_bug.cgi?id=34388
1472
1473         BREWMP does not have these features.
1474
1475         * wtf/Platform.h:
1476
1477 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
1478
1479         Reviewed by Eric Seidel.
1480
1481         [BREWMP] Define WTF_PLATFORM_BREWMP=1 when BUILDING_BREWMP is defined
1482         https://bugs.webkit.org/show_bug.cgi?id=34386
1483
1484         Define WTF_PLATFORM_BREWMP=1 so that PLATFORM(BREWMP) guard can be used.
1485
1486         * wtf/Platform.h:
1487
1488 2010-02-01  Kent Tamura  <tkent@chromium.org>
1489
1490         Reviewed by Darin Adler.
1491
1492         Date.UTC() should apply TimeClip operation.
1493         https://bugs.webkit.org/show_bug.cgi?id=34461
1494
1495         ECMAScript 5 15.9.4.3:
1496         > 9 Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
1497
1498         * runtime/DateConstructor.cpp:
1499         (JSC::dateUTC): Calls WTF::timeClip().
1500
1501 2010-02-01  Kent Tamura  <tkent@chromium.org>
1502
1503         Reviewed by Darin Adler.
1504
1505         Fix a bug that Math.round() retunrs incorrect results for huge integers
1506         https://bugs.webkit.org/show_bug.cgi?id=34462
1507
1508         * runtime/MathObject.cpp:
1509         (JSC::mathProtoFuncRound): Avoid "arg + 0.5".
1510
1511 2010-02-01  Kwang Yul Seo  <skyul@company100.net>
1512
1513         Reviewed by Eric Seidel.
1514
1515         [BREWMP] Port WTF's currentTime
1516         https://bugs.webkit.org/show_bug.cgi?id=33567
1517
1518         Combine GETUTCSECONDS and GETTIMEMS to calculate the number
1519         of milliseconds since 1970/01/01 00:00:00 UTC.
1520
1521         * wtf/CurrentTime.cpp:
1522         (WTF::currentTime):
1523
1524 2010-02-01  Patrick Gansterer  <paroga@paroga.com>
1525
1526         Reviewed by Darin Adler.
1527
1528         [Qt] WinCE buildfix after r52729 and fix for Q_BIG_ENDIAN typo.
1529         https://bugs.webkit.org/show_bug.cgi?id=34378
1530
1531         * wtf/Platform.h:
1532
1533 2010-02-01  Oliver Hunt  <oliver@apple.com>
1534
1535         Reviewed by Gavin Barraclough.
1536
1537         Structure not accounting for anonymous slots when computing property storage size
1538         https://bugs.webkit.org/show_bug.cgi?id=34441
1539
1540         Previously any Structure with anonymous storage would have a property map, so we
1541         were only including anonymous slot size if there was a property map.  Given this
1542         is no longer the case we should always include the anonymous slot count in the
1543         property storage size.
1544
1545         * runtime/Structure.h:
1546         (JSC::Structure::propertyStorageSize):
1547
1548 2010-02-01  Oliver Hunt  <oliver@apple.com>
1549
1550         Windows build fix, update exports file (again)
1551
1552         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1553
1554 2010-02-01  Oliver Hunt  <oliver@apple.com>
1555
1556         Windows build fix, update exports file
1557
1558         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1559
1560 2010-01-31  Oliver Hunt  <oliver@apple.com>
1561
1562         Reviewed by Maciej Stachowiak.
1563
1564         JSC is failing to propagate anonymous slot count on some transitions
1565         https://bugs.webkit.org/show_bug.cgi?id=34321
1566
1567         Remove secondary Structure constructor, and make Structure store a copy
1568         of the number of anonymous slots directly so saving an immediate allocation
1569         of a property map for all structures with anonymous storage, which also
1570         avoids the leaked property map on new property transition in the original
1571         version of this patch.
1572
1573         We need to propagate the the anonymous slot count otherwise we can end up
1574         with a structure recording incorrect information about the available and
1575         needed space for property storage, or alternatively incorrectly reusing
1576         some slots.
1577
1578         * JavaScriptCore.exp:
1579         * runtime/Structure.cpp:
1580         (JSC::Structure::Structure):
1581         (JSC::Structure::materializePropertyMap):
1582         (JSC::Structure::addPropertyTransition):
1583         (JSC::Structure::changePrototypeTransition):
1584         (JSC::Structure::despecifyFunctionTransition):
1585         (JSC::Structure::getterSetterTransition):
1586         (JSC::Structure::toDictionaryTransition):
1587         (JSC::Structure::flattenDictionaryStructure):
1588         (JSC::Structure::copyPropertyTable):
1589         (JSC::Structure::put):
1590         (JSC::Structure::remove):
1591         (JSC::Structure::insertIntoPropertyMapHashTable):
1592         (JSC::Structure::createPropertyMapHashTable):
1593         * runtime/Structure.h:
1594         (JSC::Structure::create):
1595         (JSC::Structure::hasAnonymousSlots):
1596         (JSC::Structure::anonymousSlotCount):
1597
1598 2010-01-31  Patrick Gansterer  <paroga@paroga.com>
1599
1600         Reviewed by Darin Adler.
1601
1602         Buildfix for WinCE + style fixes (TLS_OUT_OF_INDEXES is not defined).
1603         https://bugs.webkit.org/show_bug.cgi?id=34380
1604
1605         * wtf/ThreadSpecific.h:
1606
1607 2010-01-31  Kent Tamura  <tkent@chromium.org>
1608
1609         Reviewed by Darin Adler.
1610
1611         [Windows] Fix a bug of round() with huge integral numbers
1612         https://bugs.webkit.org/show_bug.cgi?id=34297
1613
1614         Fix a bug that round() for huge integral numbers returns incorrect
1615         results. For example, round(8639999913600001) returns
1616         8639999913600002 without this change though the double type can
1617         represent 8639999913600001 precisely.
1618
1619         Math.round() of JavaScript has a similar problem. But this change
1620         doesn't fix it because Math.round() doesn't use round() of
1621         MathExtra.h.
1622
1623         * wtf/MathExtras.h:
1624         (round): Avoid to do "num + 0.5" or "num - 0.5".
1625         (roundf): Fixed similarly.
1626         (llround): Calls round().
1627         (llroundf): Calls roundf().
1628         (lround): Calls round().
1629         (lroundf): Calls roundf().
1630
1631 2010-01-29  Mark Rowe  <mrowe@apple.com>
1632
1633         Sort Xcode projects.
1634
1635         * JavaScriptCore.xcodeproj/project.pbxproj:
1636
1637 2010-01-29  Mark Rowe  <mrowe@apple.com>
1638
1639         Fix the Mac build.
1640
1641         Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
1642
1643         As the comment in FeatureDefines.xcconfig notes, the list of feature defines
1644         needs to be kept in sync across the various files.  The default values also
1645         need to be kept in sync between these files and build-webkit.
1646
1647         * Configurations/FeatureDefines.xcconfig:
1648
1649 2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
1650
1651         Rubber-stamped by Maciej Stachowiak.
1652
1653         Fix the ARM build.
1654
1655         * runtime/JSNumberCell.h:
1656         (JSC::JSNumberCell::createStructure): Call the right Structure::create overload.
1657
1658 2010-01-28  Kevin Ollivier  <kevino@theolliviers.com>
1659
1660         [wx] Build fix for MSW, use ThreadingWin.cpp as the Windows pthreads implementation
1661         implements pthread_t in a way that makes it impossible to check its validity,
1662         which is needed by ThreadingPthreads.cpp.
1663
1664         * wscript:
1665
1666 2010-01-28  Oliver Hunt  <oliver@apple.com>
1667
1668         Reviewed by Gavin Barraclough.
1669
1670         DOM Objects shouldn't all require custom mark functions
1671         https://bugs.webkit.org/show_bug.cgi?id=34291
1672
1673         Make getAnonymousValue const-friendly
1674
1675         * runtime/JSObject.h:
1676         (JSC::JSObject::getAnonymousValue):
1677
1678 2010-01-28  Oliver Hunt  <oliver@apple.com>
1679
1680         Reviewed by Gavin Barraclough.
1681
1682         Simplify anonymous slot implementation
1683         https://bugs.webkit.org/show_bug.cgi?id=34282
1684
1685         A class must now specify the number of slots it needs at construction time
1686         rather than later on with a transition.  This makes many things simpler,
1687         we no longer need to need an additional transition on object creation to
1688         add the anonymous slots, and we remove the need for a number of transition
1689         type checks. 
1690
1691         * API/JSCallbackConstructor.h:
1692         (JSC::JSCallbackConstructor::createStructure):
1693         * API/JSCallbackFunction.h:
1694         (JSC::JSCallbackFunction::createStructure):
1695         * API/JSCallbackObject.h:
1696         (JSC::JSCallbackObject::createStructure):
1697         * JavaScriptCore.exp:
1698         * debugger/DebuggerActivation.h:
1699         (JSC::DebuggerActivation::createStructure):
1700         * runtime/Arguments.h:
1701         (JSC::Arguments::createStructure):
1702         * runtime/BooleanObject.h:
1703         (JSC::BooleanObject::createStructure):
1704         * runtime/DateInstance.h:
1705         (JSC::DateInstance::createStructure):
1706         * runtime/DatePrototype.h:
1707         (JSC::DatePrototype::createStructure):
1708         * runtime/FunctionPrototype.h:
1709         (JSC::FunctionPrototype::createStructure):
1710         * runtime/GetterSetter.h:
1711         (JSC::GetterSetter::createStructure):
1712         * runtime/GlobalEvalFunction.h:
1713         (JSC::GlobalEvalFunction::createStructure):
1714         * runtime/InternalFunction.h:
1715         (JSC::InternalFunction::createStructure):
1716         * runtime/JSAPIValueWrapper.h:
1717         (JSC::JSAPIValueWrapper::createStructure):
1718         * runtime/JSActivation.h:
1719         (JSC::JSActivation::createStructure):
1720         * runtime/JSArray.h:
1721         (JSC::JSArray::createStructure):
1722         * runtime/JSByteArray.cpp:
1723         (JSC::JSByteArray::createStructure):
1724         * runtime/JSCell.h:
1725         (JSC::JSCell::createDummyStructure):
1726         * runtime/JSFunction.h:
1727         (JSC::JSFunction::createStructure):
1728         * runtime/JSGlobalObject.h:
1729         (JSC::JSGlobalObject::createStructure):
1730         * runtime/JSNotAnObject.h:
1731         (JSC::JSNotAnObject::createStructure):
1732         * runtime/JSONObject.h:
1733         (JSC::JSONObject::createStructure):
1734         * runtime/JSObject.h:
1735         (JSC::JSObject::createStructure):
1736         (JSC::JSObject::putAnonymousValue):
1737         (JSC::JSObject::getAnonymousValue):
1738         * runtime/JSPropertyNameIterator.h:
1739         (JSC::JSPropertyNameIterator::createStructure):
1740         * runtime/JSStaticScopeObject.h:
1741         (JSC::JSStaticScopeObject::createStructure):
1742         * runtime/JSString.h:
1743         (JSC::Fiber::createStructure):
1744         * runtime/JSVariableObject.h:
1745         (JSC::JSVariableObject::createStructure):
1746         * runtime/JSWrapperObject.h:
1747         (JSC::JSWrapperObject::createStructure):
1748         (JSC::JSWrapperObject::JSWrapperObject):
1749         * runtime/MathObject.h:
1750         (JSC::MathObject::createStructure):
1751         * runtime/NumberConstructor.h:
1752         (JSC::NumberConstructor::createStructure):
1753         * runtime/NumberObject.h:
1754         (JSC::NumberObject::createStructure):
1755         * runtime/RegExpConstructor.h:
1756         (JSC::RegExpConstructor::createStructure):
1757         * runtime/RegExpObject.h:
1758         (JSC::RegExpObject::createStructure):
1759         * runtime/StringObject.h:
1760         (JSC::StringObject::createStructure):
1761         * runtime/StringObjectThatMasqueradesAsUndefined.h:
1762         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
1763         * runtime/Structure.cpp:
1764         (JSC::Structure::~Structure):
1765         (JSC::Structure::materializePropertyMap):
1766         * runtime/Structure.h:
1767         (JSC::Structure::create):
1768         (JSC::Structure::anonymousSlotCount):
1769         * runtime/StructureTransitionTable.h:
1770
1771 2010-01-27  Oliver Hunt  <oliver@apple.com>
1772
1773         Windows build fix.
1774
1775         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1776
1777 2010-01-27  Oliver Hunt  <oliver@apple.com>
1778
1779         Reviewed by Maciej Stachowiak.
1780
1781         MessageEvent.data should deserialize in the context of the MessageEvent's global object
1782         https://bugs.webkit.org/show_bug.cgi?id=34227
1783
1784         Add logic to allow us to create an Object, Array, or Date instance
1785         so we can create them in the context of a specific global object,
1786         rather than just using the current lexical global object.
1787
1788         * JavaScriptCore.exp:
1789         * runtime/DateInstance.cpp:
1790         (JSC::DateInstance::DateInstance):
1791         * runtime/DateInstance.h:
1792         * runtime/JSGlobalObject.h:
1793         (JSC::constructEmptyObject):
1794         (JSC::constructEmptyArray):
1795
1796 2010-01-27  Alexey Proskuryakov  <ap@apple.com>
1797
1798         Reviewed by Darin Adler.
1799
1800         https://bugs.webkit.org/show_bug.cgi?id=34150
1801         WebKit needs a mechanism to catch stale HashMap entries
1802
1803         It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash
1804         is just its value, it is very unlikely that any observable problem is reproducible.
1805
1806         This extends hash table consistency checks to check that pointers are referencing allocated
1807         memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible
1808         to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much).
1809
1810         * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can
1811         add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems
1812         with those yet.
1813
1814         * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by
1815         CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency().
1816
1817         * wtf/HashTable.h:
1818         (WTF::HashTable::internalCheckTableConsistency):
1819         (WTF::HashTable::internalCheckTableConsistencyExceptSize):
1820         (WTF::HashTable::checkTableConsistencyExceptSize):
1821         Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off.
1822         (WTF::::add): Updated for checkTableConsistency renaming.
1823         (WTF::::addPassingHashCode): Ditto.
1824         (WTF::::removeAndInvalidate): Ditto.
1825         (WTF::::remove): Ditto.
1826         (WTF::::rehash): Ditto.
1827         (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this
1828         function returns true for tables with m_table == 0.
1829         (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially,
1830         we could do the same for values.
1831
1832         * wtf/HashTraits.h:
1833         (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden
1834         to add checks. Currently, the only override is for pointer hashes.
1835
1836         * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming.
1837
1838 2010-01-27  Anton Muhin  <antonm@chromium.org>
1839
1840         Reviewed by Darin Adler.
1841
1842         Remove trailing \ from inline function code
1843         https://bugs.webkit.org/show_bug.cgi?id=34223
1844
1845         * assembler/ARMv7Assembler.h:
1846         (JSC::ARMThumbImmediate::countLeadingZerosPartial):
1847
1848 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
1849
1850         Reviewed by Eric Seidel.
1851
1852         [BREWMP] Port WTF's randomNumber
1853         https://bugs.webkit.org/show_bug.cgi?id=33566
1854
1855         Use GETRAND to generate 4 byte random byte sequence to implement
1856         weakRandomNumber. Create a secure random number generator with
1857         AEECLSID_RANDOM to implement randomNumber.
1858
1859         * wtf/RandomNumber.cpp:
1860         (WTF::weakRandomNumber):
1861         (WTF::randomNumber):
1862
1863 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
1864
1865         Reviewed by Eric Seidel.
1866
1867         [BREWMP] Port getCPUTime
1868         https://bugs.webkit.org/show_bug.cgi?id=33572
1869
1870         Use GETUPTIMEMS which returns a continuously and
1871         linearly increasing millisecond timer from the time the device
1872         was powered on. This function is enough to implement getCPUTime.
1873
1874         * runtime/TimeoutChecker.cpp:
1875         (JSC::getCPUTime):
1876
1877 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
1878
1879         Reviewed by Oliver Hunt.
1880
1881         [BREWMP] Add MarkStack fastMalloc implementation for platforms without VirtualAlloc or mmap.
1882         https://bugs.webkit.org/show_bug.cgi?id=33582
1883
1884         Use fastMalloc and fastFree to implement MarkStack::allocateStack and
1885         MarkStack::releaseStack for platforms without page level allocation.
1886
1887         * runtime/MarkStack.h:
1888         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
1889         * runtime/MarkStackNone.cpp: Added.
1890         (JSC::MarkStack::initializePagesize):
1891         (JSC::MarkStack::allocateStack):
1892         (JSC::MarkStack::releaseStack):
1893
1894 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
1895
1896         Reviewed by Eric Seidel.
1897
1898         [BREWMP] Don't use time function
1899         https://bugs.webkit.org/show_bug.cgi?id=33577
1900
1901         Calling time(0) in BREW devices causes a crash because time
1902         is not properly ported in most devices. Cast currentTime() to
1903         time_t to get the same result as time(0).
1904
1905         * wtf/DateMath.cpp:
1906         (WTF::calculateUTCOffset):
1907
1908 2010-01-27  Alexey Proskuryakov  <ap@apple.com>
1909
1910         Revert r53899 (HashMap<AtomicStringImpl*, Value> key checks) and subsequent build fixes,
1911         because they make SVG tests crash in release builds.
1912
1913         * wtf/HashMap.h:
1914         (WTF::::remove):
1915         * wtf/HashSet.h:
1916         (WTF::::remove):
1917         * wtf/HashTable.h:
1918         (WTF::::add):
1919         (WTF::::addPassingHashCode):
1920         (WTF::::removeAndInvalidate):
1921         (WTF::::remove):
1922         (WTF::::rehash):
1923         (WTF::::checkTableConsistency):
1924         (WTF::::checkTableConsistencyExceptSize):
1925         * wtf/HashTraits.h:
1926         (WTF::GenericHashTraits::emptyValue):
1927         (WTF::):
1928         * wtf/RefPtrHashMap.h:
1929         (WTF::::remove):
1930
1931 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
1932
1933         More Windows build fixing.
1934
1935         * wtf/HashTraits.h: _msize takes void*, remove const qualifier from type.
1936
1937 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
1938
1939         Windows build fix.
1940
1941         * wtf/HashTraits.h: Include malloc.h for _msize().
1942
1943 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
1944
1945         Build fix.
1946
1947         * wtf/HashTable.h: (WTF::HashTable::checkTableConsistencyExceptSize): Remove const from a
1948         static (empty) version of this function.
1949
1950 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
1951
1952         Reviewed by Darin Adler.
1953
1954         https://bugs.webkit.org/show_bug.cgi?id=34150
1955         WebKit needs a mechanism to catch stale HashMap entries
1956
1957         It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash
1958         is just its value, it is very unlikely that any observable problem is reproducible.
1959
1960         This extends hash table consistency checks to check that pointers are referencing allocated
1961         memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible
1962         to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much).
1963
1964         * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can
1965         add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems
1966         with those yet.
1967
1968         * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by
1969         CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency().
1970
1971         * wtf/HashTable.h:
1972         (WTF::HashTable::internalCheckTableConsistency):
1973         (WTF::HashTable::internalCheckTableConsistencyExceptSize):
1974         (WTF::HashTable::checkTableConsistencyExceptSize):
1975         Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off.
1976         (WTF::::add): Updated for checkTableConsistency renaming.
1977         (WTF::::addPassingHashCode): Ditto.
1978         (WTF::::removeAndInvalidate): Ditto.
1979         (WTF::::remove): Ditto.
1980         (WTF::::rehash): Ditto.
1981         (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this
1982         function returns true for tables with m_table == 0.
1983         (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially,
1984         we could do the same for values.
1985
1986         * wtf/HashTraits.h:
1987         (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden
1988         to add checks. Currently, the only override is for pointer hashes.
1989
1990         * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming.
1991
1992 2010-01-26  Lyon Chen  <liachen@rim.com>
1993
1994         Reviewed by Maciej Stachowiak.
1995
1996         Opcode.h use const void* for Opcode cause error #1211 for RVCT compiler
1997         https://bugs.webkit.org/show_bug.cgi?id=33902
1998
1999         * bytecode/Opcode.h:
2000
2001 2010-01-26  Steve Falkenburg  <sfalken@apple.com>
2002
2003         Reviewed by Oliver Hunt.
2004
2005         Windows build references non-existent include paths
2006         https://bugs.webkit.org/show_bug.cgi?id=34175
2007
2008         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2009         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2010         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
2011         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
2012         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2013         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
2014
2015 2010-01-26  Oliver Hunt  <oliver@apple.com>
2016
2017         Reviewed by Geoffrey Garen.
2018
2019         Using JavaScriptCore API with a webkit vended context can result in slow script dialog
2020         https://bugs.webkit.org/show_bug.cgi?id=34172
2021
2022         Make the APIShim correctly increment and decrement the timeout
2023         entry counter.
2024
2025         * API/APIShims.h:
2026         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
2027         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
2028         (JSC::APICallbackShim::APICallbackShim):
2029         (JSC::APICallbackShim::~APICallbackShim):
2030
2031 2010-01-26  Simon Hausmann  <simon.hausmann@nokia.com>
2032
2033         [Qt] Fix compilation of QtScript with non-gcc compilers
2034
2035         Variable length stack arrays are a gcc extension. Use QVarLengthArray
2036         as a more portable solution that still tries to allocate on the stack
2037         first.
2038
2039         * qt/api/qscriptvalue_p.h:
2040         (QScriptValuePrivate::call):
2041
2042 2010-01-26  Simon Hausmann  <simon.hausmann@nokia.com>
2043
2044         Reviewed by Tor Arne Vestbø.
2045
2046         [Qt] Fix the build on platforms without JIT support.
2047
2048         The JIT support should be determined at compile-time via wtf/Platform.h
2049
2050         * qt/api/QtScript.pro:
2051
2052 2010-01-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2053
2054         Reviewed by Simon Hausmann.
2055
2056         First steps of the QtScript API.
2057         
2058         Two new classes were created; QScriptEngine and QScriptValue.
2059         The first should encapsulate a javascript context and the second a script
2060         value.
2061         
2062         This API is still in development, so it isn't compiled by default.
2063         To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to
2064         build-webkit.
2065
2066         https://bugs.webkit.org/show_bug.cgi?id=32565
2067
2068         * qt/api/QtScript.pro: Added.
2069         * qt/api/qscriptconverter_p.h: Added.
2070         (QScriptConverter::toString):
2071         * qt/api/qscriptengine.cpp: Added.
2072         (QScriptEngine::QScriptEngine):
2073         (QScriptEngine::~QScriptEngine):
2074         (QScriptEngine::evaluate):
2075         (QScriptEngine::collectGarbage):
2076         * qt/api/qscriptengine.h: Added.
2077         * qt/api/qscriptengine_p.cpp: Added.
2078         (QScriptEnginePrivate::QScriptEnginePrivate):
2079         (QScriptEnginePrivate::~QScriptEnginePrivate):
2080         (QScriptEnginePrivate::evaluate):
2081         * qt/api/qscriptengine_p.h: Added.
2082         (QScriptEnginePrivate::get):
2083         (QScriptEnginePrivate::collectGarbage):
2084         (QScriptEnginePrivate::makeJSValue):
2085         (QScriptEnginePrivate::context):
2086         * qt/api/qscriptvalue.cpp: Added.
2087         (QScriptValue::QScriptValue):
2088         (QScriptValue::~QScriptValue):
2089         (QScriptValue::isValid):
2090         (QScriptValue::isBool):
2091         (QScriptValue::isBoolean):
2092         (QScriptValue::isNumber):
2093         (QScriptValue::isNull):
2094         (QScriptValue::isString):
2095         (QScriptValue::isUndefined):
2096         (QScriptValue::isError):
2097         (QScriptValue::isObject):
2098         (QScriptValue::isFunction):
2099         (QScriptValue::toString):
2100         (QScriptValue::toNumber):
2101         (QScriptValue::toBool):
2102         (QScriptValue::toBoolean):
2103         (QScriptValue::toInteger):
2104         (QScriptValue::toInt32):
2105         (QScriptValue::toUInt32):
2106         (QScriptValue::toUInt16):
2107         (QScriptValue::call):
2108         (QScriptValue::engine):
2109         (QScriptValue::operator=):
2110         (QScriptValue::equals):
2111         (QScriptValue::strictlyEquals):
2112         * qt/api/qscriptvalue.h: Added.
2113         (QScriptValue::):
2114         * qt/api/qscriptvalue_p.h: Added.
2115         (QScriptValuePrivate::):
2116         (QScriptValuePrivate::get):
2117         (QScriptValuePrivate::QScriptValuePrivate):
2118         (QScriptValuePrivate::isValid):
2119         (QScriptValuePrivate::isBool):
2120         (QScriptValuePrivate::isNumber):
2121         (QScriptValuePrivate::isNull):
2122         (QScriptValuePrivate::isString):
2123         (QScriptValuePrivate::isUndefined):
2124         (QScriptValuePrivate::isError):
2125         (QScriptValuePrivate::isObject):
2126         (QScriptValuePrivate::isFunction):
2127         (QScriptValuePrivate::toString):
2128         (QScriptValuePrivate::toNumber):
2129         (QScriptValuePrivate::toBool):
2130         (QScriptValuePrivate::toInteger):
2131         (QScriptValuePrivate::toInt32):
2132         (QScriptValuePrivate::toUInt32):
2133         (QScriptValuePrivate::toUInt16):
2134         (QScriptValuePrivate::equals):
2135         (QScriptValuePrivate::strictlyEquals):
2136         (QScriptValuePrivate::assignEngine):
2137         (QScriptValuePrivate::call):
2138         (QScriptValuePrivate::engine):
2139         (QScriptValuePrivate::context):
2140         (QScriptValuePrivate::value):
2141         (QScriptValuePrivate::object):
2142         (QScriptValuePrivate::inherits):
2143         (QScriptValuePrivate::isJSBased):
2144         (QScriptValuePrivate::isNumberBased):
2145         (QScriptValuePrivate::isStringBased):
2146         * qt/api/qtscriptglobal.h: Added.
2147         * qt/tests/qscriptengine/qscriptengine.pro: Added.
2148         * qt/tests/qscriptengine/tst_qscriptengine.cpp: Added.
2149         (tst_QScriptEngine::tst_QScriptEngine):
2150         (tst_QScriptEngine::~tst_QScriptEngine):
2151         (tst_QScriptEngine::init):
2152         (tst_QScriptEngine::cleanup):
2153         (tst_QScriptEngine::collectGarbage):
2154         (tst_QScriptEngine::evaluate):
2155         * qt/tests/qscriptvalue/qscriptvalue.pro: Added.
2156         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp: Added.
2157         (tst_QScriptValue::tst_QScriptValue):
2158         (tst_QScriptValue::~tst_QScriptValue):
2159         (tst_QScriptValue::init):
2160         (tst_QScriptValue::cleanup):
2161         (tst_QScriptValue::ctor):
2162         (tst_QScriptValue::toString_data):
2163         (tst_QScriptValue::toString):
2164         (tst_QScriptValue::copyConstructor_data):
2165         (tst_QScriptValue::copyConstructor):
2166         (tst_QScriptValue::assignOperator_data):
2167         (tst_QScriptValue::assignOperator):
2168         (tst_QScriptValue::dataSharing):
2169         (tst_QScriptValue::constructors_data):
2170         (tst_QScriptValue::constructors):
2171         (tst_QScriptValue::call):
2172         * qt/tests/tests.pri: Added.
2173         * qt/tests/tests.pro: Added.
2174
2175 2010-01-25  Dmitry Titov  <dimich@chromium.org>
2176
2177         Reviewed by David Levin.
2178
2179         Fix Chromium Linux tests: the pthread functions on Linux produce segfault if they receive 0 thread handle.
2180         After r53714, we can have 0 thread handles passed to pthread_join and pthread_detach if corresponding threads
2181         were already terminated and their threadMap entries cleared.
2182         Add a 0 check.
2183
2184         * wtf/ThreadingPthreads.cpp:
2185         (WTF::waitForThreadCompletion):
2186         (WTF::detachThread):
2187
2188 2010-01-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2189
2190         Reviewed by Maciej Stachowiak.
2191
2192         Refactor JITStubs.cpp so that DEFINE_STUB_FUNCTION is only used once for each function
2193         https://bugs.webkit.org/show_bug.cgi?id=33866
2194
2195         Place the guard USE(JSVALUE32_64) inside the body of the DEFINE_STUB_FUNCTION
2196         macro for those functions that are always present.
2197
2198         * jit/JITStubs.cpp:
2199         (JSC::DEFINE_STUB_FUNCTION):
2200
2201 2010-01-22  Kevin Watters  <kevinwatters@gmail.com>
2202
2203         Reviewed by Kevin Ollivier.
2204
2205         [wx] Remove the Bakefile build system, which is no longer being used.
2206         
2207         https://bugs.webkit.org/show_bug.cgi?id=34022
2208
2209         * JavaScriptCoreSources.bkl: Removed.
2210         * jscore.bkl: Removed.
2211
2212 2010-01-22  Steve Falkenburg  <sfalken@apple.com>
2213
2214         Reviewed by Darin Adler.
2215
2216         https://bugs.webkit.org/show_bug.cgi?id=34025
2217         Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets.
2218
2219         * Configurations/FeatureDefines.xcconfig:
2220
2221 2010-01-22  Dmitry Titov  <dimich@chromium.org>
2222
2223         Not reviewed, attempted Snow Leopard build fix.
2224
2225         * wtf/ThreadingPthreads.cpp: Add a forward declaration of a function which is not 'static'.
2226
2227 2009-01-22  Dmitry Titov  <dimich@chromium.org>
2228
2229         Reviewed by Maciej Stachowiak.
2230
2231         Fix the leak of ThreadIdentifiers in threadMap across threads.
2232         https://bugs.webkit.org/show_bug.cgi?id=32689
2233
2234         Test is added to DumpRenderTree.mm.
2235
2236         * Android.mk: Added file ThreadIdentifierDataPthreads.(h|cpp) to build.
2237         * Android.v8.wtf.mk: Ditto.
2238         * GNUmakefile.am: Ditto.
2239         * JavaScriptCore.gyp/JavaScriptCore.gyp: Ditto.
2240         * JavaScriptCore.gypi: Ditto.
2241         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
2242
2243         * wtf/ThreadIdentifierDataPthreads.cpp: Added. Contains custom implementation of thread-specific data that uses custom destructor.
2244         (WTF::ThreadIdentifierData::~ThreadIdentifierData): Removes the ThreadIdentifier from the threadMap.
2245         (WTF::ThreadIdentifierData::identifier):
2246         (WTF::ThreadIdentifierData::initialize):
2247         (WTF::ThreadIdentifierData::destruct): Custom thread-specific destructor. Resets the value for the key again to cause second invoke.
2248         (WTF::ThreadIdentifierData::initializeKeyOnceHelper):
2249         (WTF::ThreadIdentifierData::initializeKeyOnce): Need to use pthread_once since initialization may come on any thread(s).
2250         * wtf/ThreadIdentifierDataPthreads.h: Added.
2251         (WTF::ThreadIdentifierData::ThreadIdentifierData):
2252
2253         * wtf/Threading.cpp:
2254         (WTF::threadEntryPoint): Move initializeCurrentThreadInternal to after the lock to make
2255                                  sure it is invoked when ThreadIdentifier is already established.
2256
2257         * wtf/Threading.h: Rename setThreadNameInternal -> initializeCurrentThreadInternal since it does more then only set the name now.
2258         * wtf/ThreadingNone.cpp:
2259         (WTF::initializeCurrentThreadInternal): Ditto.
2260         * wtf/ThreadingWin.cpp:
2261         (WTF::initializeCurrentThreadInternal): Ditto.
2262         (WTF::initializeThreading): Ditto.
2263         * wtf/gtk/ThreadingGtk.cpp:
2264         (WTF::initializeCurrentThreadInternal): Ditto.
2265         * wtf/qt/ThreadingQt.cpp:
2266         (WTF::initializeCurrentThreadInternal): Ditto.
2267
2268         * wtf/ThreadingPthreads.cpp:
2269         (WTF::establishIdentifierForPthreadHandle):
2270         (WTF::clearPthreadHandleForIdentifier): Make it not 'static' so the ~ThreadIdentifierData() in another file can call it.
2271         (WTF::initializeCurrentThreadInternal): Set the thread-specific data. The ThreadIdentifier is already established by creating thread.
2272         (WTF::waitForThreadCompletion): Remove call to clearPthreadHandleForIdentifier(threadID) since it is now done in ~ThreadIdentifierData().
2273         (WTF::detachThread): Ditto.
2274         (WTF::currentThread): Use the thread-specific data to get the ThreadIdentifier. It's many times faster then Mutex-protected iteration through the map.
2275                               Also, set the thread-specific data if called first time on the thread.
2276
2277 2010-01-21  Kwang Yul Seo  <skyul@company100.net>
2278
2279         Reviewed by Alexey Proskuryakov.
2280
2281         Add ThreadSpecific for ENABLE(SINGLE_THREADED)
2282         https://bugs.webkit.org/show_bug.cgi?id=33878
2283
2284         Implement ThreadSpecific with a simple getter/setter
2285         when ENABLE(SINGLE_THREADED) is true.
2286
2287         Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236,
2288         an implementation of ThreadSpecific must be available to build WebKit.
2289         This causes a build failure for platforms without a proper
2290         ThreadSpecific implementation.
2291
2292         * wtf/ThreadSpecific.h:
2293         (WTF::::ThreadSpecific):
2294         (WTF::::~ThreadSpecific):
2295         (WTF::::get):
2296         (WTF::::set):
2297         (WTF::::destroy):
2298
2299 2010-01-21  Kwang Yul Seo  <skyul@company100.net>
2300
2301         Reviewed by Maciej Stachowiak.
2302
2303         Add fastStrDup to FastMalloc
2304         https://bugs.webkit.org/show_bug.cgi?id=33937
2305
2306         The new string returned by fastStrDup is obtained with fastMalloc,
2307         and can be freed with fastFree. This makes the memory management 
2308         more consistent because we don't need to keep strdup allocated pointers
2309         and free them with free(). Instead we can use fastFree everywhere.
2310
2311         * wtf/FastMalloc.cpp:
2312         (WTF::fastStrDup):
2313         * wtf/FastMalloc.h:
2314
2315 2010-01-21  Brady Eidson  <beidson@apple.com>
2316
2317         Reviewed by Maciej Stachowiak.
2318
2319         history.back() for same-document history traversals isn't synchronous as the specification states.
2320         <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
2321
2322         * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium.
2323
2324 2010-01-21  Geoffrey Garen  <ggaren@apple.com>
2325
2326         Reviewed by Oliver Hunt.
2327
2328         Always create a prototype for automatically managed classes.
2329         
2330         This fixes some errors where prototype chains were not correctly hooked
2331         up, and also ensures that API classes work correctly with features like
2332         instanceof.
2333
2334         * API/JSClassRef.cpp:
2335         (OpaqueJSClass::create): Cleaned up some of this code. Also changed it
2336         to always create a prototype class.
2337
2338         * API/tests/testapi.c:
2339         (Derived2_class):
2340         (main): Fixed a null value crash in the exception checking code.
2341         * API/tests/testapi.js: Added some tests for the case where a prototype
2342         chain would not be hooked up correctly.
2343
2344 2010-01-21  Oliver Hunt  <oliver@apple.com>
2345
2346         Reviewed by Geoff Garen.
2347
2348         Force JSC to create a prototype chain for API classes with a
2349         parent class but no static functions.
2350
2351         * API/JSClassRef.cpp:
2352         (OpaqueJSClass::create):
2353
2354 2010-01-21  Kent Hansen  <kent.hansen@nokia.com>
2355
2356         Reviewed by Geoffrey Garen.
2357
2358         Object.getOwnPropertyDescriptor always returns undefined for JS API objects
2359         https://bugs.webkit.org/show_bug.cgi?id=33946
2360
2361         Ideally the getOwnPropertyDescriptor() reimplementation should return an
2362         access descriptor that wraps the property getter and setter callbacks, but
2363         that approach is much more involved than returning a value descriptor.
2364         Keep it simple for now.
2365
2366         * API/JSCallbackObject.h:
2367         * API/JSCallbackObjectFunctions.h:
2368         (JSC::::getOwnPropertyDescriptor):
2369         * API/tests/testapi.js:
2370
2371 2010-01-20  Mark Rowe  <mrowe@apple.com>
2372
2373         Build fix.
2374
2375         * wtf/FastMalloc.cpp:
2376         (WTF::TCMalloc_PageHeap::initializeScavenger): Remove unnecessary function call.
2377
2378 2010-01-20  Mark Rowe  <mrowe@apple.com>
2379
2380         Reviewed by Oliver Hunt.
2381
2382         Use the inline i386 assembly for x86_64 as well rather than falling back to using pthread mutexes.
2383
2384         * wtf/TCSpinLock.h:
2385         (TCMalloc_SpinLock::Lock):
2386         (TCMalloc_SpinLock::Unlock):
2387         (TCMalloc_SlowLock):
2388
2389 2010-01-20  Mark Rowe  <mrowe@apple.com>
2390
2391         Reviewed by Oliver Hunt.
2392
2393         <rdar://problem/7215063> Use GCD instead of an extra thread for FastMalloc scavenging on platforms where it is supported
2394
2395         Abstract the background scavenging slightly so that an alternate implementation that uses GCD can be used on platforms
2396         where it is supported.
2397
2398         * wtf/FastMalloc.cpp:
2399         (WTF::TCMalloc_PageHeap::init):
2400         (WTF::TCMalloc_PageHeap::initializeScavenger):
2401         (WTF::TCMalloc_PageHeap::signalScavenger):
2402         (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
2403         (WTF::TCMalloc_PageHeap::Delete):
2404         (WTF::TCMalloc_PageHeap::periodicScavenge):
2405         * wtf/Platform.h:
2406
2407 2010-01-20  Geoffrey Garen  <ggaren@apple.com>
2408
2409         Reviewed by Oliver Hunt.
2410
2411         <rdar://problem/7562708> REGRESSION(53460): Heap::destroy may not run
2412         all destructors
2413
2414         * runtime/Collector.cpp:
2415         (JSC::Heap::freeBlocks): Instead of fully marking protected objects,
2416         just set their mark bits. This prevents protected objects from keeping
2417         unprotected objects alive. Destructor order is not guaranteed, so it's
2418         OK to destroy objects pointed to by protected objects before destroying
2419         protected objects.
2420
2421 2010-01-19  David Levin  <levin@chromium.org>
2422
2423         Reviewed by Oliver Hunt.
2424
2425         CrossThreadCopier needs to support ThreadSafeShared better.
2426         https://bugs.webkit.org/show_bug.cgi?id=33698
2427
2428         * wtf/TypeTraits.cpp: Added tests for the new type traits.
2429         * wtf/TypeTraits.h:
2430         (WTF::IsSubclass): Determines if a class is a derived from another class.
2431         (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a
2432         template class (with one parameter that is unknown).
2433         (WTF::RemoveTemplate): Reveals the type for a template parameter.
2434
2435 2010-01-20  Steve Falkenburg  <sfalken@apple.com>
2436
2437         Reviewed by Darin Adler and Adam Roben.
2438
2439         Feature defines are difficult to maintain on Windows builds
2440         https://bugs.webkit.org/show_bug.cgi?id=33883
2441
2442         FeatureDefines.vsprops are now maintained in a way similar to
2443         Configurations/FeatureDefines.xcconfig, with the added advantage
2444         of having a single FeatureDefines file across all projects.
2445
2446         * Configurations/FeatureDefines.xcconfig: Add comments about keeping feature definitions in sync.
2447         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add FeatureDefines.vsprops inherited property sheet.
2448         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add FeatureDefines.vsprops inherited property sheet.
2449
2450 2010-01-20  Csaba Osztrogonác  <ossy@webkit.org>
2451
2452         [Qt] Unreviewed buildfix for r53547.
2453
2454         * DerivedSources.pro:
2455
2456 2010-01-20  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2457
2458         Reviewed by Simon Hausmann.
2459
2460         [Qt] Make extraCompilers for generated sources depend on their scripts
2461
2462         * DerivedSources.pro:
2463
2464 2010-01-19  Brian Weinstein  <bweinstein@apple.com>
2465
2466         Reviewed by Tim Hatcher.
2467
2468         When JavaScriptCore calls Debugger::Exception, have it pass a
2469         hasHandler variable that represents if exception is being handled
2470         in the same function (not in a parent on the call stack).
2471         
2472         This just adds a new parameter, no behavior is changed.
2473
2474         * debugger/Debugger.h:
2475         * interpreter/Interpreter.cpp:
2476         (JSC::Interpreter::throwException):
2477
2478 2010-01-18  Maciej Stachowiak  <mjs@apple.com>
2479
2480         Reviewed by Adam Barth.
2481
2482         Inline functions that are hot in DOM manipulation
2483         https://bugs.webkit.org/show_bug.cgi?id=33820
2484         
2485         (3% speedup on Dromaeo DOM Core tests)
2486
2487         * runtime/WeakGCMap.h:
2488         (JSC::::get): inline
2489
2490 2010-01-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2491
2492         Unreviewed build fix for JIT with RVCT.
2493
2494         Remove IMPORT statement; cti_vm_throw is already defined in JITStubs.h.
2495         Remove extra ')'.
2496
2497         * jit/JITStubs.cpp:
2498         (JSC::ctiVMThrowTrampoline):
2499
2500 2010-01-19  Geoffrey Garen  <ggaren@apple.com>
2501
2502         Reviewed by Oliver Hunt.
2503
2504         REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/
2505         https://bugs.webkit.org/show_bug.cgi?id=33826
2506
2507         This bug was caused by a GC-protected object being destroyed early by
2508         Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers
2509         to GC-protected memory to be valid.
2510
2511         The solution is to do two passes of tear-down in Heap::destroy. The first
2512         pass tears down all unprotected objects. The second pass ASSERTs that all
2513         previously protected objects are now unprotected, and then tears down
2514         all perviously protected objects. These two passes simulate the two passes
2515         that would have been required to free a protected object during normal GC.
2516         
2517         * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap.
2518
2519         * runtime/Collector.cpp:
2520         (JSC::Heap::destroy): Moved ASSERTs to here.
2521         (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its
2522         setter to the function that does the shrinking.
2523         (JSC::Heap::freeBlocks): Implemented above algorithm.
2524         (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink.
2525
2526 2010-01-19  Gavin Barraclough  <barraclough@apple.com>
2527
2528         Reviewed by NOBODY (build fix).
2529
2530         Reverting r53455, breaks 2 javascriptcore tests.
2531
2532         * API/JSContextRef.cpp:
2533         * runtime/Collector.cpp:
2534         (JSC::Heap::destroy):
2535         (JSC::Heap::freeBlock):
2536         (JSC::Heap::freeBlocks):
2537         (JSC::Heap::shrinkBlocks):
2538
2539 2010-01-18  Gavin Barraclough  <barraclough@apple.com>
2540
2541         Reviewed by NOBODY (build fix).
2542
2543         Revert r53454, since it causes much sadness in this world.
2544
2545         * runtime/UString.cpp:
2546         (JSC::UString::spliceSubstringsWithSeparators):
2547         (JSC::UString::replaceRange):
2548         * runtime/UStringImpl.cpp:
2549         (JSC::UStringImpl::baseSharedBuffer):
2550         (JSC::UStringImpl::sharedBuffer):
2551         (JSC::UStringImpl::~UStringImpl):
2552         * runtime/UStringImpl.h:
2553         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
2554         (JSC::UntypedPtrAndBitfield::asPtr):
2555         (JSC::UntypedPtrAndBitfield::operator&=):
2556         (JSC::UntypedPtrAndBitfield::operator|=):
2557         (JSC::UntypedPtrAndBitfield::operator&):
2558         (JSC::UStringImpl::create):
2559         (JSC::UStringImpl::cost):
2560         (JSC::UStringImpl::isIdentifier):
2561         (JSC::UStringImpl::setIsIdentifier):
2562         (JSC::UStringImpl::ref):
2563         (JSC::UStringImpl::deref):
2564         (JSC::UStringImpl::checkConsistency):
2565         (JSC::UStringImpl::UStringImpl):
2566         (JSC::UStringImpl::bufferOwnerString):
2567         (JSC::UStringImpl::bufferOwnership):
2568         (JSC::UStringImpl::isStatic):
2569         * wtf/StringHashFunctions.h:
2570         (WTF::stringHash):
2571
2572 2010-01-18  Geoffrey Garen  <ggaren@apple.com>
2573
2574         Reviewed by Oliver Hunt.
2575
2576         REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/
2577         https://bugs.webkit.org/show_bug.cgi?id=33826
2578
2579         This bug was caused by a GC-protected object being destroyed early by
2580         Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers
2581         to GC-protected memory to be valid.
2582
2583         The solution is to do two passes of tear-down in Heap::destroy. The first
2584         pass tears down all unprotected objects. The second pass ASSERTs that all
2585         previously protected objects are now unprotected, and then tears down
2586         all perviously protected objects. These two passes simulate the two passes
2587         that would have been required to free a protected object during normal GC.
2588         
2589         * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap.
2590
2591         * runtime/Collector.cpp:
2592         (JSC::Heap::destroy): Moved ASSERTs to here.
2593         (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its
2594         setter to the function that does the shrinking.
2595         (JSC::Heap::freeBlocks): Implemented above algorithm.
2596         (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink.
2597
2598 2010-01-18  Gavin Barraclough  <barraclough@apple.com>
2599
2600         Reviewed by Oliver Hunt.
2601
2602         https://bugs.webkit.org/show_bug.cgi?id=33731
2603         Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags).
2604
2605         This break the OS X Leaks tool.  Instead, free up some more bits from the refCount.
2606
2607         * runtime/UStringImpl.cpp:
2608         (JSC::UStringImpl::sharedBuffer):
2609         (JSC::UStringImpl::~UStringImpl):
2610         * runtime/UStringImpl.h:
2611         (JSC::UStringImpl::cost):
2612         (JSC::UStringImpl::checkConsistency):
2613         (JSC::UStringImpl::UStringImpl):
2614         (JSC::UStringImpl::bufferOwnerString):
2615         (JSC::UStringImpl::):
2616         * wtf/StringHashFunctions.h:
2617         (WTF::stringHash):
2618
2619 2010-01-18  Kent Tamura  <tkent@chromium.org>
2620
2621         Reviewed by Darin Adler.
2622
2623         HTMLInputElement::valueAsDate setter support for type=month.
2624         https://bugs.webkit.org/show_bug.cgi?id=33021
2625
2626         Expose the following functions to be used by WebCore:
2627          - WTF::msToyear()
2628          - WTF::dayInYear()
2629          - WTF::monthFromDayInYear()
2630          - WTF::dayInMonthFromDayInYear()
2631
2632         * JavaScriptCore.exp:
2633         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2634         * wtf/DateMath.cpp:
2635         (WTF::msToYear): Remove "static inline".
2636         (WTF::dayInYear): Remove "static inline".
2637         (WTF::monthFromDayInYear): Remove "static inline".
2638         (WTF::dayInMonthFromDayInYear): Remove "static inline".
2639         * wtf/DateMath.h: Declare the above functions.
2640
2641 2010-01-18  Darin Adler  <darin@apple.com>
2642
2643         Fix build by reverting the previous change.
2644
2645         * runtime/UString.h: Rolled out the FastAllocBase base class.
2646         It was making UString larger, and therefore JSString larger,
2647         and too big for a garbage collection cell.
2648
2649         This raises the unpleasant possibility that many classes became
2650         larger because we added the FastAllocBase base class. I am
2651         worried about this, and it needs to be investigated.
2652
2653 2010-01-18  Zoltan Horvath  <zoltan@webkit.org>
2654
2655         Reviewed by Darin Adler.
2656
2657         Allow custom memory allocation control for UString class
2658         https://bugs.webkit.org/show_bug.cgi?id=27831
2659
2660         Inherits the following class from FastAllocBase because it is
2661         instantiated by 'new' and no need to be copyable:
2662
2663         class name     - instantiated at:
2664         classs UString - JavaScriptCore/runtime/UString.cpp:160
2665
2666         * runtime/UString.h:
2667
2668 2010-01-18  Evan Cheng  <evan.cheng@apple.com>
2669
2670         Reviewed by Darin Adler.
2671
2672         Add some ALWAYS_INLINE for key functions not inlined by some versions of GCC.
2673         rdar://problem/7553780
2674
2675         * runtime/JSObject.h:
2676         (JSC::JSObject::getPropertySlot): ALWAYS_INLINE both overloads.
2677         * runtime/JSString.h:
2678         (JSC::JSString::JSString): ALWAYS_INLINE the version that takes a UString.
2679         * runtime/UString.h:
2680         (JSC::operator==): ALWAYS_INLINE the version that compares two UString objects.
2681
2682 2010-01-18  Csaba Osztrogonác  <ossy@webkit.org>
2683
2684         Reviewed by Darin Adler.
2685
2686         Delete dftables-xxxxxxxx.in files automatically.
2687         https://bugs.webkit.org/show_bug.cgi?id=33796
2688
2689         * pcre/dftables: unlink unnecessary temporary file.
2690
2691 2010-01-18  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2692
2693         Reviewed by Simon Hausmann.
2694
2695         [Qt] Force qmake to generate a single makefile for DerivedSources.pro
2696
2697         * DerivedSources.pro:
2698
2699 2010-01-18  Csaba Osztrogonác  <ossy@webkit.org>
2700
2701         Rubber-stamped by Gustavo Noronha Silva.
2702
2703         Rolling out r53391 and r53392 because of random crashes on buildbots.
2704         https://bugs.webkit.org/show_bug.cgi?id=33731
2705
2706         * bytecode/CodeBlock.h:
2707         (JSC::CallLinkInfo::seenOnce):
2708         (JSC::CallLinkInfo::setSeen):
2709         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
2710         (JSC::MethodCallLinkInfo::seenOnce):
2711         (JSC::MethodCallLinkInfo::setSeen):
2712         * jit/JIT.cpp:
2713         (JSC::JIT::unlinkCall):
2714         * jit/JITPropertyAccess.cpp:
2715         (JSC::JIT::patchMethodCallProto):
2716         * runtime/UString.cpp:
2717         (JSC::UString::spliceSubstringsWithSeparators):
2718         (JSC::UString::replaceRange):
2719         * runtime/UString.h:
2720         * runtime/UStringImpl.cpp:
2721         (JSC::UStringImpl::baseSharedBuffer):
2722         (JSC::UStringImpl::sharedBuffer):
2723         (JSC::UStringImpl::~UStringImpl):
2724         * runtime/UStringImpl.h:
2725         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
2726         (JSC::UntypedPtrAndBitfield::asPtr):
2727         (JSC::UntypedPtrAndBitfield::operator&=):
2728         (JSC::UntypedPtrAndBitfield::operator|=):
2729         (JSC::UntypedPtrAndBitfield::operator&):
2730         (JSC::UStringImpl::create):
2731         (JSC::UStringImpl::cost):
2732         (JSC::UStringImpl::isIdentifier):
2733         (JSC::UStringImpl::setIsIdentifier):
2734         (JSC::UStringImpl::ref):
2735         (JSC::UStringImpl::deref):
2736         (JSC::UStringImpl::checkConsistency):
2737         (JSC::UStringImpl::UStringImpl):
2738         (JSC::UStringImpl::bufferOwnerString):
2739         (JSC::UStringImpl::bufferOwnership):
2740         (JSC::UStringImpl::isStatic):
2741         * wtf/StringHashFunctions.h:
2742         (WTF::stringHash):
2743
2744 2010-01-18  Simon Hausmann  <simon.hausmann@nokia.com>
2745
2746         Reviewed by Kenneth Rohde Christiansen.
2747
2748         Fix the build with strict gcc and RVCT versions: It's not legal to cast a
2749         pointer to a function to a void* without an intermediate cast to a non-pointer
2750         type. A cast to a ptrdiff_t inbetween fixes it.
2751
2752         * runtime/JSString.h:
2753         (JSC::Fiber::JSString):
2754
2755 2010-01-15  Gavin Barraclough  <barraclough@apple.com>
2756
2757         Reviewed by Oliver Hunt.
2758
2759         https://bugs.webkit.org/show_bug.cgi?id=33731
2760         Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags).
2761
2762         This break the OS X Leaks tool.  Instead, free up some more bits from the refCount.
2763
2764         * runtime/UStringImpl.cpp:
2765         (JSC::UStringImpl::sharedBuffer):
2766         (JSC::UStringImpl::~UStringImpl):
2767         * runtime/UStringImpl.h:
2768         (JSC::UStringImpl::cost):
2769         (JSC::UStringImpl::checkConsistency):
2770         (JSC::UStringImpl::UStringImpl):
2771         (JSC::UStringImpl::bufferOwnerString):
2772         (JSC::UStringImpl::):
2773         * wtf/StringHashFunctions.h:
2774         (WTF::stringHash):
2775
2776 2010-01-15  Gavin Barraclough  <barraclough@apple.com>
2777
2778         Reviewed by Oliver Hunt.
2779
2780         https://bugs.webkit.org/show_bug.cgi?id=33731
2781         Remove uses of PtrAndFlags from JIT data stuctures.
2782
2783         These break the OS X Leaks tool.  Free up a bit in CallLinkInfo, and invalid
2784         permutation of pointer states in MethodCallLinkInfo to represent the removed bits.
2785
2786         * bytecode/CodeBlock.h:
2787         (JSC::CallLinkInfo::seenOnce):
2788         (JSC::CallLinkInfo::setSeen):
2789         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
2790         (JSC::MethodCallLinkInfo::seenOnce):
2791         (JSC::MethodCallLinkInfo::setSeen):
2792         * jit/JIT.cpp:
2793         (JSC::JIT::unlinkCall):
2794         * jit/JITPropertyAccess.cpp:
2795         (JSC::JIT::patchMethodCallProto):
2796         * runtime/UString.h:
2797
2798 2010-01-16  Maciej Stachowiak  <mjs@apple.com>
2799
2800         Reviewed by Oliver Hunt.
2801
2802         Cache JS string values made from DOM strings (Dromaeo speedup)
2803         https://bugs.webkit.org/show_bug.cgi?id=33768
2804         <rdar://problem/7353576>
2805
2806         * runtime/JSString.h:
2807         (JSC::jsStringWithFinalizer): Added new mechanism for a string to have an optional
2808         finalizer callback, for the benefit of weak-referencing caches.
2809         (JSC::):
2810         (JSC::Fiber::JSString):
2811         (JSC::Fiber::~JSString):
2812         * runtime/JSString.cpp:
2813         (JSC::JSString::resolveRope): Clear fibers so this doesn't look like a string with a finalizer.
2814         * runtime/WeakGCMap.h: Include "Collector.h" to make this header includable by itself.
2815
2816 2010-01-15  Sam Weinig  <sam@webkit.org>
2817
2818         Reviewed by Maciej Stachowiak.
2819
2820         Fix for <rdar://problem/7548432>
2821         Add ALWAYS_INLINE to jsLess for a 1% speedup on llvm-gcc.
2822
2823         * runtime/Operations.h:
2824         (JSC::jsLess):
2825
2826 2010-01-14  Geoffrey Garen  <ggaren@apple.com>
2827
2828         Reviewed by Oliver Hunt.
2829
2830         REGRESISON: Google maps buttons not working properly
2831         https://bugs.webkit.org/show_bug.cgi?id=31871
2832
2833         REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when
2834         getting directions for a second time
2835         https://bugs.webkit.org/show_bug.cgi?id=33446
2836         
2837         SunSpider and v8 report no change.
2838
2839         * interpreter/Interpreter.cpp:
2840         (JSC::Interpreter::tryCacheGetByID): Update our cached offset in case
2841         flattening the dictionary changed any of its offsets.
2842
2843         * jit/JITStubs.cpp:
2844         (JSC::JITThunks::tryCacheGetByID):
2845         (JSC::DEFINE_STUB_FUNCTION):
2846         * runtime/Operations.h:
2847         (JSC::normalizePrototypeChain): ditto
2848
2849 2010-01-14  Gavin Barraclough  <barraclough@apple.com>
2850
2851         Reviewed by Oliver Hunt.
2852
2853         https://bugs.webkit.org/show_bug.cgi?id=33705
2854         UStringImpl::create() should use internal storage
2855
2856         When creating a UStringImpl copying of a UChar*, we can use an internal buffer,
2857         by calling UStringImpl::tryCreateUninitialized().
2858
2859         Also, remove duplicate of copyChars from JSString, call UStringImpl's version.
2860
2861         Small (max 0.5%) progression on Sunspidey.
2862
2863         * runtime/JSString.cpp:
2864         (JSC::JSString::resolveRope):
2865         * runtime/UStringImpl.h:
2866         (JSC::UStringImpl::create):
2867
2868 2010-01-14  Gavin Barraclough  <barraclough@apple.com>
2869
2870         Reviewed by Sam Weinig.
2871
2872         Make naming & behaviour of UString[Impl] methods more consistent.
2873         https://bugs.webkit.org/show_bug.cgi?id=33702
2874
2875         UString::create() creates a copy of the UChar* passed, but UStringImpl::create() assumes
2876         that it should assume ownership of the provided buffer (with UString::createNonCopying()
2877         and UStringImpl::createCopying() providing the alternate behaviours).  Unify on create()
2878         taking a copy of the provided buffer.  For non-copying cases, use the name 'adopt', and
2879         make this method take a Vector<UChar>&.  For cases where non-copying construction was being
2880         used, other than from a Vector<UChar>, change the code to allocate the storage along with
2881         the UStringImpl using UStringImpl::createUninitialized().  (The adopt() method also more
2882         closely matches that of WebCore::StringImpl).
2883
2884         Also, UString::createUninitialized() and UStringImpl::createUninitialized() have incompatible
2885         behaviours, in that the UString form sets the provided UChar* to a null or non-null value to
2886         indicate success or failure, but UStringImpl uses the returned PassRefPtr<UStringImpl> to
2887         indicate when allocation has failed (potentially leaving the output Char* uninitialized).
2888         This is also incompatible with WebCore::StringImpl's behaviour, in that
2889         StringImpl::createUninitialized() will CRASH() if unable to allocate.  Some uses of
2890         createUninitialized() in JSC are unsafe, since they do not test the result for null.
2891         UStringImpl's indication is preferable, since we may want a successful call to set the result
2892         buffer to 0 (specifically, StringImpl returns 0 for the buffer where createUninitialized()
2893         returns the empty string, which seems reasonable to catch bugs early).  UString's method
2894         cannot support UStringImpl's behaviour directly, since it returns an object rather than a
2895         pointer.
2896             - remove UString::createUninitialized(), replace with calls to UStringImpl::createUninitialized()
2897             - create a UStringImpl::tryCreateUninitialized() form UStringImpl::createUninitialized(),
2898               with current behaviour, make createUninitialized() crash on failure to allocate.
2899             - make cases in JSC that do not check the result call createUninitialized(), and cases that do
2900               check call tryCreateUninitialized().
2901
2902         Rename computedHash() to existingHash(), to bring this in line wih WebCore::StringImpl.
2903
2904         * API/JSClassRef.cpp:
2905         (OpaqueJSClassContextData::OpaqueJSClassContextData):
2906         * JavaScriptCore.exp:
2907         * runtime/ArrayPrototype.cpp:
2908         (JSC::arrayProtoFuncToString):
2909         * runtime/Identifier.cpp:
2910         (JSC::CStringTranslator::translate):
2911         (JSC::UCharBufferTranslator::translate):
2912         * runtime/JSString.cpp:
2913         (JSC::JSString::resolveRope):
2914         * runtime/Lookup.cpp:
2915         (JSC::HashTable::createTable):
2916         * runtime/Lookup.h:
2917         (JSC::HashTable::entry):
2918         * runtime/StringBuilder.h:
2919         (JSC::StringBuilder::release):
2920         * runtime/StringConstructor.cpp:
2921         (JSC::stringFromCharCodeSlowCase):
2922         * runtime/StringPrototype.cpp:
2923         (JSC::substituteBackreferencesSlow):
2924         (JSC::stringProtoFuncToLowerCase):
2925         (JSC::stringProtoFuncToUpperCase):
2926         (JSC::stringProtoFuncFontsize):
2927         (JSC::stringProtoFuncLink):
2928         * runtime/Structure.cpp:
2929         (JSC::Structure::despecifyDictionaryFunction):
2930         (JSC::Structure::get):
2931         (JSC::Structure::despecifyFunction):
2932         (JSC::Structure::put):
2933         (JSC::Structure::remove):
2934         (JSC::Structure::insertIntoPropertyMapHashTable):
2935         (JSC::Structure::checkConsistency):
2936         * runtime/Structure.h:
2937         (JSC::Structure::get):
2938         * runtime/StructureTransitionTable.h:
2939         (JSC::StructureTransitionTableHash::hash):
2940         * runtime/UString.cpp:
2941         (JSC::createRep):
2942         (JSC::UString::UString):
2943         (JSC::UString::spliceSubstringsWithSeparators):
2944         (JSC::UString::replaceRange):
2945         (JSC::UString::operator=):
2946         * runtime/UString.h:
2947         (JSC::UString::adopt):
2948         (JSC::IdentifierRepHash::hash):
2949         (JSC::makeString):
2950         * runtime/UStringImpl.h:
2951         (JSC::UStringImpl::adopt):
2952         (JSC::UStringImpl::create):
2953         (JSC::UStringImpl::createUninitialized):
2954         (JSC::UStringImpl::tryCreateUninitialized):
2955         (JSC::UStringImpl::existingHash):
2956
2957 2010-01-13  Kent Hansen  <kent.hansen@nokia.com>
2958
2959         Reviewed by Oliver Hunt.
2960
2961         JSON.stringify and JSON.parse needlessly process properties in the prototype chain
2962         https://bugs.webkit.org/show_bug.cgi?id=33053
2963
2964         * runtime/JSONObject.cpp:
2965         (JSC::Stringifier::Holder::appendNextProperty):
2966         (JSC::Walker::walk):
2967
2968 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
2969
2970         Reviewed by NOBODY (buildfix).
2971
2972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2973
2974 2010-01-13  Alexey Proskuryakov  <ap@apple.com>
2975
2976         Reviewed by Darin Adler.
2977
2978         https://bugs.webkit.org/show_bug.cgi?id=33641
2979         Assertion failure in Lexer.cpp if input stream ends while in string escape
2980
2981         Test: fast/js/end-in-string-escape.html
2982
2983         * parser/Lexer.cpp: (JSC::Lexer::lex): Bail out quickly on end of stream, not giving the
2984         assertion a chance to fire.
2985
2986 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
2987
2988         Reviewed by NOBODY (buildfix).
2989
2990         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2991
2992 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
2993
2994         Rubber stamped by Sam Weinig & Darin Adler.
2995
2996         Three quick fixes to UStringImpl.
2997             - The destroy() method can be switched back to a normal destructor; since we've switched
2998               the way we protect static strings to be using an odd ref-count the destroy() won't abort.
2999             - The cost() calculation logic was wrong.  If you have multiple JSStrings wrapping substrings
3000               of a base string, they would each report the full cost of the base string to the heap.
3001               Instead we should only be reporting once for the base string.
3002             - Remove the overloaded new operator calling fastMalloc, replace this with a 'using' to pick
3003               up the implementation from the parent class.
3004
3005         * JavaScriptCore.exp:
3006         * runtime/UStringImpl.cpp:
3007         (JSC::UStringImpl::~UStringImpl):
3008         * runtime/UStringImpl.h:
3009         (JSC::UStringImpl::cost):
3010         (JSC::UStringImpl::deref):
3011
3012 2010-01-13  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3013
3014         Reviewed by Simon Hausmann.
3015
3016         [Qt] Split the build process in two different .pro files.
3017         This allows qmake to be run once all source files are available.
3018
3019         * DerivedSources.pro: Added.
3020         * JavaScriptCore.pri: Moved source generation to DerivedSources.pro
3021         * pcre/pcre.pri: Moved source generation to DerivedSources.pro
3022
3023 2010-01-12  Kent Hansen  <kent.hansen@nokia.com>
3024
3025         Reviewed by Geoffrey Garen.
3026
3027         [ES5] Implement Object.getOwnPropertyNames
3028         https://bugs.webkit.org/show_bug.cgi?id=32242
3029
3030         Add an extra argument to getPropertyNames() and getOwnPropertyNames()
3031         (and all reimplementations thereof) that indicates whether non-enumerable
3032         properties should be added.
3033
3034         * API/JSCallbackObject.h:
3035         * API/JSCallbackObjectFunctions.h:
3036         (JSC::::getOwnPropertyNames):
3037         * JavaScriptCore.exp:
3038         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3039         * debugger/DebuggerActivation.cpp:
3040         (JSC::DebuggerActivation::getOwnPropertyNames):
3041         * debugger/DebuggerActivation.h:
3042         * runtime/Arguments.cpp:
3043         (JSC::Arguments::getOwnPropertyNames):
3044         * runtime/Arguments.h:
3045         * runtime/CommonIdentifiers.h:
3046         * runtime/JSArray.cpp:
3047         (JSC::JSArray::getOwnPropertyNames):
3048         * runtime/JSArray.h:
3049         * runtime/JSByteArray.cpp:
3050         (JSC::JSByteArray::getOwnPropertyNames):
3051         * runtime/JSByteArray.h:
3052         * runtime/JSFunction.cpp:
3053         (JSC::JSFunction::getOwnPropertyNames):
3054         * runtime/JSFunction.h:
3055         * runtime/JSNotAnObject.cpp:
3056         (JSC::JSNotAnObject::getOwnPropertyNames):
3057         * runtime/JSNotAnObject.h:
3058         * runtime/JSObject.cpp:
3059         (JSC::getClassPropertyNames):
3060         (JSC::JSObject::getPropertyNames):
3061         (JSC::JSObject::getOwnPropertyNames):
3062         * runtime/JSObject.h:
3063         * runtime/JSVariableObject.cpp:
3064         (JSC::JSVariableObject::getOwnPropertyNames):
3065         * runtime/JSVariableObject.h:
3066         * runtime/ObjectConstructor.cpp:
3067         (JSC::ObjectConstructor::ObjectConstructor):
3068         (JSC::objectConstructorGetOwnPropertyNames):
3069         * runtime/RegExpMatchesArray.h:
3070         (JSC::RegExpMatchesArray::getOwnPropertyNames):
3071         * runtime/StringObject.cpp:
3072         (JSC::StringObject::getOwnPropertyNames):
3073         * runtime/StringObject.h:
3074         * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument.
3075         (JSC::Structure::getPropertyNames):
3076         * runtime/Structure.h:
3077         (JSC::):
3078
3079 2010-01-12  Alexey Proskuryakov  <ap@apple.com>
3080
3081         Reviewed by Darin Adler.
3082
3083         https://bugs.webkit.org/show_bug.cgi?id=33540
3084         Make it possible to build in debug mode with assertions disabled
3085
3086         * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
3087         * runtime/Identifier.cpp: (JSC::Identifier::checkSameIdentifierTable):
3088         * wtf/FastMalloc.cpp:
3089         * wtf/HashTable.h: (WTF::HashTableConstIterator::checkValidity):
3090         * yarr/RegexCompiler.cpp: (JSC::Yarr::compileRegex):
3091
3092 2009-11-23  Yong Li  <yoli@rim.com>
3093
3094         Reviewed by Adam Treat.
3095
3096         Make GIF decoder support down-sampling
3097         https://bugs.webkit.org/show_bug.cgi?id=31806
3098
3099         * platform/image-decoders/ImageDecoder.cpp:
3100         (WebCore::ImageDecoder::upperBoundScaledY):
3101         (WebCore::ImageDecoder::lowerBoundScaledY):
3102         * platform/image-decoders/ImageDecoder.h:
3103         (WebCore::RGBA32Buffer::scaledRect):
3104         (WebCore::RGBA32Buffer::setScaledRect):
3105         (WebCore::ImageDecoder::scaledSize):
3106         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3107         (WebCore::GIFImageDecoder::sizeNowAvailable):
3108         (WebCore::GIFImageDecoder::initFrameBuffer):
3109         (WebCore::copyOnePixel):
3110         (WebCore::GIFImageDecoder::haveDecodedRow):
3111         (WebCore::GIFImageDecoder::frameComplete):
3112
3113 2010-01-12  Adam Barth  <abarth@webkit.org>
3114
3115         Reviewed by Eric Seidel.
3116
3117         ecma/Date/15.9.5.12-1.js fails every night at midnight
3118         https://bugs.webkit.org/show_bug.cgi?id=28041
3119
3120         Change the test to use a concrete time instead of "now".
3121
3122         * tests/mozilla/ecma/Date/15.9.5.10-1.js:
3123         * tests/mozilla/ecma/Date/15.9.5.12-1.js:
3124
3125 2010-01-11  Csaba Osztrogonác  <ossy@webkit.org>
3126
3127         Reviewed by Ariya Hidayat.
3128
3129         [Qt] Enable JIT and YARR_JIT if (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100)
3130
3131         * wtf/Platform.h:
3132
3133 2010-01-11  Geoffrey Garen  <ggaren@apple.com>
3134
3135         Reviewed by Alexey Proskuryakov.
3136
3137         https://bugs.webkit.org/show_bug.cgi?id=33481
3138         Uninitialized data members in ArrayStorage
3139         
3140         SunSpider reports no change.
3141
3142         * runtime/JSArray.cpp:
3143         (JSC::JSArray::JSArray): Initialize missing data members in the two cases
3144         where we don't use fastZeroedMalloc, so it doesn't happen automatically.
3145
3146 2010-01-11  Steve Falkenburg  <sfalken@apple.com>
3147
3148         Reviewed by Sam Weinig.
3149
3150         https://bugs.webkit.org/show_bug.cgi?id=33480
3151         
3152         Improve debugging reliability for WTF on Windows.
3153         Store WTF static library's PDB file into a better location.
3154
3155         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3156
3157 2010-01-11  Steve Falkenburg  <sfalken@apple.com>
3158
3159         Windows build fix.
3160         Remove extraneous entries from def file causing build warning.
3161
3162         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3163
3164 2010-01-10  Kent Hansen  <kent.hansen@nokia.com>
3165
3166         Reviewed by Darin Adler.
3167
3168         RegExp.prototype.toString returns "//" for empty regular expressions
3169         https://bugs.webkit.org/show_bug.cgi?id=33319
3170
3171         "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
3172
3173         * runtime/RegExpPrototype.cpp:
3174         (JSC::regExpProtoFuncToString):
3175
3176         * tests/mozilla/ecma_2/RegExp/properties-001.js:
3177         (AddRegExpCases):
3178         * tests/mozilla/js1_2/regexp/toString.js:
3179         Update relevant Mozilla tests (Mozilla has had this behavior since November 2003).
3180
3181 2010-01-10  Darin Adler  <darin@apple.com>
3182
3183         * tests/mozilla/ecma/Array/15.4.1.1.js: Added property allow-tabs.
3184         * tests/mozilla/ecma/Array/15.4.1.2.js: Added property allow-tabs.
3185         * tests/mozilla/ecma/Array/15.4.2.1-1.js: Added property allow-tabs.
3186         * tests/mozilla/ecma/Array/15.4.2.2-1.js: Added property allow-tabs.
3187         * tests/mozilla/ecma/Array/15.4.2.2-2.js: Added property allow-tabs.
3188         * tests/mozilla/ecma/Array/15.4.2.3.js: Added property allow-tabs.
3189         * tests/mozilla/ecma/Array/15.4.3.2.js: Added property allow-tabs.
3190         * tests/mozilla/ecma/Array/15.4.3.js: Added property allow-tabs.
3191         * tests/mozilla/ecma/Array/15.4.4.1.js: Added property allow-tabs.
3192         * tests/mozilla/ecma/Array/15.4.4.js: Added property allow-tabs.
3193         * tests/mozilla/ecma/LexicalConventions/7.7.4.js: Added property allow-tabs.
3194         * tests/mozilla/ecma/Math/15.8.2.13.js: Added property allow-tabs.
3195         * tests/mozilla/ecma/Math/15.8.2.16.js: Added property allow-tabs.
3196         * tests/mozilla/ecma/Math/15.8.2.18.js: Added property allow-tabs.
3197         * tests/mozilla/ecma/Math/15.8.2.2.js: Added property allow-tabs.
3198         * tests/mozilla/ecma/Math/15.8.2.4.js: Added property allow-tabs.
3199         * tests/mozilla/ecma/Math/15.8.2.5.js: Added property allow-tabs.
3200         * tests/mozilla/ecma/Math/15.8.2.7.js: Added property allow-tabs.
3201         * tests/mozilla/ecma/String/15.5.1.js: Added property allow-tabs.
3202         * tests/mozilla/ecma/String/15.5.2.js: Added property allow-tabs.
3203         * tests/mozilla/ecma/String/15.5.3.1-3.js: Added property allow-tabs.
3204         * tests/mozilla/ecma/String/15.5.3.1-4.js: Added property allow-tabs.
3205         * tests/mozilla/ecma/String/15.5.3.js: Added property allow-tabs.
3206         * tests/mozilla/ecma/TypeConversion/9.5-2.js: Added property allow-tabs.
3207         * tests/mozilla/ecma/jsref.js: Modified property allow-tabs.
3208         * tests/mozilla/ecma/shell.js: Modified property allow-tabs.
3209         * tests/mozilla/ecma_2/LexicalConventions/keywords-001.js: Added property allow-tabs.
3210         * tests/mozilla/ecma_2/RegExp/exec-001.js: Added property allow-tabs.
3211         * tests/mozilla/ecma_2/String/match-004.js: Added property allow-tabs.
3212         * tests/mozilla/ecma_2/String/replace-001.js: Added property allow-tabs.
3213         * tests/mozilla/ecma_2/String/split-002.js: Added property allow-tabs.
3214         * tests/mozilla/ecma_2/jsref.js: Modified property allow-tabs.
3215         * tests/mozilla/ecma_2/shell.js: Added property allow-tabs.
3216         * tests/mozilla/ecma_3/Date/shell.js: Modified property allow-tabs.
3217         * tests/mozilla/ecma_3/Exceptions/regress-181654.js: Added property allow-tabs.
3218         * tests/mozilla/ecma_3/RegExp/regress-209067.js: Added property allow-tabs.
3219         * tests/mozilla/ecma_3/RegExp/regress-85721.js: Added property allow-tabs.
3220         * tests/mozilla/importList.html: Added property allow-tabs.
3221         * tests/mozilla/js1_1/shell.js: Added property allow-tabs.
3222         * tests/mozilla/js1_2/Array/general1.js: Added property allow-tabs.
3223         * tests/mozilla/js1_2/Array/general2.js: Added property allow-tabs.
3224         * tests/mozilla/js1_2/Array/slice.js: Added property allow-tabs.
3225         * tests/mozilla/js1_2/Array/splice1.js: Added property allow-tabs.
3226         * tests/mozilla/js1_2/Array/splice2.js: Added property allow-tabs.
3227         * tests/mozilla/js1_2/Objects/toString-001.js: Added property allow-tabs.
3228         * tests/mozilla/js1_2/String/charCodeAt.js: Added property allow-tabs.
3229         * tests/mozilla/js1_2/String/concat.js: Modified property allow-tabs.
3230         * tests/mozilla/js1_2/String/match.js: Added property allow-tabs.
3231         * tests/mozilla/js1_2/String/slice.js: Added property allow-tabs.
3232         * tests/mozilla/js1_2/function/Function_object.js: Added property allow-tabs.
3233         * tests/mozilla/js1_2/function/Number.js: Modified property allow-tabs.
3234         * tests/mozilla/js1_2/function/String.js: Modified property allow-tabs.
3235         * tests/mozilla/js1_2/function/nesting.js: Added property allow-tabs.
3236         * tests/mozilla/js1_2/function/regexparg-1.js: Added property allow-tabs.
3237         * tests/mozilla/js1_2/function/regexparg-2-n.js: Added property allow-tabs.
3238         * tests/mozilla/js1_2/jsref.js: Added property allow-tabs.
3239         * tests/mozilla/js1_2/operator/equality.js: Added property allow-tabs.
3240         * tests/mozilla/js1_2/operator/strictEquality.js: Added property allow-tabs.
3241         * tests/mozilla/js1_2/regexp/RegExp_dollar_number.js: Added property allow-tabs.
3242         * tests/mozilla/js1_2/regexp/RegExp_input.js: Added property allow-tabs.
3243         * tests/mozilla/js1_2/regexp/RegExp_input_as_array.js: Added property allow-tabs.
3244         * tests/mozilla/js1_2/regexp/RegExp_lastIndex.js: Added property allow-tabs.
3245         * tests/mozilla/js1_2/regexp/RegExp_lastMatch.js: Added property allow-tabs.
3246         * tests/mozilla/js1_2/regexp/RegExp_lastMatch_as_array.js: Added property allow-tabs.
3247         * tests/mozilla/js1_2/regexp/RegExp_lastParen.js: Added property allow-tabs.
3248         * tests/mozilla/js1_2/regexp/RegExp_lastParen_as_array.js: Added property allow-tabs.
3249         * tests/mozilla/js1_2/regexp/RegExp_leftContext.js: Added property allow-tabs.
3250         * tests/mozilla/js1_2/regexp/RegExp_leftContext_as_array.js: Added property allow-tabs.
3251         * tests/mozilla/js1_2/regexp/RegExp_multiline.js: Added property allow-tabs.
3252         * tests/mozilla/js1_2/regexp/RegExp_multiline_as_array.js: Added property allow-tabs.
3253         * tests/mozilla/js1_2/regexp/RegExp_object.js: Added property allow-tabs.
3254         * tests/mozilla/js1_2/regexp/RegExp_rightContext.js: Added property allow-tabs.
3255         * tests/mozilla/js1_2/regexp/RegExp_rightContext_as_array.js: Added property allow-tabs.
3256         * tests/mozilla/js1_2/regexp/alphanumeric.js: Added property allow-tabs.
3257         * tests/mozilla/js1_2/regexp/asterisk.js: Added property allow-tabs.
3258         * tests/mozilla/js1_2/regexp/backslash.js: Added property allow-tabs.
3259         * tests/mozilla/js1_2/regexp/backspace.js: Added property allow-tabs.
3260         * tests/mozilla/js1_2/regexp/beginLine.js: Added property allow-tabs.
3261         * tests/mozilla/js1_2/regexp/character_class.js: Added property allow-tabs.
3262         * tests/mozilla/js1_2/regexp/compile.js: Added property allow-tabs.
3263         * tests/mozilla/js1_2/regexp/control_characters.js: Added property allow-tabs.
3264         * tests/mozilla/js1_2/regexp/digit.js: Added property allow-tabs.
3265         * tests/mozilla/js1_2/regexp/dot.js: Added property allow-tabs.
3266         * tests/mozilla/js1_2/regexp/endLine.js: Added property allow-tabs.
3267         * tests/mozilla/js1_2/regexp/everything.js: Added property allow-tabs.
3268         * tests/mozilla/js1_2/regexp/exec.js: Added property allow-tabs.
3269         * tests/mozilla/js1_2/regexp/flags.js: Added property allow-tabs.
3270         * tests/mozilla/js1_2/regexp/global.js: Added property allow-tabs.
3271         * tests/mozilla/js1_2/regexp/hexadecimal.js: Added property allow-tabs.
3272         * tests/mozilla/js1_2/regexp/ignoreCase.js: Added property allow-tabs.
3273         * tests/mozilla/js1_2/regexp/interval.js: Added property allow-tabs.
3274         * tests/mozilla/js1_2/regexp/octal.js: Added property allow-tabs.
3275         * tests/mozilla/js1_2/regexp/parentheses.js: Added property allow-tabs.
3276         * tests/mozilla/js1_2/regexp/plus.js: Added property allow-tabs.
3277         * tests/mozilla/js1_2/regexp/question_mark.js: Added property allow-tabs.
3278         * tests/mozilla/js1_2/regexp/simple_form.js: Added property allow-tabs.
3279         * tests/mozilla/js1_2/regexp/source.js: Added property allow-tabs.
3280         * tests/mozilla/js1_2/regexp/special_characters.js: Added property allow-tabs.
3281         * tests/mozilla/js1_2/regexp/string_replace.js: Added property allow-tabs.
3282         * tests/mozilla/js1_2/regexp/string_search.js: Added property allow-tabs.
3283         * tests/mozilla/js1_2/regexp/string_split.js: Added property allow-tabs.
3284         * tests/mozilla/js1_2/regexp/test.js: Added property allow-tabs.
3285         * tests/mozilla/js1_2/regexp/toString.js: Added property allow-tabs.
3286         * tests/mozilla/js1_2/regexp/vertical_bar.js: Added property allow-tabs.
3287         * tests/mozilla/js1_2/regexp/whitespace.js: Added property allow-tabs.
3288         * tests/mozilla/js1_2/regexp/word_boundary.js: Added property allow-tabs.
3289         * tests/mozilla/js1_2/shell.js: Added property allow-tabs.
3290         * tests/mozilla/js1_2/statements/break.js: Added property allow-tabs.
3291         * tests/mozilla/js1_2/statements/continue.js: Added property allow-tabs.
3292         * tests/mozilla/js1_2/statements/do_while.js: Added property allow-tabs.
3293         * tests/mozilla/js1_2/statements/switch.js: Added property allow-tabs.
3294         * tests/mozilla/js1_2/statements/switch2.js: Added property allow-tabs.
3295         * tests/mozilla/js1_3/shell.js: Added property allow-tabs.
3296         * tests/mozilla/js1_4/shell.js: Added property allow-tabs.
3297         * tests/mozilla/js1_5/Regress/regress-111557.js: Added property allow-tabs.
3298         * tests/mozilla/js1_5/Regress/regress-216320.js: Added property allow-tabs.
3299         * tests/mozilla/menuhead.html: Added property allow-tabs.
3300         * tests/mozilla/mklistpage.pl: Added property allow-tabs.
3301         * tests/mozilla/runtests.pl: Added property allow-tabs.
3302
3303 2010-01-08  Daniel Bates  <dbates@webkit.org>
3304
3305         Reviewed by Adam Barth.
3306
3307         https://bugs.webkit.org/show_bug.cgi?id=33417
3308
3309         Cleans up style errors exposed by the patch for bug #33198.
3310         Moreover, fixes all "Weird number of spaces at line-start. Are you using a 4-space indent?"
3311         errors reported by check-webkit-style.
3312
3313         No functionality was changed. So, no new tests.
3314
3315         * wtf/Platform.h:
3316
3317 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
3318
3319         Reviewed by Eric Seidel.
3320
3321         Don't store RegExp flags string representation
3322         https://bugs.webkit.org/show_bug.cgi?id=33321
3323
3324         It's unused; the string representation is reconstructed from flags.
3325
3326         * runtime/RegExp.cpp:
3327         (JSC::RegExp::RegExp):
3328         * runtime/RegExp.h:
3329
3330 2010-01-08  Geoffrey Garen  <ggaren@apple.com>
3331
3332         Reviewed by Oliver Hunt.
3333
3334         Memory use grows grows possibly unbounded in this JavaScript Array test case
3335         https://bugs.webkit.org/show_bug.cgi?id=31675
3336
3337         This fixes one observed bug in this test case, which is that
3338         arrays don't report extra cost for the sparse value maps.
3339
3340         SunSpider reports a small speedup.
3341
3342         * runtime/JSArray.cpp:
3343         (JSC::JSArray::putSlowCase): Report extra memory cost for
3344         the sparse value map.
3345         * runtime/JSArray.h: 
3346
3347 2010-01-08  Yong Li  <yoli@rim.com>
3348
3349         Reviewed by Darin Adler.
3350
3351         Remove unnecessary #include from FastMalloc.cpp
3352         https://bugs.webkit.org/show_bug.cgi?id=33393
3353
3354         * wtf/FastMalloc.cpp:
3355
3356 2010-01-08  Eric Seidel  <eric@webkit.org>
3357
3358         No review, rolling out r52983.
3359         http://trac.webkit.org/changeset/52983
3360         https://bugs.webkit.org/show_bug.cgi?id=33321
3361
3362         Broke 59 JavaScriptCore tests.  I don't think Kent knew about
3363         run-javascriptcore-tests.  Sadly neither does the commit-bot,
3364         yet.
3365
3366         * runtime/RegExp.cpp:
3367         (JSC::RegExp::RegExp):
3368         * runtime/RegExp.h:
3369         (JSC::RegExp::flags):
3370
3371 2010-01-08  Eric Seidel  <eric@webkit.org>
3372
3373         No review, rolling out r52981.
3374         http://trac.webkit.org/changeset/52981
3375         https://bugs.webkit.org/show_bug.cgi?id=33319
3376
3377         Caused two JS tests to start failing:
3378         ecma_2/RegExp/properties-001.js and js1_2/regexp/toString.js
3379
3380         * runtime/RegExpPrototype.cpp:
3381         (JSC::regExpProtoFuncToString):
3382
3383 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
3384
3385         Reviewed by Darin Adler.
3386
3387         Don't store RegExp flags string representation
3388         https://bugs.webkit.org/show_bug.cgi?id=33321
3389
3390         It's unused; the string representation is reconstructed from flags.
3391
3392         * runtime/RegExp.cpp:
3393         (JSC::RegExp::RegExp):
3394         * runtime/RegExp.h:
3395
3396 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
3397
3398         Reviewed by Darin Adler.
3399
3400         RegExp.prototype.toString returns "//" for empty regular expressions
3401         https://bugs.webkit.org/show_bug.cgi?id=33319
3402
3403         "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
3404
3405         * runtime/RegExpPrototype.cpp:
3406         (JSC::regExpProtoFuncToString):
3407
3408 2010-01-08  Norbert Leser  <norbert.leser@nokia.com>
3409
3410         Reviewed by Darin Adler.
3411
3412         RVCT compiler with "-Otime -O3" optimization tries to optimize out 
3413         inline new'ed pointers that are passed as arguments.
3414         Proposed patch assigns new'ed pointer explicitly outside function call.
3415
3416         https://bugs.webkit.org/show_bug.cgi?id=33084
3417
3418         * API/JSClassRef.cpp:
3419         (OpaqueJSClass::OpaqueJSClass):
3420         (OpaqueJSClassContextData::OpaqueJSClassContextData):
3421
3422 2010-01-08  Gabor Loki  <loki@webkit.org>
3423
3424         Reviewed by Gavin Barraclough.
3425
3426         Remove an unnecessary cacheFlush from ARM_TRADITIONAL JIT
3427         https://bugs.webkit.org/show_bug.cgi?id=33203
3428
3429         * assembler/ARMAssembler.cpp: Remove obsolete linkBranch function.
3430         (JSC::ARMAssembler::executableCopy): Inline a clean linkBranch code.
3431         * assembler/ARMAssembler.h:
3432         (JSC::ARMAssembler::getLdrImmAddress): Use inline function.
3433         (JSC::ARMAssembler::getLdrImmAddressOnPool): Ditto.
3434         (JSC::ARMAssembler::patchPointerInternal): Remove an unnecessary cacheFlush.
3435         (JSC::ARMAssembler::linkJump): Use patchPointerInternal instead of linkBranch.
3436         (JSC::ARMAssembler::linkCall): Ditto.
3437         (JSC::ARMAssembler::relinkCall): Ditto.
3438
3439 2010-01-07  Gabor Loki  <loki@webkit.org>
3440
3441         Reviewed by Gavin Barraclough.
3442
3443         Build fix for JSVALUE32 when ENABLE_JIT_OPTIMIZE* are disabled
3444         https://bugs.webkit.org/show_bug.cgi?id=33311
3445
3446         Move compileGetDirectOffset function to common part of JSVALUE32
3447
3448         * jit/JITPropertyAccess.cpp:
3449         (JSC::JIT::compileGetDirectOffset):
3450
3451 2010-01-07  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3452
3453         Reviewed by Maciej Stachowiak.
3454
3455         Allow call sites to determine if ASSERT_* and LOG_* macros are operational
3456         https://bugs.webkit.org/show_bug.cgi?id=33020
3457
3458         * wtf/Assertions.h: Set ASSERT_MSG_DISABLED, FATAL_DISABLED,
3459         ERROR_DISABLED, LOG_DISABLED to 1 if the compiler does not support
3460         variadic macros. Refactor for better readibility.
3461
3462 2010-01-07  Daniel Bates  <dbates@rim.com>
3463
3464         Reviewed by Eric Seidel.
3465
3466         https://bugs.webkit.org/show_bug.cgi?id=32987
3467
3468         Added ENABLE_XHTMLMP flag. Disabled by default.
3469
3470         * Configurations/FeatureDefines.xcconfig:
3471
3472 2010-01-07  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3473
3474         Reviewed by Gavin Barraclough.
3475
3476         [Symbian] Port ARM traditional JIT Trampolines to RVCT
3477         https://bugs.webkit.org/show_bug.cgi?id=30552
3478
3479         Take the GCC implementation and mechanically convert
3480         it to RVCT syntax.
3481
3482         Use 'bx rX' instead of 'mov pc, rX' when it is available.
3483
3484         Developed in cooperation with Iain Campbell and Gabor Loki.
3485
3486         * JavaScriptCore.pri: Extra step to generate RVCT stubs. The 
3487         script generation intentionally executed all the time not just
3488         for RVCT targets.
3489
3490         * create_rvct_stubs: Added. Perl script to expand precompiler macros
3491         for RVCT assembler - the template is defined in JITStubs.cpp.
3492
3493         * jit/JITStubs.cpp:
3494         (JSC::ctiTrampoline):
3495         (JSC::ctiVMThrowTrampoline):
3496         (JSC::ctiOpThrowNotCaught):
3497
3498 2010-01-07  Geoffrey Garen  <ggaren@apple.com>
3499
3500         Reviewed by Sam Weinig.
3501
3502         Fix a crash seen on the buildbots.
3503
3504         * runtime/JSGlobalObject.cpp:
3505         (JSC::JSGlobalObject::init): Disable specific function tracking here,
3506         instead of in WebCore, to ensure that the disabling happens before a
3507         specific function can be registered.
3508
3509 2010-01-07  Alexey Proskuryakov  <ap@apple.com>
3510
3511         Mac build fix.
3512
3513         * JavaScriptCore.exp: Export new JSGlobalData static data members.
3514
3515 2010-01-07  Alexey Proskuryakov  <ap@apple.com>
3516
3517         Reviewed by Geoffrey Garen.
3518
3519         https://bugs.webkit.org/show_bug.cgi?id=33057
3520         REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows
3521
3522         <rdar://problem/7296920> REGRESSION: WebKit fails to start PeaceKeeper benchmark
3523
3524         Test: fast/js/webcore-string-comparison.html
3525
3526         In r49365, some code was moved from JSString.cpp to JSString.h, and as a result, WebCore
3527         got a way to directly instantiate JSStrings over DLL borders. Since vftable for JSString was
3528         not exported, objects created from WebCore got a different vptr, and JavaScriptCore
3529         optimizations that relied on vptr of all JSString objects being equal failed.
3530
3531         * config.h: Added a JS_EXPORTCLASS macro for exporting classes. It's currently the same as
3532         JS_EXPORTDATA, but it clearly needed a new name.
3533
3534         * runtime/InitializeThreading.cpp:
3535         (JSC::initializeThreadingOnce):
3536         * runtime/JSGlobalData.cpp:
3537         (JSC::JSGlobalData::storeVPtrs):
3538         (JSC::JSGlobalData::JSGlobalData):
3539         (JSC::JSGlobalData::createNonDefault):
3540         (JSC::JSGlobalData::create):
3541         (JSC::JSGlobalData::sharedInstance):
3542         * runtime/JSGlobalData.h:
3543         Store vptrs just once, no need to repeatedly pick and copy them. This makes it possible to
3544         assert vptr correctness in object destructors (which don't have access to JSGlobalData,
3545         and even Heap::heap(this) will fail for fake objects created from storeVPtrs()).
3546
3547         * runtime/JSArray.cpp: (JSC::JSArray::~JSArray): Assert that vptr is what we expect it to be.
3548         It's important to assert in destructor, because MSVC changes the vptr after constructor
3549         is invoked.
3550         * runtime/JSByteArray.cpp: (JSC::JSByteArray::~JSByteArray): Ditto.
3551         * runtime/JSByteArray.h: Ditto.
3552         * runtime/JSFunction.h: Ditto.
3553         * runtime/JSFunction.cpp: (JSC::JSFunction::~JSFunction): Ditto.
3554
3555         * runtime/JSCell.h: (JSC::JSCell::setVPtr): Added a method to substitute vptr for another
3556         one.
3557
3558         * runtime/JSString.h: Export JSString class together with its vftable, and tell other
3559         libraries tp import it. This is needed on platforms that have a separate JavaScriptCore
3560         dynamic library - and on Mac, we already did the export via JavaScriptCore.exp.
3561         (JSC::JSString::~JSString): Assert tha vptr is what we expect it to be.
3562         (JSC::fixupVPtr): Store a previously saved primary vftable pointer (do nothing if building
3563         JavaScriptCore itself).
3564         (JSC::jsSingleCharacterString): Call fixupVPtr in case this is call across DLL boundary.
3565         (JSC::jsSingleCharacterSubstring): Ditto.
3566         (JSC::jsNontrivialString): Ditto.
3567         (JSC::jsString): Ditto.
3568         (JSC::jsSubstring): Ditto.
3569         (JSC::jsOwnedString): Ditto.
3570
3571         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export the new static
3572         JSGlobalData members that are used in WebCore via inline functions.
3573
3574 2010-01-07  Geoffrey Garen  <ggaren@apple.com>
3575
3576         Reviewed by Sam Weinig.
3577
3578         Safari memory usage skyrockets using new Google AdWords interface
3579         https://bugs.webkit.org/show_bug.cgi?id=33343
3580
3581         The memory use was caused by the global object creating too many structures
3582         as it thrashed between different specific functions.
3583
3584         * runtime/Structure.cpp:
3585         (JSC::Structure::Structure):
3586         (JSC::Structure::addPropertyTransition):
3587         (JSC::Structure::changePrototypeTransition):
3588         (JSC::Structure::despecifyFunctionTransition):
3589         (JSC::Structure::addAnonymousSlotsTransition):
3590         (JSC::Structure::getterSetterTransition):
3591         (JSC::Structure::toDictionaryTransition):
3592         (JSC::Structure::addPropertyWithoutTransition):
3593         (JSC::Structure::despecifyAllFunctions):
3594         * runtime/Structure.h:
3595         (JSC::Structure::disableSpecificFunctionTracking): Track a thrash count
3596         for specific functions. Disable specific function tracking once the
3597         thrash count has been hit.
3598
3599 2010-01-07  Csaba Osztrogonác  <ossy@webkit.org>
3600
3601         Reviewed by Simon Hausmann.
3602
3603         [Qt] Enable JIT in debug mode on win32 after r51141 fixed the crashes.
3604
3605         * JavaScriptCore.pri:
3606
3607 2010-01-07  Zoltan Horvath  <zoltan@webkit.org>
3608
3609         Reviewed by Holger Freyther.
3610
3611         [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
3612         https://bugs.webkit.org/show_bug.cgi?id=33312
3613
3614         Using of operator += cause compile error on Mac, so it is changed to
3615         "= static_cast<AllocAlignmentInteger*>(old_ptr) + 1".
3616
3617         * wtf/FastMalloc.cpp:
3618         (WTF::TCMallocStats::realloc):
3619
3620 2010-01-07  Zoltan Horvath  <zoltan@webkit.org>
3621
3622         Reviewed by Holger Freyther.
3623
3624         [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
3625         https://bugs.webkit.org/show_bug.cgi?id=33312
3626
3627         Remove pByte (committed in r42344 from #20422), because pByte doesn't
3628         exist and it is unnecessary.
3629
3630         * wtf/FastMalloc.cpp:
3631         (WTF::TCMallocStats::realloc):
3632
3633 2010-01-06  Gavin Barraclough  <barraclough@apple.com>
3634
3635         QT build fix.
3636
3637         * runtime/Identifier.cpp:
3638         (JSC::createIdentifierTableSpecific):
3639
3640 2010-01-06  Gavin Barraclough  <barraclough@apple.com>
3641
3642         Windows build fix part I.
3643
3644         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3645
3646 2010-01-06  Dan Bernstein  <mitz@apple.com>
3647
3648         Build fix
3649
3650         * runtime/Identifier.cpp:
3651         (JSC::createIdentifierTableSpecificCallback):
3652
3653 2010-01-05  Gavin Barraclough  <barraclough@apple.com>
3654
3655         Reviewed by Sam Weinig.
3656
3657         https://bugs.webkit.org/show_bug.cgi?id=33236
3658         Remove m_identifierTable pointer from UString
3659
3660         Currently every string holds a pointer so that during destruction,
3661         if a string has been used as an identifier, it can remove itself
3662         from the table.  By instead accessing the identifierTable via a
3663         thread specific tracking the table associated with the current
3664         globaldata, we can save the memory cost of this pointer.
3665
3666         * API/APIShims.h:
3667         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
3668         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
3669         (JSC::APICallbackShim::APICallbackShim):
3670         (JSC::APICallbackShim::~APICallbackShim):
3671
3672             - change the API shims to track the identifierTable of the current JSGlobalData.
3673
3674         * API/JSContextRef.cpp:
3675         (JSContextGroupCreate):
3676
3677             - update creation of JSGlobalData for API usage to use new create method.
3678             - fix shim instanciation bug in JSGlobalContextCreateInGroup.
3679
3680         * JavaScriptCore.exp:
3681         * runtime/Completion.cpp:
3682         (JSC::checkSyntax):
3683         (JSC::evaluate):
3684
3685             - add asserts to check the identifierTable is being tracked correctly.
3686
3687         * runtime/Identifier.cpp:
3688         (JSC::IdentifierTable::~IdentifierTable):
3689         (JSC::IdentifierTable::add):
3690         (JSC::Identifier::remove):
3691         (JSC::Identifier::checkSameIdentifierTable):
3692         (JSC::createIdentifierTableSpecificCallback):
3693         (JSC::createIdentifierTableSpecific):
3694         (JSC::createDefaultDataSpecific):
3695
3696             - Use currentIdentifierTable() instead of UStringImpl::m_identifierTable.
3697             - Define methods to access the thread specific identifier tables.
3698
3699         * runtime/Identifier.h:
3700         (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
3701         (JSC::defaultIdentifierTable):
3702         (JSC::setDefaultIdentifierTable):
3703         (JSC::currentIdentifierTable):
3704         (JSC::setCurrentIdentifierTable):
3705         (JSC::resetCurrentIdentifierTable):
3706
3707             - Declare methods to access the thread specific identifier tables.
3708
3709         * runtime/JSGlobalData.cpp:
3710         (JSC::JSGlobalData::createNonDefault):
3711         (JSC::JSGlobalData::create):
3712         (JSC::JSGlobalData::sharedInstance):
3713
3714             - creation of JSGlobalData objects, other than for API usage, associate themselves with the current thread.
3715
3716         * runtime/JSGlobalData.h:
3717         * runtime/UStringImpl.cpp:
3718         (JSC::UStringImpl::destroy):
3719
3720             - destroy() method should be using isIdentifier().
3721
3722         * runtime/UStringImpl.h:
3723         (JSC::UStringImpl::isIdentifier):
3724         (JSC::UStringImpl::setIsIdentifier):
3725         (JSC::UStringImpl::checkConsistency):
3726         (JSC::UStringImpl::UStringImpl):
3727
3728             - replace m_identifierTable with a single m_isIdentifier bit.
3729
3730         * wtf/StringHashFunctions.h:
3731         (WTF::stringHash):
3732
3733             - change string hash result from 32-bit to 31-bit, to free a bit in UStringImpl for m_isIdentifier.
3734
3735 2009-12-25 Patrick Gansterer <paroga@paroga.com>
3736  
3737         Reviewed by Eric Seidel.
3738
3739         Buildfix for WinCE + style fixes.
3740         https://bugs.webkit.org/show_bug.cgi?id=32939
3741
3742         * jsc.cpp:
3743         (functionPrint):
3744         (functionQuit):
3745         (parseArguments):
3746         (fillBufferWithContentsOfFile):
3747  
3748 2010-01-05  Patrick Gansterer  <paroga@paroga.com>
3749
3750         Reviewed by Eric Seidel.
3751
3752         WinCE buildfix after r52791 (renamed PLATFORM(WINCE) to OS(WINCE)).
3753         https://bugs.webkit.org/show_bug.cgi?id=33205
3754
3755         * jit/ExecutableAllocator.h:
3756
3757 2010-01-05  Patrick Gansterer  <paroga@paroga.com>
3758
3759         Reviewed by Darin Adler.
3760
3761         Added compiler error for unsupported platforms.
3762         https://bugs.webkit.org/show_bug.cgi?id=33112
3763
3764         * jit/JITStubs.cpp:
3765
3766 2010-01-05  Gabor Loki  <loki@webkit.org>
3767
3768         Reviewed by Maciej Stachowiak.
3769
3770         Follow r52729 in ARMAssembler.
3771         https://bugs.webkit.org/show_bug.cgi?id=33208
3772
3773         Use WTF_ARM_ARCH_AT_LEAST instead of ARM_ARCH_VERSION
3774
3775         * assembler/ARMAssembler.cpp:
3776         (JSC::ARMAssembler::encodeComplexImm): Move tmp declaration to ARMv7
3777         * assembler/ARMAssembler.h:
3778         (JSC::ARMAssembler::):
3779         (JSC::ARMAssembler::bkpt):
3780
3781 2010-01-05  Maciej Stachowiak  <mjs@apple.com>
3782
3783         Unreviewed build fix for Gtk+
3784
3785         Don't use // comments in Platform.h, at least some of them seem to make the version of GCC
3786         used on the Gtk buildbot unhappy.
3787
3788         * wtf/Platform.h:
3789
3790 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
3791
3792         Reviewed by Darin Fisher.
3793
3794         Reorganize, document and rename OS() platform macros.
3795         https://bugs.webkit.org/show_bug.cgi?id=33198
3796
3797         * wtf/Platform.h: Rename, reorganize and document OS() macros.
3798
3799         Adapt to name changes. Also fixed a few incorrect OS checks.
3800
3801         * API/JSContextRef.cpp:
3802         * assembler/MacroAssemblerARM.cpp:
3803         (JSC::isVFPPresent):
3804         * assembler/MacroAssemblerX86Common.h:
3805         * bytecode/SamplingTool.cpp:
3806         * config.h:
3807         * interpreter/RegisterFile.cpp:
3808         (JSC::RegisterFile::~RegisterFile):
3809         * interpreter/RegisterFile.h:
3810         (JSC::RegisterFile::RegisterFile):
3811         (JSC::RegisterFile::grow):
3812         * jit/ExecutableAllocator.h:
3813         * jit/ExecutableAllocatorFixedVMPool.cpp:
3814         * jit/ExecutableAllocatorPosix.cpp:
3815         * jit/ExecutableAllocatorSymbian.cpp:
3816         * jit/ExecutableAllocatorWin.cpp:
3817         * jit/JITOpcodes.cpp:
3818         (JSC::JIT::privateCompileCTIMachineTrampolines):
3819         * jit/JITStubs.cpp:
3820         * jsc.cpp:
3821         (main):
3822         * parser/Grammar.y:
3823         * profiler/ProfileNode.cpp:
3824         (JSC::getCount):
3825         * runtime/Collector.cpp:
3826         (JSC::Heap::Heap):
3827         (JSC::Heap::allocateBlock):
3828         (JSC::Heap::freeBlockPtr):
3829         (JSC::currentThreadStackBase):
3830         (JSC::getCurrentPlatformThread):
3831         (JSC::suspendThread):
3832         (JSC::resumeThread):
3833         (JSC::getPlatformThreadRegisters):
3834         (JSC::otherThreadStackPointer):
3835         * runtime/Collector.h:
3836         * runtime/DateConstructor.cpp:
3837         * runtime/DatePrototype.cpp:
3838         (JSC::formatLocaleDate):
3839         * runtime/InitializeThreading.cpp:
3840         (JSC::initializeThreading):
3841         * runtime/MarkStack.h:
3842         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
3843         * runtime/MarkStackPosix.cpp:
3844         * runtime/MarkStackSymbian.cpp:
3845         * runtime/MarkStackWin.cpp:
3846         * runtime/StringPrototype.cpp:
3847         (JSC::stringProtoFuncLastIndexOf):
3848         * runtime/TimeoutChecker.cpp:
3849         (JSC::getCPUTime):
3850         * runtime/UString.cpp:
3851         (JSC::UString::from):
3852         * wtf/Assertions.cpp:
3853         * wtf/Assertions.h:
3854         * wtf/CurrentTime.cpp:
3855         (WTF::lowResUTCTime):
3856         * wtf/CurrentTime.h:
3857         (WTF::getLocalTime):
3858         * wtf/DateMath.cpp:
3859         * wtf/FastMalloc.cpp:
3860         (WTF::TCMalloc_ThreadCache::InitModule):
3861         (WTF::TCMallocStats::):
3862         * wtf/FastMalloc.h:
3863         * wtf/MathExtras.h:
3864         * wtf/RandomNumber.cpp:
3865         (WTF::randomNumber):
3866         * wtf/RandomNumberSeed.h:
3867         (WTF::initializeRandomNumberGenerator):
3868         * wtf/StringExtras.h:
3869         * wtf/TCSpinLock.h:
3870         (TCMalloc_SpinLock::Unlock):
3871         (TCMalloc_SlowLock):
3872         * wtf/TCSystemAlloc.cpp:
3873         * wtf/ThreadSpecific.h:
3874         (WTF::::destroy):
3875         * wtf/Threading.h:
3876         * wtf/ThreadingPthreads.cpp:
3877         (WTF::initializeThreading):
3878         (WTF::isMainThread):
3879         * wtf/ThreadingWin.cpp:
3880         (WTF::wtfThreadEntryPoint):
3881         (WTF::createThreadInternal):
3882         * wtf/VMTags.h:
3883         * wtf/unicode/icu/CollatorICU.cpp:
3884         (WTF::Collator::userDefault):
3885         * wtf/win/MainThreadWin.cpp:
3886         (WTF::initializeMainThreadPlatform):
3887
3888 2010-01-04  Gustavo Noronha Silva  <gns@gnome.org>
3889
3890         Add missing files to the build system - make distcheck build fix.
3891
3892         * GNUmakefile.am:
3893
3894 2010-01-04  Gavin Barraclough <barraclough@apple.com>
3895
3896         Reviewed by Sam Weinig, additional coding by Mark Rowe.
3897
3898         https://bugs.webkit.org/show_bug.cgi?id=33163
3899         Add string hashing functions to WTF.
3900         Use WTF's string hashing functions from UStringImpl.
3901
3902         * GNUmakefile.am:
3903         * JavaScriptCore.exp:
3904         * JavaScriptCore.gypi:
3905         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3906         * JavaScriptCore.xcodeproj/project.pbxproj:
3907         * runtime/UStringImpl.cpp:
3908         * runtime/UStringImpl.h:
3909         (JSC::UStringImpl::computeHash):
3910         * wtf/HashFunctions.h:
3911         * wtf/StringHashFunctions.h: Added.
3912         (WTF::stringHash):
3913
3914 2010-01-04  Dmitry Titov  <dimich@chromium.org>
3915
3916         Not reviewed, attempt to fix ARM bulid.
3917
3918         * wtf/Platform.h:
3919
3920 2010-01-04  Gavin Barraclough  <barraclough@apple.com>
3921
3922         Rubber stamped by Geoff Garen.
3923
3924         Add an 'isIdentifier' to UStringImpl, use this where appropriate
3925         (where previously 'identifierTable' was being tested).
3926
3927         * API/JSClassRef.cpp:
3928         (OpaqueJSClass::~OpaqueJSClass):
3929         (OpaqueJSClassContextData::OpaqueJSClassContextData):
3930         * runtime/Identifier.cpp:
3931         (JSC::Identifier::addSlowCase):
3932         * runtime/Identifier.h:
3933         (JSC::Identifier::add):
3934         * runtime/PropertyNameArray.cpp:
3935         (JSC::PropertyNameArray::add):
3936         * runtime/UStringImpl.h:
3937         (JSC::UStringImpl::isIdentifier):
3938
3939 2010-01-04  Gavin Barraclough  <barraclough@apple.com>
3940
3941         Reviewed by Sam "Shimmey Shimmey" Weinig.
3942
3943         https://bugs.webkit.org/show_bug.cgi?id=33158
3944         Refactor JSC API entry/exit to use RAII instead of copy/pasting code.
3945         Make it easier to change set of actions taken when passing across the API boundary.
3946
3947         * API/APIShims.h: Added.
3948         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
3949         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
3950         (JSC::APIEntryShim::APIEntryShim):
3951         (JSC::APICallbackShim::APICallbackShim):
3952         (JSC::APICallbackShim::~APICallbackShim):
3953         * API/JSBase.cpp:
3954         (JSEvaluateScript):
3955         (JSCheckScriptSyntax):
3956         (JSGarbageCollect):
3957         (JSReportExtraMemoryCost):
3958         * API/JSCallbackConstructor.cpp:
3959         (JSC::constructJSCallback):
3960         * API/JSCallbackFunction.cpp:
3961         (JSC::JSCallbackFunction::call):
3962         * API/JSCallbackObjectFunctions.h:
3963         (JSC::::init):
3964         (JSC::::getOwnPropertySlot):
3965         (JSC::::put):
3966         (JSC::::deleteProperty):
3967         (JSC::::construct):
3968         (JSC::::hasInstance):
3969         (JSC::::call):
3970         (JSC::::getOwnPropertyNames):
3971         (JSC::::toNumber):
3972         (JSC::::toString):
3973         (JSC::::staticValueGetter):
3974         (JSC::::callbackGetter):
3975         * API/JSContextRef.cpp:
3976         * API/JSObjectRef.cpp:
3977         (JSObjectMake):
3978         (JSObjectMakeFunctionWithCallback):
3979         (JSObjectMakeConstructor):
3980         (JSObjectMakeFunction):
3981         (JSObjectMakeArray):
3982         (JSObjectMakeDate):
3983         (JSObjectMakeError):
3984         (JSObjectMakeRegExp):
3985         (JSObjectGetPrototype):
3986         (JSObjectSetPrototype):
3987         (JSObjectHasProperty):
3988         (JSObjectGetProperty):
3989         (JSObjectSetProperty):
3990         (JSObjectGetPropertyAtIndex):
3991         (JSObjectSetPropertyAtIndex):
3992         (JSObjectDeleteProperty):
3993         (JSObjectCallAsFunction):
3994         (JSObjectCallAsConstructor):
3995         (JSObjectCopyPropertyNames):
3996         (JSPropertyNameArrayRelease):
3997         (JSPropertyNameAccumulatorAddName):
3998         * API/JSValueRef.cpp:
3999         (JSValueGetType):
4000         (JSValueIsUndefined):
4001         (JSValueIsNull):
4002         (JSValueIsBoolean):
4003         (JSValueIsNumber):
4004         (JSValueIsString):
4005         (JSValueIsObject):
4006         (JSValueIsObjectOfClass):
4007         (JSValueIsEqual):
4008         (JSValueIsStrictEqual):
4009         (JSValueIsInstanceOfConstructor):
4010         (JSValueMakeUndefined):
4011         (JSValueMakeNull):
4012         (JSValueMakeBoolean):
4013         (JSValueMakeNumber):
4014         (JSValueMakeString):
4015         (JSValueToBoolean):
4016         (JSValueToNumber):
4017         (JSValueToStringCopy):
4018         (JSValueToObject):
4019         (JSValueProtect):
4020         (JSValueUnprotect):
4021         * JavaScriptCore.xcodeproj/project.pbxproj:
4022
4023 2010-01-04  Dan Bernstein  <mitz@apple.com>
4024
4025         Reviewed by Ada Chan and Mark Rowe.
4026
4027         Updated copyright string
4028
4029         * Info.plist:
4030         * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist:
4031         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
4032
4033 2010-01-04  Adam Roben  <aroben@apple.com>
4034
4035         No review, rolling out r52741.
4036         http://trac.webkit.org/changeset/52741
4037         https://bugs.webkit.org/show_bug.cgi?id=33056
4038
4039         * wtf/AlwaysInline.h:
4040
4041 2010-01-04  Patrick Gansterer  <paroga@paroga.com>
4042
4043         Reviewed by Darin Adler.
4044
4045         Add cacheFlush support for WinCE
4046         https://bugs.webkit.org/show_bug.cgi?id=33110
4047
4048         * jit/ExecutableAllocator.h:
4049         (JSC::ExecutableAllocator::cacheFlush):
4050
4051 2010-01-04  Patrick Gansterer  <paroga@paroga.com>
4052
4053         Reviewed by Adam Roben.
4054
4055         Implement NO_RETURN for COMPILER(MSVC).
4056         https://bugs.webkit.org/show_bug.cgi?id=33056
4057
4058         * wtf/AlwaysInline.h:
4059
4060 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
4061
4062         Reviewed by Simon Hausmann.
4063
4064         Fix some PLATFORM(*_ENDIAN) uses to CPU()
4065         https://bugs.webkit.org/show_bug.cgi?id=33148
4066
4067         * runtime/JSCell.cpp:
4068         (JSC::):
4069         * runtime/JSValue.h:
4070         (JSC::JSValue::):
4071
4072 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
4073
4074         Reviewed by Adam Barth.
4075
4076         Document CPU() macros in comments.
4077         https://bugs.webkit.org/show_bug.cgi?id=33147
4078
4079         * wtf/Platform.h:
4080
4081 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
4082
4083         Reviewed by Adam Barth.
4084
4085         Reorganize, document and rename CPU() platform macros.
4086         https://bugs.webkit.org/show_bug.cgi?id=33145
4087         ExecutableAllocatorSymbian appears to have buggy ARM version check
4088         https://bugs.webkit.org/show_bug.cgi?id=33138
4089         
4090         * wtf/Platform.h:
4091         Rename all macros related to detection of particular CPUs or
4092         classes of CPUs to CPU(), reorganize and document them.
4093
4094         All remaining changes are adapting to the renames, plus fixing the
4095         second bug cited above.
4096         
4097         * assembler/ARMAssembler.cpp:
4098         * assembler/ARMAssembler.h:
4099         * assembler/ARMv7Assembler.h:
4100         * assembler/AbstractMacroAssembler.h:
4101         (JSC::AbstractMacroAssembler::Imm32::Imm32):
4102         * assembler/MacroAssembler.h:
4103         * assembler/MacroAssemblerARM.cpp:
4104         * assembler/MacroAssemblerARM.h:
4105         * assembler/MacroAssemblerCodeRef.h:
4106         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
4107         * assembler/MacroAssemblerX86.h:
4108         * assembler/MacroAssemblerX86Common.h:
4109         * assembler/MacroAssemblerX86_64.h:
4110         * assembler/X86Assembler.h:
4111         (JSC::X86Registers::):
4112         (JSC::X86Assembler::):
4113         (JSC::X86Assembler::movl_mEAX):
4114         (JSC::X86Assembler::movl_EAXm):
4115         (JSC::X86Assembler::repatchLoadPtrToLEA):
4116         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
4117         * jit/ExecutableAllocator.h:
4118         * jit/ExecutableAllocatorFixedVMPool.cpp:
4119         * jit/ExecutableAllocatorPosix.cpp:
4120         * jit/ExecutableAllocatorSymbian.cpp:
4121         (JSC::ExecutableAllocator::intializePageSize):
4122         * jit/JIT.cpp:
4123         * jit/JIT.h:
4124         * jit/JITArithmetic.cpp:
4125         * jit/JITInlineMethods.h:
4126         (JSC::JIT::beginUninterruptedSequence):
4127         (JSC::JIT::restoreArgumentReferenceForTrampoline):
4128         (JSC::JIT::emitCount):
4129         * jit/JITOpcodes.cpp:
4130         (JSC::JIT::privateCompileCTIMachineTrampolines):
4131         * jit/JITPropertyAccess.cpp:
4132         (JSC::JIT::privateCompileGetByIdProto):
4133         (JSC::JIT::privateCompileGetByIdProtoList):
4134         (JSC::JIT::privateCompileGetByIdChainList):
4135         (JSC::JIT::privateCompileGetByIdChain):
4136         * jit/JITStubs.cpp:
4137         (JSC::JITThunks::JITThunks):
4138         * jit/JITStubs.h:
4139         * runtime/Collector.cpp:
4140         (JSC::currentThreadStackBase):
4141         (JSC::getPlatformThreadRegisters):
4142         (JSC::otherThreadStackPointer):
4143         * wrec/WREC.h:
4144         * wrec/WRECGenerator.cpp:
4145         (JSC::WREC::Generator::generateEnter):
4146         (JSC::WREC::Generator::generateReturnSuccess):
4147         (JSC::WREC::Generator::generateReturnFailure):
4148         * wrec/WRECGenerator.h:
4149         * wtf/FastMalloc.cpp:
4150         * wtf/TCSpinLock.h:
4151         (TCMalloc_SpinLock::Lock):
4152         (TCMalloc_SpinLock::Unlock):
4153         (TCMalloc_SlowLock):
4154         * wtf/Threading.h:
4155         * wtf/dtoa.cpp:
4156         * yarr/RegexJIT.cpp:
4157         (JSC::Yarr::RegexGenerator::generateEnter):
4158         (JSC::Yarr::RegexGenerator::generateReturn):
4159         * yarr/RegexJIT.h:
4160
4161 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
4162
4163         Reviewed by Adam Barth.
4164
4165         Clean up COMPILER macros and remove unused ones.
4166         https://bugs.webkit.org/show_bug.cgi?id=33132
4167         
4168         Removed values are COMPILER(BORLAND) and COMPILER(CYGWIN) - they were
4169         not used anywhere.
4170
4171         * wtf/Platform.h:
4172
4173 2010-01-03  Maciej Stachowiak  <mjs@apple.com>
4174
4175         Reviewed by Eric Seidel.
4176
4177         Update wtf/Platform.h to document the new system for porting macros.
4178         https://bugs.webkit.org/show_bug.cgi?id=33130
4179
4180         * wtf/Platform.h:
4181
4182 2009-12-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4183
4184         Reviewed by Maciej Stachowiak.
4185
4186         PLATFORM(CAIRO) should be defined by WIN_CAIRO define
4187         https://bugs.webkit.org/show_bug.cgi?id=22250
4188
4189         * wtf/Platform.h: Define WTF_PLATFORM_CAIRO for GTK port only
4190         For the WinCairo port WTF_PLATFORM_CAIRO is already defined in config.h
4191
4192 2009-12-28  Shu Chang  <Chang.Shu@nokia.com>
4193
4194         Reviewed by Laszlo Gombos.
4195