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