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