2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-05-15  Ariya Hidayat  <ariya.hidayat@trolltech.com>
2
3         Reviewed by Simon.
4
5         Since WebKitGtk is fully using autotools now, clean-up the .pro/.pri files
6         from gtk-port.
7
8         * JavaScriptCore.pro:
9         * kjs/testkjs.pro:
10
11 2008-05-15  Kevin McCullough  <kmccullough@apple.com>
12
13         - Build fix.
14
15         * JavaScriptCore.exp:
16
17 2008-05-15  Kevin McCullough  <kmccullough@apple.com>
18
19         Reviewed by Tim.
20
21         <rdar://problem/5770054> JavaScript profiler (10928)
22         - Cache some values to save on computing them repetitively. This will be
23         a big savings when we sort since we won't have to walk the tree for
24         every comparison!
25         - We cache these values when we end profiling because otherwise we won't
26         know which profile to get the totalTime for the whole profile from without
27         retaining a reference to the head profile or looking up the profile from
28         the list of all profiles.
29         - Also it's safe to assume we won't be asked for these values while we
30         are still profiling since the WebInspector only get's profileNodes from
31         profiles that are in the allProfiles() list and a profile is only added
32         to that list after it has finished and these values will no longer
33         change.
34
35         * JavaScriptCore.exp:
36         * profiler/ProfileNode.cpp:
37         (KJS::ProfileNode::ProfileNode):
38         (KJS::ProfileNode::stopProfiling):
39         (KJS::ProfileNode::printDataInspectorStyle):
40         (KJS::ProfileNode::printDataSampleStyle):
41         (KJS::ProfileNode::endAndRecordCall):
42         * profiler/ProfileNode.h:
43         (KJS::ProfileNode::totalTime):
44         (KJS::ProfileNode::selfTime):
45         (KJS::ProfileNode::totalPercent):
46         (KJS::ProfileNode::selfPercent):
47         * profiler/Profiler.cpp:
48         (KJS::Profiler::stopProfiling):
49
50 2008-05-15  Simon Hausmann  <shausman@trolltech.com>
51
52         Reviewed by Holger.
53
54         Fix compilation when compiling with MSVC and wchar_t support.
55
56         * wtf/unicode/qt4/UnicodeQt4.h:
57         (WTF::Unicode::foldCase):
58         (WTF::Unicode::umemcasecmp):
59
60 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
61
62         Reviewed by Tim.
63
64         <rdar://problem/5770054> JavaScript profiler (10928)
65         - Turn on the profiler.
66
67         * kjs/config.h:
68
69 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
70
71         Reviewed by Tim.
72
73         <rdar://problem/5770054> JavaScript profiler (10928)
74         - Expose the new profiler functions to the WebInspector.
75
76         * JavaScriptCore.exp:
77
78 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
79
80         Giving credit where credit is due.
81
82         * ChangeLog:
83
84 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
85
86         Reviewed by Geoff and Sam.
87
88         <rdar://problem/5770054> JavaScript profiler (10928)
89         Add the ability to get percentages of total and self time for displaying
90         in the WebInspector.
91
92         * profiler/Profile.h:
93         (KJS::Profile::totalProfileTime):
94         * profiler/ProfileNode.cpp:
95         (KJS::ProfileNode::totalPercent):
96         (KJS::ProfileNode::selfPercent):
97         * profiler/ProfileNode.h:
98         * profiler/Profiler.h:
99         (KJS::Profiler::currentProfile):
100
101 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
102
103         Reviewed by Sam.
104
105         <rdar://problem/5770054> JavaScript profiler (10928)
106         - Rename FunctionCallProfile to ProfileNode.
107
108         * GNUmakefile.am:
109         * JavaScriptCore.exp:
110         * JavaScriptCore.pri:
111         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
112         * JavaScriptCore.xcodeproj/project.pbxproj:
113         * JavaScriptCoreSources.bkl:
114         * profiler/FunctionCallProfile.cpp: Removed.
115         * profiler/FunctionCallProfile.h: Removed.
116         * profiler/Profile.cpp:
117         (KJS::Profile::Profile):
118         (KJS::Profile::willExecute):
119         * profiler/Profile.h:
120         (KJS::Profile::callTree):
121         * profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp.
122         (KJS::ProfileNode::ProfileNode):
123         (KJS::ProfileNode::willExecute):
124         (KJS::ProfileNode::didExecute):
125         (KJS::ProfileNode::addChild):
126         (KJS::ProfileNode::findChild):
127         (KJS::ProfileNode::stopProfiling):
128         (KJS::ProfileNode::selfTime):
129         (KJS::ProfileNode::printDataInspectorStyle):
130         (KJS::ProfileNode::printDataSampleStyle):
131         (KJS::ProfileNode::endAndRecordCall):
132         * profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h.
133         (KJS::ProfileNode::create):
134         (KJS::ProfileNode::children):
135         * profiler/Profiler.cpp:
136
137 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
138
139         Reviewed by John.
140
141         <rdar://problem/5770054> JavaScript profiler (10928)
142         - Have each FunctionCallProfile be able to return it's total and self time.
143
144         * JavaScriptCore.exp:
145         * profiler/FunctionCallProfile.cpp:
146         (KJS::FunctionCallProfile::selfTime):
147         * profiler/FunctionCallProfile.h:
148         (KJS::FunctionCallProfile::totalTime):
149
150 2008-05-14  Alexey Proskuryakov  <ap@webkit.org>
151
152         Reviewed by Darin.
153
154         <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
155
156         <https://bugs.webkit.org/show_bug.cgi?id=4931>
157         Unicode format characters (Cf) should be removed from JavaScript source
158
159         Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
160         settled upon, after extensive discussion and investigation.
161
162         Based on Darin's work on this bug.
163
164         Test: fast/js/removing-Cf-characters.html
165
166         * kjs/lexer.cpp:
167         (KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
168         first characters, instead of having special case code here.
169         (KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.
170
171 2008-05-13  Matt Lilek  <webkit@mattlilek.com>
172
173         Not reviewed, build fix.
174
175         * kjs/date_object.cpp:
176         (KJS::DateObjectFuncImp::callAsFunction):
177
178 2008-05-13  Anders Carlsson  <andersca@apple.com>
179
180         Reviewed by Sam.
181
182         <rdar://problem/5933644> Implement Date.now
183         
184         Implement Date.now which returns the number of milliseconds since the epoch.
185         
186         * kjs/CommonIdentifiers.h:
187         * kjs/date_object.cpp:
188         (KJS::DateObjectFuncImp::):
189         (KJS::DateObjectImp::DateObjectImp):
190         (KJS::DateObjectFuncImp::callAsFunction):
191
192 2008-05-13  Kevin McCullough  <kmccullough@apple.com>
193
194         Giving credit where credit is due.
195
196         * ChangeLog:
197
198 2008-05-13  Kevin McCullough  <kmccullough@apple.com>
199
200         Reviewed by Adam and Geoff.
201
202         <rdar://problem/5770054> JavaScript profiler (10928)
203         Use PassRefPtrs instead of RefPtrs when appropriate.
204
205         * profiler/FunctionCallProfile.cpp:
206         (KJS::FunctionCallProfile::addChild):
207         * profiler/FunctionCallProfile.h:
208         * profiler/Profile.h:
209         (KJS::Profile::callTree):
210
211 2008-05-13  Kevin McCullough  <kmccullough@apple.com>
212
213         Reviewed by Sam.
214
215         <rdar://problem/5770054> JavaScript profiler (10928)
216         - Made some functions static (as per Adam) and changed from using raw
217         pointers to RefPtr for making these JavaScript Objects.
218
219         * profiler/FunctionCallProfile.cpp:
220         (KJS::FunctionCallProfile::addChild):
221         (KJS::FunctionCallProfile::findChild):
222         * profiler/FunctionCallProfile.h:
223         (KJS::FunctionCallProfile::create):
224         * profiler/Profile.cpp:
225         (KJS::Profile::Profile):
226         (KJS::Profile::willExecute):
227         (KJS::Profile::didExecute):
228         (KJS::functionNameCountPairComparator):
229         * profiler/Profile.h:
230         (KJS::Profile::create):
231         (KJS::Profile::title):
232         (KJS::Profile::callTree):
233         * profiler/Profiler.cpp:
234         (KJS::Profiler::startProfiling):
235         * profiler/Profiler.h:
236         (KJS::Profiler::allProfiles):
237         (KJS::Profiler::clearProfiles):
238
239 2008-05-13  Alexey Proskuryakov  <ap@webkit.org>
240
241         Reviewed by Geoffrey Garen.
242
243         <rdar://problem/4949018> JavaScriptCore API claims to work with UTF8 strings, but only works
244         with ASCII strings
245         
246         * kjs/ustring.h:
247         * kjs/ustring.cpp:
248         (KJS::UString::Rep::createFromUTF8):
249         Added. Implementation adapted from JSStringCreateWithUTF8CString().
250
251         * API/JSStringRef.cpp:
252         (JSStringCreateWithUTF8CString):
253         * API/JSClassRef.cpp:
254         (OpaqueJSClass::OpaqueJSClass):
255         Use UString::Rep::createFromUTF8().
256
257 2008-05-12  Mark Rowe  <mrowe@apple.com>
258
259         Reviewed by Tim Hatcher.
260
261         <rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs
262
263         Create WebKit availability macros that key off the Mac OS X version being targeted to
264         determine the WebKit version being targeted.  Applications can define
265         WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
266         version of WebKit.
267
268         The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
269         is the lowest-level portion of the public WebKit API.
270
271         * API/WebKitAvailability.h: Added.
272         * JavaScriptCore.xcodeproj/project.pbxproj:
273
274 2008-05-12  Alexey Proskuryakov  <ap@webkit.org>
275
276         Reviewed by Maciej.
277
278         https://bugs.webkit.org/show_bug.cgi?id=18828
279         Reproducible crash with PAC file
280
281         Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
282         exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
283         disabling ThreadSpecific implementation until this can be sorted out.
284
285         * wtf/ThreadSpecific.h:
286         (WTF::::ThreadSpecific):
287         (WTF::::~ThreadSpecific):
288         (WTF::::get):
289         (WTF::::set):
290
291 2008-05-12  Alexey Proskuryakov  <ap@webkit.org>
292
293         Roll out recent  threading changes (r32807, r32810, r32819, r32822) to simplify
294         SquirrelFish merging.
295
296         * API/JSBase.cpp:
297         (JSGarbageCollect):
298         * API/JSCallbackObjectFunctions.h:
299         (KJS::::staticFunctionGetter):
300         * API/JSClassRef.cpp:
301         (OpaqueJSClass::prototype):
302         * API/JSObjectRef.cpp:
303         (JSObjectMake):
304         (JSObjectMakeFunctionWithCallback):
305         (JSObjectMakeConstructor):
306         (JSObjectMakeFunction):
307         * API/JSValueRef.cpp:
308         (JSValueMakeNumber):
309         (JSValueMakeString):
310         * JavaScriptCore.exp:
311         * kjs/ExecState.h:
312         * kjs/InitializeThreading.cpp:
313         (KJS::initializeThreadingOnce):
314         * kjs/JSGlobalObject.cpp:
315         (KJS::JSGlobalObject::~JSGlobalObject):
316         (KJS::JSGlobalObject::init):
317         (KJS::JSGlobalObject::put):
318         (KJS::JSGlobalObject::reset):
319         (KJS::JSGlobalObject::tearOffActivation):
320         * kjs/JSGlobalObject.h:
321         (KJS::JSGlobalObject::head):
322         (KJS::JSGlobalObject::perThreadData):
323         * kjs/JSLock.cpp:
324         (KJS::JSLock::registerThread):
325         * kjs/JSLock.h:
326         (KJS::JSLock::JSLock):
327         * kjs/array_instance.cpp:
328         (KJS::ArrayInstance::ArrayInstance):
329         (KJS::ArrayInstance::lengthGetter):
330         * kjs/array_object.cpp:
331         (KJS::arrayProtoFuncToString):
332         (KJS::arrayProtoFuncToLocaleString):
333         (KJS::arrayProtoFuncJoin):
334         (KJS::arrayProtoFuncConcat):
335         (KJS::arrayProtoFuncPop):
336         (KJS::arrayProtoFuncPush):
337         (KJS::arrayProtoFuncShift):
338         (KJS::arrayProtoFuncSlice):
339         (KJS::arrayProtoFuncSplice):
340         (KJS::arrayProtoFuncUnShift):
341         (KJS::arrayProtoFuncFilter):
342         (KJS::arrayProtoFuncMap):
343         (KJS::arrayProtoFuncEvery):
344         (KJS::arrayProtoFuncForEach):
345         (KJS::arrayProtoFuncSome):
346         (KJS::arrayProtoFuncIndexOf):
347         (KJS::arrayProtoFuncLastIndexOf):
348         (KJS::ArrayObjectImp::ArrayObjectImp):
349         (KJS::ArrayObjectImp::construct):
350         * kjs/bool_object.cpp:
351         (KJS::BooleanPrototype::BooleanPrototype):
352         (KJS::booleanProtoFuncToString):
353         (KJS::BooleanObjectImp::BooleanObjectImp):
354         (KJS::BooleanObjectImp::construct):
355         * kjs/collector.cpp:
356         (KJS::):
357         (KJS::allocateBlock):
358         (KJS::Collector::recordExtraCost):
359         (KJS::Collector::heapAllocate):
360         (KJS::Collector::allocate):
361         (KJS::Collector::allocateNumber):
362         (KJS::Collector::registerAsMainThread):
363         (KJS::onMainThread):
364         (KJS::PlatformThread::PlatformThread):
365         (KJS::getCurrentPlatformThread):
366         (KJS::Collector::Thread::Thread):
367         (KJS::destroyRegisteredThread):
368         (KJS::initializeRegisteredThreadKey):
369         (KJS::Collector::registerThread):
370         (KJS::Collector::markStackObjectsConservatively):
371         (KJS::Collector::markCurrentThreadConservativelyInternal):
372         (KJS::Collector::markCurrentThreadConservatively):
373         (KJS::suspendThread):
374         (KJS::resumeThread):
375         (KJS::getPlatformThreadRegisters):
376         (KJS::otherThreadStackPointer):
377         (KJS::Collector::markOtherThreadConservatively):
378         (KJS::protectedValues):
379         (KJS::Collector::protect):
380         (KJS::Collector::unprotect):
381         (KJS::Collector::collectOnMainThreadOnly):
382         (KJS::Collector::markProtectedObjects):
383         (KJS::Collector::markMainThreadOnlyObjects):
384         (KJS::Collector::sweep):
385         (KJS::Collector::collect):
386         (KJS::Collector::size):
387         (KJS::Collector::globalObjectCount):
388         (KJS::Collector::protectedGlobalObjectCount):
389         (KJS::Collector::protectedObjectCount):
390         (KJS::Collector::protectedObjectTypeCounts):
391         (KJS::Collector::isBusy):
392         (KJS::Collector::reportOutOfMemoryToAllExecStates):
393         * kjs/collector.h:
394         (KJS::):
395         (KJS::Collector::cellBlock):
396         (KJS::Collector::cellOffset):
397         (KJS::Collector::isCellMarked):
398         (KJS::Collector::markCell):
399         (KJS::Collector::reportExtraMemoryCost):
400         * kjs/date_object.cpp:
401         (KJS::formatLocaleDate):
402         (KJS::DatePrototype::DatePrototype):
403         (KJS::DateObjectImp::DateObjectImp):
404         (KJS::DateObjectImp::construct):
405         (KJS::DateObjectImp::callAsFunction):
406         (KJS::DateObjectFuncImp::DateObjectFuncImp):
407         (KJS::DateObjectFuncImp::callAsFunction):
408         (KJS::dateProtoFuncToString):
409         (KJS::dateProtoFuncToUTCString):
410         (KJS::dateProtoFuncToDateString):
411         (KJS::dateProtoFuncToTimeString):
412         (KJS::dateProtoFuncToLocaleString):
413         (KJS::dateProtoFuncToLocaleDateString):
414         (KJS::dateProtoFuncToLocaleTimeString):
415         (KJS::dateProtoFuncValueOf):
416         (KJS::dateProtoFuncGetTime):
417         (KJS::dateProtoFuncGetFullYear):
418         (KJS::dateProtoFuncGetUTCFullYear):
419         (KJS::dateProtoFuncToGMTString):
420         (KJS::dateProtoFuncGetMonth):
421         (KJS::dateProtoFuncGetUTCMonth):
422         (KJS::dateProtoFuncGetDate):
423         (KJS::dateProtoFuncGetUTCDate):
424         (KJS::dateProtoFuncGetDay):
425         (KJS::dateProtoFuncGetUTCDay):
426         (KJS::dateProtoFuncGetHours):
427         (KJS::dateProtoFuncGetUTCHours):
428         (KJS::dateProtoFuncGetMinutes):
429         (KJS::dateProtoFuncGetUTCMinutes):
430         (KJS::dateProtoFuncGetSeconds):
431         (KJS::dateProtoFuncGetUTCSeconds):
432         (KJS::dateProtoFuncGetMilliSeconds):
433         (KJS::dateProtoFuncGetUTCMilliseconds):
434         (KJS::dateProtoFuncGetTimezoneOffset):
435         (KJS::dateProtoFuncSetTime):
436         (KJS::setNewValueFromTimeArgs):
437         (KJS::setNewValueFromDateArgs):
438         (KJS::dateProtoFuncSetYear):
439         (KJS::dateProtoFuncGetYear):
440         * kjs/error_object.cpp:
441         (KJS::ErrorPrototype::ErrorPrototype):
442         (KJS::errorProtoFuncToString):
443         (KJS::ErrorObjectImp::ErrorObjectImp):
444         (KJS::ErrorObjectImp::construct):
445         (KJS::NativeErrorPrototype::NativeErrorPrototype):
446         (KJS::NativeErrorImp::NativeErrorImp):
447         (KJS::NativeErrorImp::construct):
448         * kjs/function.cpp:
449         (KJS::FunctionImp::lengthGetter):
450         (KJS::FunctionImp::construct):
451         (KJS::Arguments::Arguments):
452         (KJS::ActivationImp::createArgumentsObject):
453         (KJS::encode):
454         (KJS::decode):
455         (KJS::globalFuncParseInt):
456         (KJS::globalFuncParseFloat):
457         (KJS::globalFuncEscape):
458         (KJS::globalFuncUnescape):
459         (KJS::PrototypeFunction::PrototypeFunction):
460         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
461         * kjs/function_object.cpp:
462         (KJS::FunctionPrototype::FunctionPrototype):
463         (KJS::functionProtoFuncToString):
464         (KJS::FunctionObjectImp::FunctionObjectImp):
465         (KJS::FunctionObjectImp::construct):
466         * kjs/internal.cpp:
467         (KJS::StringImp::toObject):
468         * kjs/internal.h:
469         (KJS::StringImp::StringImp):
470         (KJS::NumberImp::operator new):
471         * kjs/list.cpp:
472         (KJS::List::markSet):
473         (KJS::List::markProtectedListsSlowCase):
474         (KJS::List::expandAndAppend):
475         * kjs/list.h:
476         (KJS::List::List):
477         (KJS::List::~List):
478         (KJS::List::markProtectedLists):
479         * kjs/lookup.h:
480         (KJS::staticFunctionGetter):
481         (KJS::cacheGlobalObject):
482         * kjs/math_object.cpp:
483         (KJS::MathObjectImp::getValueProperty):
484         (KJS::mathProtoFuncAbs):
485         (KJS::mathProtoFuncACos):
486         (KJS::mathProtoFuncASin):
487         (KJS::mathProtoFuncATan):
488         (KJS::mathProtoFuncATan2):
489         (KJS::mathProtoFuncCeil):
490         (KJS::mathProtoFuncCos):
491         (KJS::mathProtoFuncExp):
492         (KJS::mathProtoFuncFloor):
493         (KJS::mathProtoFuncLog):
494         (KJS::mathProtoFuncMax):
495         (KJS::mathProtoFuncMin):
496         (KJS::mathProtoFuncPow):
497         (KJS::mathProtoFuncRandom):
498         (KJS::mathProtoFuncRound):
499         (KJS::mathProtoFuncSin):
500         (KJS::mathProtoFuncSqrt):
501         (KJS::mathProtoFuncTan):
502         * kjs/nodes.cpp:
503         (KJS::ParserRefCounted::ParserRefCounted):
504         (KJS::ParserRefCounted::ref):
505         (KJS::ParserRefCounted::deref):
506         (KJS::ParserRefCounted::refcount):
507         (KJS::ParserRefCounted::deleteNewObjects):
508         (KJS::Node::handleException):
509         (KJS::NumberNode::evaluate):
510         (KJS::StringNode::evaluate):
511         (KJS::ArrayNode::evaluate):
512         (KJS::PostIncResolveNode::evaluate):
513         (KJS::PostIncLocalVarNode::evaluate):
514         (KJS::PostDecResolveNode::evaluate):
515         (KJS::PostDecLocalVarNode::evaluate):
516         (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
517         (KJS::PostIncBracketNode::evaluate):
518         (KJS::PostDecBracketNode::evaluate):
519         (KJS::PostIncDotNode::evaluate):
520         (KJS::PostDecDotNode::evaluate):
521         (KJS::typeStringForValue):
522         (KJS::LocalVarTypeOfNode::evaluate):
523         (KJS::TypeOfResolveNode::evaluate):
524         (KJS::TypeOfValueNode::evaluate):
525         (KJS::PreIncLocalVarNode::evaluate):
526         (KJS::PreIncResolveNode::evaluate):
527         (KJS::PreDecLocalVarNode::evaluate):
528         (KJS::PreDecResolveNode::evaluate):
529         (KJS::PreIncConstNode::evaluate):
530         (KJS::PreDecConstNode::evaluate):
531         (KJS::PostIncConstNode::evaluate):
532         (KJS::PostDecConstNode::evaluate):
533         (KJS::PreIncBracketNode::evaluate):
534         (KJS::PreDecBracketNode::evaluate):
535         (KJS::PreIncDotNode::evaluate):
536         (KJS::PreDecDotNode::evaluate):
537         (KJS::NegateNode::evaluate):
538         (KJS::BitwiseNotNode::evaluate):
539         (KJS::MultNode::evaluate):
540         (KJS::DivNode::evaluate):
541         (KJS::ModNode::evaluate):
542         (KJS::addSlowCase):
543         (KJS::add):
544         (KJS::AddNumbersNode::evaluate):
545         (KJS::AddStringsNode::evaluate):
546         (KJS::AddStringLeftNode::evaluate):
547         (KJS::AddStringRightNode::evaluate):
548         (KJS::SubNode::evaluate):
549         (KJS::LeftShiftNode::evaluate):
550         (KJS::RightShiftNode::evaluate):
551         (KJS::UnsignedRightShiftNode::evaluate):
552         (KJS::BitXOrNode::evaluate):
553         (KJS::BitOrNode::evaluate):
554         (KJS::valueForReadModifyAssignment):
555         (KJS::ForInNode::execute):
556         (KJS::TryNode::execute):
557         (KJS::FuncDeclNode::makeFunction):
558         (KJS::FuncExprNode::evaluate):
559         * kjs/nodes.h:
560         * kjs/number_object.cpp:
561         (KJS::NumberPrototype::NumberPrototype):
562         (KJS::numberProtoFuncToString):
563         (KJS::numberProtoFuncToLocaleString):
564         (KJS::numberProtoFuncToFixed):
565         (KJS::numberProtoFuncToExponential):
566         (KJS::numberProtoFuncToPrecision):
567         (KJS::NumberObjectImp::NumberObjectImp):
568         (KJS::NumberObjectImp::getValueProperty):
569         (KJS::NumberObjectImp::construct):
570         (KJS::NumberObjectImp::callAsFunction):
571         * kjs/object.cpp:
572         (KJS::JSObject::call):
573         (KJS::JSObject::get):
574         (KJS::JSObject::put):
575         (KJS::JSObject::defineGetter):
576         (KJS::JSObject::defineSetter):
577         (KJS::JSObject::putDirect):
578         (KJS::Error::create):
579         * kjs/object.h:
580         * kjs/object_object.cpp:
581         (KJS::ObjectPrototype::ObjectPrototype):
582         (KJS::objectProtoFuncToLocaleString):
583         (KJS::objectProtoFuncToString):
584         (KJS::ObjectObjectImp::ObjectObjectImp):
585         (KJS::ObjectObjectImp::construct):
586         * kjs/property_map.h:
587         (KJS::SavedProperty::SavedProperty):
588         (KJS::SavedProperty::init):
589         (KJS::SavedProperty::~SavedProperty):
590         (KJS::SavedProperty::name):
591         (KJS::SavedProperty::value):
592         (KJS::SavedProperty::attributes):
593         * kjs/protect.h:
594         (KJS::gcProtect):
595         (KJS::gcUnprotect):
596         * kjs/regexp_object.cpp:
597         (KJS::RegExpPrototype::RegExpPrototype):
598         (KJS::regExpProtoFuncToString):
599         (KJS::RegExpImp::getValueProperty):
600         (KJS::RegExpObjectImp::RegExpObjectImp):
601         (KJS::RegExpObjectImp::arrayOfMatches):
602         (KJS::RegExpObjectImp::getBackref):
603         (KJS::RegExpObjectImp::getLastParen):
604         (KJS::RegExpObjectImp::getLeftContext):
605         (KJS::RegExpObjectImp::getRightContext):
606         (KJS::RegExpObjectImp::getValueProperty):
607         (KJS::RegExpObjectImp::createRegExpImp):
608         * kjs/regexp_object.h:
609         * kjs/string_object.cpp:
610         (KJS::StringInstance::StringInstance):
611         (KJS::StringInstance::lengthGetter):
612         (KJS::StringInstance::indexGetter):
613         (KJS::stringInstanceNumericPropertyGetter):
614         (KJS::StringPrototype::StringPrototype):
615         (KJS::replace):
616         (KJS::stringProtoFuncCharAt):
617         (KJS::stringProtoFuncCharCodeAt):
618         (KJS::stringProtoFuncConcat):
619         (KJS::stringProtoFuncIndexOf):
620         (KJS::stringProtoFuncLastIndexOf):
621         (KJS::stringProtoFuncMatch):
622         (KJS::stringProtoFuncSearch):
623         (KJS::stringProtoFuncReplace):
624         (KJS::stringProtoFuncSlice):
625         (KJS::stringProtoFuncSplit):
626         (KJS::stringProtoFuncSubstr):
627         (KJS::stringProtoFuncSubstring):
628         (KJS::stringProtoFuncToLowerCase):
629         (KJS::stringProtoFuncToUpperCase):
630         (KJS::stringProtoFuncToLocaleLowerCase):
631         (KJS::stringProtoFuncToLocaleUpperCase):
632         (KJS::stringProtoFuncLocaleCompare):
633         (KJS::stringProtoFuncBig):
634         (KJS::stringProtoFuncSmall):
635         (KJS::stringProtoFuncBlink):
636         (KJS::stringProtoFuncBold):
637         (KJS::stringProtoFuncFixed):
638         (KJS::stringProtoFuncItalics):
639         (KJS::stringProtoFuncStrike):
640         (KJS::stringProtoFuncSub):
641         (KJS::stringProtoFuncSup):
642         (KJS::stringProtoFuncFontcolor):
643         (KJS::stringProtoFuncFontsize):
644         (KJS::stringProtoFuncAnchor):
645         (KJS::stringProtoFuncLink):
646         (KJS::StringObjectImp::StringObjectImp):
647         (KJS::StringObjectImp::construct):
648         (KJS::StringObjectImp::callAsFunction):
649         (KJS::StringObjectFuncImp::StringObjectFuncImp):
650         (KJS::StringObjectFuncImp::callAsFunction):
651         * kjs/string_object.h:
652         (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
653         * kjs/testkjs.cpp:
654         (GlobalObject::GlobalObject):
655         (functionGC):
656         (functionRun):
657         (functionReadline):
658         (kjsmain):
659         * kjs/ustring.h:
660         * kjs/value.cpp:
661         (KJS::JSCell::operator new):
662         (KJS::jsString):
663         (KJS::jsOwnedString):
664         (KJS::jsNumberCell):
665         * kjs/value.h:
666         (KJS::jsNaN):
667         (KJS::jsNumber):
668         (KJS::jsNumberFromAnd):
669         (KJS::JSCell::marked):
670         (KJS::JSCell::mark):
671         (KJS::JSValue::toJSNumber):
672         * wtf/ThreadSpecific.h:
673         (WTF::T):
674
675 2008-05-10  Julien Chaffraix  <jchaffraix@webkit.org>
676
677         Qt & wx build fix.
678
679         * JavaScriptCore.pri: Add profiler/Profile.cpp.
680         * JavaScriptCoreSources.bkl: Ditto.
681
682 2008-05-10  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
683
684         Reviewed by Maciej.
685
686         Gtk+ build fix
687
688         * GNUmakefile.am: Add Profile.cpp in _sources
689
690 2008-05-09  Brady Eidson  <beidson@apple.com>
691
692         Build Fix.  Kevin is an idiot.  
693         ("My name is Kevin McCullough and I approve this message.")
694
695         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
696
697 2008-05-09  Kevin McCullough  <kmccullough@apple.com>
698
699         Reviewed by Tim.
700
701         -<rdar://problem/5770054> JavaScript profiler (10928)
702         -Add Profile class so that all profiles can be stored and retrieved by
703         the WebInspector when that time comes.
704
705         * JavaScriptCore.exp: Export the new function signatures.
706         * JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
707         project
708         * profiler/Profile.cpp: Added. This class represents a single run of the
709         profiler.
710         (KJS::Profile::Profile):
711         (KJS::Profile::willExecute):
712         (KJS::Profile::didExecute):
713         (KJS::Profile::printDataInspectorStyle):
714         (KJS::functionNameCountPairComparator):
715         (KJS::Profile::printDataSampleStyle):
716         * profiler/Profile.h: Added. Ditto
717         (KJS::Profile::stopProfiling):
718         * profiler/Profiler.cpp: Now the profiler keeps track of many profiles
719         but only runs one at a time.
720         (KJS::Profiler::startProfiling):
721         (KJS::Profiler::stopProfiling):
722         (KJS::Profiler::willExecute):
723         (KJS::Profiler::didExecute):
724         (KJS::Profiler::printDataInspectorStyle):
725         (KJS::Profiler::printDataSampleStyle):
726         * profiler/Profiler.h: Ditto.
727         (KJS::Profiler::~Profiler):
728         (KJS::Profiler::allProfiles):
729         (KJS::Profiler::clearProfiles):
730
731 2008-05-08  Anders Carlsson  <andersca@apple.com>
732
733         Reviewed by Mark.
734
735         Enable NPAPI plug-ins on 64-bit.
736         
737         * wtf/Platform.h:
738
739 2008-05-07  Julien Chaffraix  <jchaffraix@webkit.org>
740
741         Reviewed by Adam Roben.
742
743         wx & Gtk build fix.
744
745         Add SIZE_MAX definition for the wx port.
746
747         * os-win32/stdint.h:
748
749 2008-05-07  Ariya Hidayat  <ariya.hidayat@trolltech.com>
750
751         Reviewed by Simon.
752
753         Support for isMainThread in the Qt port.
754
755         * wtf/ThreadingQt.cpp:
756         (WTF::initializeThreading): Adjusted.
757         (WTF::isMainThread): Added.
758
759 2008-05-05  Darin Adler  <darin@apple.com>
760
761         Reviewed by John Sullivan.
762
763         - fix debug-only leak seen on buildbot
764
765         * wtf/HashTable.h:
766         (WTF::HashTable::checkKey): After writing an empty value in, but before constructing a
767         deleted value on top of it, call the destructor so the empty value doesn't leak.
768
769 2008-05-02  Alexey Proskuryakov  <ap@webkit.org>
770
771         Reviewed by Geoffrey Garen.
772
773         Get rid of static data in nodes.cpp (well, at least of non-debug one).
774
775         No measurable change on SunSpider.
776
777         * kjs/InitializeThreading.cpp:
778         (KJS::initializeThreadingOnce):
779         * kjs/nodes.cpp:
780         (KJS::newTrackedObjects):
781         (KJS::trackedObjectExtraRefCounts):
782         (KJS::initializeNodesThreading):
783         (KJS::ParserRefCounted::ParserRefCounted):
784         (KJS::ParserRefCounted::ref):
785         (KJS::ParserRefCounted::deref):
786         (KJS::ParserRefCounted::refcount):
787         (KJS::ParserRefCounted::deleteNewObjects):
788         * kjs/nodes.h:
789         Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
790
791 2008-05-02  Alexey Proskuryakov  <ap@webkit.org>
792
793         Reviewed by Darin.
794
795         Move call stack depth counter to global object.
796
797         * kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
798         per-thread data.
799         * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
800         * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
801
802         * kjs/object.cpp:
803         (KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
804         the only thing in JSObject::call that needs a PIC branch.
805         (KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
806         tracking.
807
808 2008-05-02  Alexey Proskuryakov  <ap@webkit.org>
809
810         Reviewed by Darin.
811
812         Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
813         for the sake of non-WebKit clients.
814
815         * API/JSBase.cpp:
816         (JSGarbageCollect):
817         * API/JSContextRef.cpp:
818         (JSGlobalContextCreate):
819         These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
820         and JSClassRef functions that can be called earlier, but they do not do anything that
821         requires initializeThreading.
822
823         * kjs/InitializeThreading.cpp:
824         (KJS::doInitializeThreading):
825         (KJS::initializeThreading):
826         On Darwin, make the initialization happen under pthread_once, since there is no guarantee
827         that non-WebKit clients won't try to call this function re-entrantly.
828
829         * kjs/InitializeThreading.h:
830         * wtf/Threading.h:
831         Spell out initializeThreading contract.
832
833         * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
834         Darwin, even if threading was initialized from a secondary thread.
835
836 2008-05-02  Alexey Proskuryakov  <ap@webkit.org>
837
838         Reviewed by Geoffrey Garen.
839
840         https://bugs.webkit.org/show_bug.cgi?id=18826
841         Make JavaScript heap per-thread
842
843         * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
844         (replaced "new T" with "new T()").
845
846         * kjs/collector.h: Renamed Collector to Heap, made the heap per-thread. Removed support for
847         multithreaded access to a heap.
848         (KJS::CollectorBlock): Removed collectOnMainThreadOnly bitmap, added a reference to owner heap.
849         (KJS::SmallCellCollectorBlock): Ditto.
850         (KJS::Heap::markListSet): Moved from a static variable in List.cpp to a per-thread one here.
851         (KJS::Heap::heap): Added a method to find which heap a JSValue is allocated in.
852
853         * kjs/collector.cpp: Changed "const size_t" constants to #defines, to avoid a PIC branch
854         (gcc was using one to access a constant used in std::max(), because it takes a reference,
855         even though std::max() itself was inlined).
856         (KJS::Heap::threadHeap): JS heap is now per-thread.
857         (KJS::Heap::Heap): Zero-initialize the heap.
858         (KJS::allocateBlock): Added NEVER_INLINE, because this function uses a PIC branch, so
859         inlining it in Heap::heapAllocate() is bad for performance, now that the latter doesn't
860         use any global data.
861         (KJS::Heap::heapAllocate): Initialize Block::heap.
862         (KJS::Heap::markCurrentThreadConservatively): Moved into markStackObjectsConservatively(),
863         as GC only works with a current thread's heap now.
864         (KJS::Heap::sweep): Removed collectOnMainThreadOnly checks.
865         (KJS::Heap::collect): Ditto.
866
867         * kjs/JSLock.cpp:
868         * kjs/JSLock.h:
869         (KJS::JSLock::JSLock):
870         Removed registerThread(), as the heap no longer cares.
871
872         * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize new per-thread
873         variables in Heap and JSGlobalObject.
874
875         * kjs/ExecState.h: (KJS::ExecState::heap): Added a heap pointer for faster access to
876         per-thread heap, and an accessor for it.
877
878         * kjs/JSGlobalObject.h: Made JSGlobalObject linked list per-thread.
879         * kjs/JSGlobalObject.cpp:
880         (KJS::JSGlobalObject::~JSGlobalObject): Fixed a bug in linked list handling. It only worked
881         right if the removed object was the head one!
882         (KJS::JSGlobalObject::head): Return a per-thread list head.
883         (KJS::JSGlobalObject::init): Store a reference to per-thread heap.
884         (KJS::JSGlobalObject::reset): Pass ExecState to functions that need it.
885         (KJS::JSGlobalObject::tearOffActivation): Ditto.
886         (KJS::JSGlobalObject::operator new): JSGlobalObject allocation cannot use an ExecState,
887         so it needs a custom operator new that directly accesses per-thread heap.
888
889         * kjs/list.h:
890         (KJS::List::List): Replaced m_isInMarkSet boolean with an actual pointer to the set, since it
891         is no longer a single static object.
892         (KJS::List::~List): Ditto.
893         * kjs/list.cpp:
894         (KJS::List::markSet): Removed, this is now stored in Heap.
895         (KJS::List::markProtectedLists): Take a reference to the list.
896         (KJS::List::expandAndAppend): Ask the current thread heap for a mark set reference.
897
898         * kjs/protect.h:
899         (KJS::gcProtect):
900         (KJS::gcUnprotect):
901         Use the newly added Heap::heap() method to find out which heap the value to be (un)protected
902         belongs to.
903
904         * kjs/property_map.h: Removed unused SavedProperty class.
905
906         * JavaScriptCore.exp:
907         * API/JSBase.cpp:
908         (JSGarbageCollect):
909         * API/JSCallbackObjectFunctions.h:
910         (KJS::::staticFunctionGetter):
911         * API/JSClassRef.cpp:
912         (OpaqueJSClass::prototype):
913         * API/JSObjectRef.cpp:
914         (JSObjectMake):
915         (JSObjectMakeFunctionWithCallback):
916         (JSObjectMakeConstructor):
917         (JSObjectMakeFunction):
918         * API/JSValueRef.cpp:
919         (JSValueMakeNumber):
920         (JSValueMakeString):
921         * kjs/array_instance.cpp:
922         (KJS::ArrayInstance::ArrayInstance):
923         (KJS::ArrayInstance::lengthGetter):
924         * kjs/array_object.cpp:
925         (KJS::arrayProtoFuncToString):
926         (KJS::arrayProtoFuncToLocaleString):
927         (KJS::arrayProtoFuncJoin):
928         (KJS::arrayProtoFuncConcat):
929         (KJS::arrayProtoFuncPop):
930         (KJS::arrayProtoFuncPush):
931         (KJS::arrayProtoFuncShift):
932         (KJS::arrayProtoFuncSlice):
933         (KJS::arrayProtoFuncSplice):
934         (KJS::arrayProtoFuncUnShift):
935         (KJS::arrayProtoFuncFilter):
936         (KJS::arrayProtoFuncMap):
937         (KJS::arrayProtoFuncEvery):
938         (KJS::arrayProtoFuncForEach):
939         (KJS::arrayProtoFuncSome):
940         (KJS::arrayProtoFuncIndexOf):
941         (KJS::arrayProtoFuncLastIndexOf):
942         (KJS::ArrayObjectImp::ArrayObjectImp):
943         (KJS::ArrayObjectImp::construct):
944         * kjs/bool_object.cpp:
945         (KJS::BooleanPrototype::BooleanPrototype):
946         (KJS::booleanProtoFuncToString):
947         (KJS::BooleanObjectImp::BooleanObjectImp):
948         (KJS::BooleanObjectImp::construct):
949         * kjs/date_object.cpp:
950         (KJS::formatLocaleDate):
951         (KJS::DatePrototype::DatePrototype):
952         (KJS::DateObjectImp::DateObjectImp):
953         (KJS::DateObjectImp::construct):
954         (KJS::DateObjectImp::callAsFunction):
955         (KJS::DateObjectFuncImp::DateObjectFuncImp):
956         (KJS::DateObjectFuncImp::callAsFunction):
957         (KJS::dateProtoFuncToString):
958         (KJS::dateProtoFuncToUTCString):
959         (KJS::dateProtoFuncToDateString):
960         (KJS::dateProtoFuncToTimeString):
961         (KJS::dateProtoFuncToLocaleString):
962         (KJS::dateProtoFuncToLocaleDateString):
963         (KJS::dateProtoFuncToLocaleTimeString):
964         (KJS::dateProtoFuncValueOf):
965         (KJS::dateProtoFuncGetTime):
966         (KJS::dateProtoFuncGetFullYear):
967         (KJS::dateProtoFuncGetUTCFullYear):
968         (KJS::dateProtoFuncToGMTString):
969         (KJS::dateProtoFuncGetMonth):
970         (KJS::dateProtoFuncGetUTCMonth):
971         (KJS::dateProtoFuncGetDate):
972         (KJS::dateProtoFuncGetUTCDate):
973         (KJS::dateProtoFuncGetDay):
974         (KJS::dateProtoFuncGetUTCDay):
975         (KJS::dateProtoFuncGetHours):
976         (KJS::dateProtoFuncGetUTCHours):
977         (KJS::dateProtoFuncGetMinutes):
978         (KJS::dateProtoFuncGetUTCMinutes):
979         (KJS::dateProtoFuncGetSeconds):
980         (KJS::dateProtoFuncGetUTCSeconds):
981         (KJS::dateProtoFuncGetMilliSeconds):
982         (KJS::dateProtoFuncGetUTCMilliseconds):
983         (KJS::dateProtoFuncGetTimezoneOffset):
984         (KJS::dateProtoFuncSetTime):
985         (KJS::setNewValueFromTimeArgs):
986         (KJS::setNewValueFromDateArgs):
987         (KJS::dateProtoFuncSetYear):
988         (KJS::dateProtoFuncGetYear):
989         * kjs/error_object.cpp:
990         (KJS::ErrorPrototype::ErrorPrototype):
991         (KJS::errorProtoFuncToString):
992         (KJS::ErrorObjectImp::ErrorObjectImp):
993         (KJS::ErrorObjectImp::construct):
994         (KJS::NativeErrorPrototype::NativeErrorPrototype):
995         (KJS::NativeErrorImp::NativeErrorImp):
996         (KJS::NativeErrorImp::construct):
997         * kjs/function.cpp:
998         (KJS::FunctionImp::lengthGetter):
999         (KJS::FunctionImp::construct):
1000         (KJS::Arguments::Arguments):
1001         (KJS::ActivationImp::createArgumentsObject):
1002         (KJS::encode):
1003         (KJS::decode):
1004         (KJS::globalFuncParseInt):
1005         (KJS::globalFuncParseFloat):
1006         (KJS::globalFuncEscape):
1007         (KJS::globalFuncUnescape):
1008         (KJS::PrototypeFunction::PrototypeFunction):
1009         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
1010         * kjs/function_object.cpp:
1011         (KJS::FunctionPrototype::FunctionPrototype):
1012         (KJS::functionProtoFuncToString):
1013         (KJS::FunctionObjectImp::FunctionObjectImp):
1014         (KJS::FunctionObjectImp::construct):
1015         * kjs/internal.cpp:
1016         (KJS::StringImp::toObject):
1017         * kjs/internal.h:
1018         (KJS::StringImp::StringImp):
1019         (KJS::NumberImp::operator new):
1020         * kjs/lookup.h:
1021         (KJS::staticFunctionGetter):
1022         (KJS::cacheGlobalObject):
1023         * kjs/math_object.cpp:
1024         (KJS::MathObjectImp::getValueProperty):
1025         (KJS::mathProtoFuncAbs):
1026         (KJS::mathProtoFuncACos):
1027         (KJS::mathProtoFuncASin):
1028         (KJS::mathProtoFuncATan):
1029         (KJS::mathProtoFuncATan2):
1030         (KJS::mathProtoFuncCeil):
1031         (KJS::mathProtoFuncCos):
1032         (KJS::mathProtoFuncExp):
1033         (KJS::mathProtoFuncFloor):
1034         (KJS::mathProtoFuncLog):
1035         (KJS::mathProtoFuncMax):
1036         (KJS::mathProtoFuncMin):
1037         (KJS::mathProtoFuncPow):
1038         (KJS::mathProtoFuncRandom):
1039         (KJS::mathProtoFuncRound):
1040         (KJS::mathProtoFuncSin):
1041         (KJS::mathProtoFuncSqrt):
1042         (KJS::mathProtoFuncTan):
1043         * kjs/nodes.cpp:
1044         (KJS::Node::handleException):
1045         (KJS::NumberNode::evaluate):
1046         (KJS::StringNode::evaluate):
1047         (KJS::ArrayNode::evaluate):
1048         (KJS::PostIncResolveNode::evaluate):
1049         (KJS::PostIncLocalVarNode::evaluate):
1050         (KJS::PostDecResolveNode::evaluate):
1051         (KJS::PostDecLocalVarNode::evaluate):
1052         (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
1053         (KJS::PostIncBracketNode::evaluate):
1054         (KJS::PostDecBracketNode::evaluate):
1055         (KJS::PostIncDotNode::evaluate):
1056         (KJS::PostDecDotNode::evaluate):
1057         (KJS::typeStringForValue):
1058         (KJS::LocalVarTypeOfNode::evaluate):
1059         (KJS::TypeOfResolveNode::evaluate):
1060         (KJS::TypeOfValueNode::evaluate):
1061         (KJS::PreIncLocalVarNode::evaluate):
1062         (KJS::PreIncResolveNode::evaluate):
1063         (KJS::PreDecLocalVarNode::evaluate):
1064         (KJS::PreDecResolveNode::evaluate):
1065         (KJS::PreIncConstNode::evaluate):
1066         (KJS::PreDecConstNode::evaluate):
1067         (KJS::PostIncConstNode::evaluate):
1068         (KJS::PostDecConstNode::evaluate):
1069         (KJS::PreIncBracketNode::evaluate):
1070         (KJS::PreDecBracketNode::evaluate):
1071         (KJS::PreIncDotNode::evaluate):
1072         (KJS::PreDecDotNode::evaluate):
1073         (KJS::NegateNode::evaluate):
1074         (KJS::BitwiseNotNode::evaluate):
1075         (KJS::MultNode::evaluate):
1076         (KJS::DivNode::evaluate):
1077         (KJS::ModNode::evaluate):
1078         (KJS::addSlowCase):
1079         (KJS::add):
1080         (KJS::AddNumbersNode::evaluate):
1081         (KJS::AddStringsNode::evaluate):
1082         (KJS::AddStringLeftNode::evaluate):
1083         (KJS::AddStringRightNode::evaluate):
1084         (KJS::SubNode::evaluate):
1085         (KJS::LeftShiftNode::evaluate):
1086         (KJS::RightShiftNode::evaluate):
1087         (KJS::UnsignedRightShiftNode::evaluate):
1088         (KJS::BitXOrNode::evaluate):
1089         (KJS::BitOrNode::evaluate):
1090         (KJS::valueForReadModifyAssignment):
1091         (KJS::ForInNode::execute):
1092         (KJS::TryNode::execute):
1093         (KJS::FuncDeclNode::makeFunction):
1094         (KJS::FuncExprNode::evaluate):
1095         * kjs/number_object.cpp:
1096         (KJS::NumberPrototype::NumberPrototype):
1097         (KJS::numberProtoFuncToString):
1098         (KJS::numberProtoFuncToLocaleString):
1099         (KJS::numberProtoFuncToFixed):
1100         (KJS::numberProtoFuncToExponential):
1101         (KJS::numberProtoFuncToPrecision):
1102         (KJS::NumberObjectImp::NumberObjectImp):
1103         (KJS::NumberObjectImp::getValueProperty):
1104         (KJS::NumberObjectImp::construct):
1105         (KJS::NumberObjectImp::callAsFunction):
1106         * kjs/object.cpp:
1107         (KJS::JSObject::defineGetter):
1108         (KJS::JSObject::defineSetter):
1109         (KJS::JSObject::putDirect):
1110         (KJS::Error::create):
1111         * kjs/object.h:
1112         * kjs/object_object.cpp:
1113         (KJS::ObjectPrototype::ObjectPrototype):
1114         (KJS::objectProtoFuncToLocaleString):
1115         (KJS::objectProtoFuncToString):
1116         (KJS::ObjectObjectImp::ObjectObjectImp):
1117         (KJS::ObjectObjectImp::construct):
1118         * kjs/regexp_object.cpp:
1119         (KJS::RegExpPrototype::RegExpPrototype):
1120         (KJS::regExpProtoFuncToString):
1121         (KJS::RegExpImp::getValueProperty):
1122         (KJS::RegExpObjectImp::RegExpObjectImp):
1123         (KJS::RegExpObjectImp::arrayOfMatches):
1124         (KJS::RegExpObjectImp::getBackref):
1125         (KJS::RegExpObjectImp::getLastParen):
1126         (KJS::RegExpObjectImp::getLeftContext):
1127         (KJS::RegExpObjectImp::getRightContext):
1128         (KJS::RegExpObjectImp::getValueProperty):
1129         (KJS::RegExpObjectImp::createRegExpImp):
1130         * kjs/regexp_object.h:
1131         * kjs/string_object.cpp:
1132         (KJS::StringInstance::StringInstance):
1133         (KJS::StringInstance::lengthGetter):
1134         (KJS::StringInstance::indexGetter):
1135         (KJS::stringInstanceNumericPropertyGetter):
1136         (KJS::StringPrototype::StringPrototype):
1137         (KJS::replace):
1138         (KJS::stringProtoFuncCharAt):
1139         (KJS::stringProtoFuncCharCodeAt):
1140         (KJS::stringProtoFuncConcat):
1141         (KJS::stringProtoFuncIndexOf):
1142         (KJS::stringProtoFuncLastIndexOf):
1143         (KJS::stringProtoFuncMatch):
1144         (KJS::stringProtoFuncSearch):
1145         (KJS::stringProtoFuncReplace):
1146         (KJS::stringProtoFuncSlice):
1147         (KJS::stringProtoFuncSplit):
1148         (KJS::stringProtoFuncSubstr):
1149         (KJS::stringProtoFuncSubstring):
1150         (KJS::stringProtoFuncToLowerCase):
1151         (KJS::stringProtoFuncToUpperCase):
1152         (KJS::stringProtoFuncToLocaleLowerCase):
1153         (KJS::stringProtoFuncToLocaleUpperCase):
1154         (KJS::stringProtoFuncLocaleCompare):
1155         (KJS::stringProtoFuncBig):
1156         (KJS::stringProtoFuncSmall):
1157         (KJS::stringProtoFuncBlink):
1158         (KJS::stringProtoFuncBold):
1159         (KJS::stringProtoFuncFixed):
1160         (KJS::stringProtoFuncItalics):
1161         (KJS::stringProtoFuncStrike):
1162         (KJS::stringProtoFuncSub):
1163         (KJS::stringProtoFuncSup):
1164         (KJS::stringProtoFuncFontcolor):
1165         (KJS::stringProtoFuncFontsize):
1166         (KJS::stringProtoFuncAnchor):
1167         (KJS::stringProtoFuncLink):
1168         (KJS::StringObjectImp::StringObjectImp):
1169         (KJS::StringObjectImp::construct):
1170         (KJS::StringObjectImp::callAsFunction):
1171         (KJS::StringObjectFuncImp::StringObjectFuncImp):
1172         (KJS::StringObjectFuncImp::callAsFunction):
1173         * kjs/string_object.h:
1174         (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1175         * kjs/testkjs.cpp:
1176         (GlobalObject::GlobalObject):
1177         (functionGC):
1178         (functionRun):
1179         (functionReadline):
1180         (kjsmain):
1181         * kjs/ustring.h:
1182         * kjs/value.cpp:
1183         (KJS::JSCell::operator new):
1184         (KJS::jsString):
1185         (KJS::jsOwnedString):
1186         (KJS::jsNumberCell):
1187         * kjs/value.h:
1188         (KJS::jsNaN):
1189         (KJS::jsNumber):
1190         (KJS::jsNumberFromAnd):
1191         (KJS::JSCell::marked):
1192         (KJS::JSCell::mark):
1193         (KJS::JSValue::toJSNumber):
1194         Removed collectOnMainThreadOnly, as this is the only way to collect now. Replaced calls to
1195         static Collector methods with calls to per-thread Heap ones.
1196
1197 2008-05-02  Dan Bernstein  <mitz@apple.com>
1198
1199         Reviewed by Maciej Stachowiak.
1200
1201         - Mac build fix
1202
1203         * wtf/StrHash.h: Added header guards and removed #include "config.h".
1204
1205 2008-05-01  Ada Chan  <adachan@apple.com>
1206
1207         #include <wtf/StrHash.h> in identifier.cpp.
1208
1209         Reviewed by Maciej.
1210
1211         * kjs/identifier.cpp:
1212
1213 2008-05-01  Steve Falkenburg  <sfalken@apple.com>
1214
1215         Build fix.
1216
1217         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1218
1219 2008-05-01  Sam Weinig  <sam@webkit.org>
1220
1221         Fix build.
1222
1223         * JavaScriptCore.xcodeproj/project.pbxproj:
1224
1225 2008-05-01  Kevin McCullough  <kmccullough@apple.com>
1226
1227         Reviewed by Darin.
1228
1229         <rdar://problem/5770054> JavaScript profiler (10928)
1230         - Fix "sample" output so that it can be imported into Instruments
1231         - Also keep track of number of times a function is profiled.
1232
1233         * JavaScriptCore.xcodeproj/project.pbxproj: Add StrHash.h which needed
1234         to be pulled out of identifier.cpp so that it could be used by the
1235         profiler and identifiers.
1236         * kjs/identifier.cpp: Ditto.
1237         * profiler/FunctionCallProfile.cpp:
1238         (KJS::FunctionCallProfile::printDataInspectorStyle): Inspector style
1239         printing should show microseconds.
1240         (KJS::FunctionCallProfile::printDataSampleStyle): Sample style printing
1241         now counts the number of times a function is in the stack tree and does
1242         not print microseconds since that does not make sense for a sampler.
1243         * profiler/FunctionCallProfile.h: Keep track of number of times a
1244         function is profiled.
1245         (KJS::FunctionCallProfile::numberOfCalls):
1246         * profiler/Profiler.cpp:
1247         (KJS::functionNameCountPairComparator): Comparator for sort function in
1248         printDataSampleStyle.
1249         (KJS::Profiler::printDataSampleStyle): Print the number of times that a
1250         function is listed in the stack tree in order of most times listed.
1251         * wtf/HashCountedSet.h: Added copyToVector since it didn't exist and is
1252         a more standard way to copy a HashSet to a Vector. I added on variant
1253         that takes a pair as the Vector's type and so the HashCountedSet simply
1254         fills in that pair with its internal pair, and another variant that
1255         takes a Vector of the type of the HashCountedSet and only fills in the
1256         Vector with the first element of the pair.
1257         (WTF::copyToVector):
1258         * wtf/StrHash.h: Added.
1259         (WTF::):
1260
1261 2008-04-29  David Kilzer  <ddkilzer@apple.com>
1262
1263         BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
1264
1265         * wtf/Platform.h: Defined ENABLE(DASHBOARD_SUPPORT) to 1 only for
1266         PLATFORM(MAC) and PLATFORM(WIN).  Changed default to 0 for other
1267         ports.
1268
1269 2008-04-29  Greg Bolsinga  <bolsinga@apple.com>
1270
1271         Reviewed by Darin.
1272
1273         Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
1274
1275         * wtf/Platform.h:
1276
1277 2008-04-29  Kevin McCullough  <kmccullough@apple.com>
1278
1279         Reviewed by Geoff.
1280
1281         -<rdar://problem/5770054> JavaScript profiler (10928)
1282         -Keep call count.
1283
1284         * profiler/FunctionCallProfile.cpp:
1285         (KJS::FunctionCallProfile::FunctionCallProfile):
1286         (KJS::FunctionCallProfile::didExecute): Implements call count and fixed a bug where a stackIndex
1287         of 0 was causing the assert to be hit.
1288         (KJS::FunctionCallProfile::stopProfiling):
1289         (KJS::FunctionCallProfile::endAndRecordCall):
1290         * profiler/FunctionCallProfile.h:
1291
1292 2008-04-29  Simon Hausmann  <hausmann@webkit.org>
1293
1294         Qt/Windows build fix. The externally declared hash tables are actually
1295         declared const and the const is mangled in the symbol name, so when
1296         importing they also need to be marked const.
1297
1298         When compiling without MULTIPLE_THREADS use a const HashTable&
1299         instead of a HashTable& in ThreadClassInfoHashTables to avoid
1300         initializing the latter with a const reference.
1301
1302         * kjs/JSGlobalObject.cpp:
1303
1304 2008-04-28  Alexey Proskuryakov  <ap@webkit.org>
1305
1306         Windows build fix.
1307
1308         * kjs/ExecState.h: For whatever reason, MSVC couldn't generate a default constructor for
1309         a struct that had a "const List" member. Removing the const qulifier makes the problem go away.
1310
1311 2008-04-28  Alexey Proskuryakov  <ap@webkit.org>
1312
1313         Reviewed by Darin.
1314
1315         Fix run-webkit-tests --threading
1316         and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
1317         Proxy server issue in Sunday's Nightly
1318
1319         Changed ClassInfo objects for built-in objects to hold a getter function returning
1320         a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
1321         and these are the only ones that need to be shared.
1322
1323         * kjs/lexer.cpp:
1324         (KJS::Lexer::Lexer):
1325         (KJS::Lexer::~Lexer):
1326         * kjs/lexer.h:
1327         Made mainTable a member of Lexer, so that it no longer needs to be shared between threads.
1328
1329         * kjs/object.cpp:
1330         (KJS::JSObject::deleteProperty):
1331         (KJS::JSObject::findPropertyHashEntry):
1332         (KJS::JSObject::propertyIsEnumerable):
1333         (KJS::JSObject::getPropertyAttributes):
1334         (KJS::JSObject::getPropertyNames):
1335         * kjs/object.h:
1336         (KJS::ClassInfo::propHashTable):
1337         Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the
1338         static table is not used.
1339
1340         * kjs/JSGlobalObject.cpp:
1341         (KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread
1342         HashTables for built-in classes. The old static structs are copied to create per-thread
1343         instances.
1344         (KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above.
1345         (KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access.
1346         Also, construct globalExec.
1347         (KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr.
1348         (KJS::JSGlobalObject::mark): Ditto.
1349         (KJS::JSGlobalObject::globalExec): Ditto.
1350         * kjs/JSGlobalObject.h:
1351         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can
1352         be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was
1353         trying to access half-initialized JSGlobalObject to make its own copy of these table
1354         references, and failed.
1355         (KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec.
1356         (KJS::JSGlobalObject::perThreadData): An accessor for per-thread data.
1357
1358         * kjs/ExecState.cpp:
1359         (KJS::ExecState::ExecState):
1360         * kjs/ExecState.h:
1361         (KJS::ExecState::propertyNames):
1362         (KJS::ExecState::emptyList):
1363         (KJS::ExecState::arrayTable):
1364         (KJS::ExecState::dateTable):
1365         (KJS::ExecState::mathTable):
1366         (KJS::ExecState::numberTable):
1367         (KJS::ExecState::RegExpImpTable):
1368         (KJS::ExecState::RegExpObjectImpTable):
1369         (KJS::ExecState::stringTable):
1370         * kjs/ExecStateInlines.h:
1371         (KJS::ExecState::ExecState):
1372         Each ExecState holds its own reference to per-thread data, for even faster access. Moved
1373         m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct
1374         and take less space on the stack.
1375
1376         * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data
1377         added to JSGlobalObject.
1378
1379         * API/JSCallbackConstructor.cpp:
1380         (KJS::):
1381         * API/JSCallbackFunction.cpp:
1382         (KJS::):
1383         * API/JSCallbackObject.cpp:
1384         (KJS::):
1385         * JavaScriptCore.exp:
1386         * kjs/JSVariableObject.cpp:
1387         (KJS::JSVariableObject::getPropertyAttributes):
1388         * kjs/JSVariableObject.h:
1389         * kjs/array_instance.cpp:
1390         (KJS::):
1391         * kjs/array_object.cpp:
1392         (KJS::):
1393         (KJS::ArrayPrototype::getOwnPropertySlot):
1394         * kjs/bool_object.cpp:
1395         (KJS::):
1396         * kjs/create_hash_table:
1397         * kjs/date_object.cpp:
1398         (KJS::):
1399         (KJS::DatePrototype::getOwnPropertySlot):
1400         (KJS::DateObjectImp::DateObjectImp):
1401         * kjs/error_object.cpp:
1402         (KJS::):
1403         * kjs/function.cpp:
1404         (KJS::):
1405         * kjs/function_object.cpp:
1406         (KJS::FunctionPrototype::FunctionPrototype):
1407         * kjs/internal.cpp:
1408         (KJS::):
1409         * kjs/lookup.h:
1410         * kjs/math_object.cpp:
1411         (KJS::):
1412         (KJS::MathObjectImp::getOwnPropertySlot):
1413         * kjs/number_object.cpp:
1414         (KJS::):
1415         (KJS::NumberObjectImp::getOwnPropertySlot):
1416         * kjs/object_object.cpp:
1417         (KJS::ObjectPrototype::ObjectPrototype):
1418         * kjs/regexp_object.cpp:
1419         (KJS::):
1420         (KJS::RegExpPrototype::RegExpPrototype):
1421         (KJS::RegExpImp::getOwnPropertySlot):
1422         (KJS::RegExpImp::put):
1423         (KJS::RegExpObjectImp::getOwnPropertySlot):
1424         (KJS::RegExpObjectImp::put):
1425         * kjs/string_object.cpp:
1426         (KJS::):
1427         (KJS::StringPrototype::getOwnPropertySlot):
1428         Adjust for the above changes.
1429
1430 2008-04-28  Darin Adler  <darin@apple.com>
1431
1432         Reviewed by Adam.
1433
1434         - make sure RefPtr's default hash doesn't ref/deref when computing the hash
1435         - remove remnants of the hash table storage type optimization
1436
1437         * wtf/HashFunctions.h: Used "using" to get the hash and equal functions
1438         from PtrHash<P*> into PtrHash<RefPtr<P>>.
1439
1440         * wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits.
1441         Eliminated storage-related typedefs. Removed constructor, destructor,
1442         copy constructor, and destructor since the compiler-generated ones are
1443         fine. Removed refAll and derefAll. Took out unnnecessary typecasts.
1444         Removed use of RefCounter.
1445
1446         * wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor,
1447         destructor, copy constructor, and destructor since the compiler-generated
1448         ones are fine. Removed refAll and derefAll. Removed unneeded template
1449         arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator
1450         template.
1451
1452         * wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase,
1453         RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner
1454         class templates.
1455
1456         * wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits,
1457         and HashKeyStorageTraits.
1458
1459         * wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made
1460         the corresponding changes to RefPtrHashMapRawKeyTranslator.
1461
1462 2008-04-28  Darin Adler  <darin@apple.com>
1463
1464         Reviewed by Mitz.
1465
1466         - fix assertion hit every time you view www.apple.com
1467
1468         * kjs/PropertyNameArray.cpp:
1469         (KJS::PropertyNameArray::add): Changed assertion to allow null and empty strings.
1470         Now to find out why we have a property named "" and if that's a bug!
1471
1472 2008-04-27  Mark Rowe  <mrowe@apple.com>
1473
1474         Reviewed by Maciej Stachowiak.
1475
1476         Fix crash inside PtrHash::hash when loading a page.
1477
1478         * wtf/HashFunctions.h: Explicitly use the superclass implementation of hash to avoid infinite recursion.
1479
1480 2008-04-27  Darin Adler  <darin@apple.com>
1481
1482         Reviewed by Maciej.
1483
1484         - fix <rdar://problem/5657459> REGRESSION: JavaScriptCore no longer builds with
1485           GCC 4.2 due to pointer aliasing warnings
1486
1487         Fix this by removing the HashTable optimizations that allowed us to share a back end
1488         implementation between hash tables with integers, pointers, RefPtr, and String objects
1489         as keys. The way it worked was incompatible with strict aliasing.
1490
1491         This increases code size. On Mac OS X we'll have to regenerate .order files to avoid
1492         slowing down Safari startup times.
1493
1494         This creates a slight slowdown in SunSpider, mitigated by the following four speedups:
1495
1496         - speed up array put slightly by moving a branch (was already done for get)
1497
1498         - speed up symbol table access by adding a function named inlineGet to HashMap
1499           and using that in symbolTableGet/Put
1500
1501         - speed up PropertyNameArray creation by reducing the amount of reference count
1502           churn and uniqueness checking when adding names and not doing any allocation at
1503           all when building small arrays
1504
1505         - speed up conversion of strings to floating point numbers by eliminating the
1506           malloc/free of the buffer for the ASCII copy of the string; a way to make
1507           things even faster would be to change strtod to take a UTF-16 string
1508
1509         Note that there is considerable unused complexity now in HashSet/Map/Table to support
1510         "storage types", which is no longer used. Will do in a separate patch.
1511
1512         * API/JSCallbackObjectFunctions.h:
1513         (KJS::JSCallbackObject<Base>::getPropertyNames): Removed explicit cast to Identifier to
1514         take advantage of the new PropertyNameArray::add overload and avoid reference count churn.
1515         * API/JSObjectRef.cpp:
1516         (JSPropertyNameAccumulatorAddName): Ditto.
1517         * JavaScriptCore.exp: Updated PropertyNameArray::add entry point name.
1518
1519         * kjs/JSVariableObject.cpp: Removed now-unneeded IdentifierRepHashTraits::nullRepPtr
1520         definition (see below).
1521         (KJS::JSVariableObject::getPropertyNames): Removed explicit cast to Identifier.
1522
1523         * kjs/JSVariableObject.h:
1524         (KJS::JSVariableObject::symbolTableGet): Use inlineGet for speed. Also changed to do
1525         early exit instead of nesting the body inside an if.
1526         (KJS::JSVariableObject::symbolTablePut): Ditto.
1527
1528         * kjs/PropertyNameArray.cpp:
1529         (KJS::PropertyNameArray::add): Changed implementation to take a raw pointer instead of
1530         a reference to an identifier. Do uniqueness checking by searching the vector when the
1531         vector is short, only building the set once the vector is large enough.
1532
1533         * kjs/PropertyNameArray.h: Added an overload of add for a raw pointer, and made the old
1534         add function call that one. Added an addKnownUnique function for use when the new
1535         name is known to be different from any other in the array. Changed the vector to have
1536         an inline capacity of 20.
1537
1538         * kjs/SymbolTable.h: Changed IdentifierRepHash to inherit from the default hash for
1539         a RefPtr so we don't have to define so much. Added an overload of the hash function for
1540         a raw pointer as required by the new RefPtrHashMap. Got rid of the now-unneeded
1541         IdentifierRepHashTraits -- the default traits now work fine. Added a definition of
1542         empthValueIsZero to SymbolTableIndexHashTraits; not having it was incorrect, but harmless.
1543
1544         * kjs/array_instance.cpp:
1545         (KJS::ArrayInstance::put): Move the maxArrayIndex check inside the branch that checks
1546         the index against the length, as done in the get function.
1547
1548         * kjs/function.cpp:
1549         (KJS::globalFuncKJSPrint): Changed to use the new getCString instead of cstring.
1550
1551         * kjs/internal.cpp: Removed printInfo debugging function, a client of cstring.
1552         If we need a debugging function we can easily make a better one and we haven't
1553         used this one in a long time.
1554         * kjs/internal.h: Ditto.
1555
1556         * kjs/object.cpp:
1557         (KJS::JSObject::getPropertyNames): Removed explicit cast to Identifier.
1558         * kjs/property_map.cpp:
1559         (KJS::PropertyMap::getEnumerablePropertyNames): Ditto. Also added a special case for
1560         the case where the propertyNames array is empty -- in that case we know we're adding
1561         a set of names that are non-overlapping so we can use addKnownUnique.
1562         * kjs/ustring.cpp:
1563         (KJS::UString::getCString): Replaces cstring. Puts the C string into a CStringBuffer,
1564         which is a char Vector with an inline capacity. Also returns a boolean to indicate if
1565         the converion was lossy, which eliminates the need for a separate is8Bit call.
1566         (KJS::UString::toDouble): Changed to call getCString instead of cstring.
1567         * kjs/ustring.h: Ditto.
1568
1569         * wtf/HashFunctions.h: Overload the hash and equal functions for RefPtr's default
1570         hash to take raw pointers. This works with the changes to RefPtrHashMap to avoid
1571         introducing refcount churn.
1572
1573         * wtf/HashMap.h: Removed special code to convert the deleted value to the empty value
1574         when writing a new value into the map. This is now handled elsewhere.
1575         (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1576         HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1577
1578         * wtf/HashTable.h:
1579         (WTF::HashTable::isDeletedBucket): Changed to use isDeletedValue instead of using
1580         deletedValue and the equality operator.
1581         (WTF::HashTable::deleteBucket): Changed to use constructDeletedValue instead of
1582         using deletedValue and the assignment operator.
1583         (WTF::HashTable::checkKey): Added. Factors out the check for values that are empty
1584         or deleted keys that's used in various functions below.
1585         (WTF::HashTable::lookup): Changed to use checkKey, check for a 0 table, and also
1586         made public for use by RefPtrHashMap.
1587         (WTF::HashTable::lookupForWriting): Changed to use checkKey.
1588         (WTF::HashTable::fullLookupForWriting): Changed to use checkKey.
1589         (WTF::HashTable::add): Changed to use checkKey, and call initializeBucket on a
1590         deleted bucket before putting a new entry into it.
1591         (WTF::HashTable::addPassingHashCode): Ditto.
1592         (WTF::HashTable::deallocateTable): Check isDeletedBucket before calling ~ValueType.
1593
1594         * wtf/HashTraits.h: Got ridd of all the HashTraits specialization for the integer
1595         types, since GeneicHashTraitsBase already deals with integers separately. Put the
1596         deleted value support into GenericHashTraitsBase. Changed FloatHashTraits to
1597         inherit from GenericHashTraits, and define construct/isDeletedValue rather than
1598         deletedValue. Removed the ref and deref functions from RefPtr's HashTraits, and
1599         defined construct/isDeletedValue. Eliminated DeletedValueAssigner. Changed
1600         PairHashTraits to define construct/isDeletedValue, and also merged
1601         PairBaseHashTraits in with PairHashTraits. Got rid of all specialization of
1602         HashKeyStorageTraits. We'll remove that, and the needsRef data member, later.
1603
1604         * wtf/RefPtr.h: Added HashTableDeletedValueType, an enum type with a single value,
1605         HashTableDeletedValue. Used that type to make a new constructor to construct
1606         deleted values and also added an isHashTableDeletedValue function.
1607
1608         * wtf/RefPtrHashMap.h: Added RefPtrHashMapRawKeyTranslator and used it to implement
1609         the raw pointer functions. This is a way to continue to avoid refcount thrash. We
1610         can't use the old way because it depended on the underlying map using a non-RefPtr
1611         type.
1612         (WTF::HashMap::find): Use find with RefPtrHashMapRawKeyTranslator.
1613         (WTF::HashMap::contains): Use contains with RefPtrHashMapRawKeyTranslator.
1614         (WTF::HashMap::inlineAdd): Use add with RefPtrHashMapRawKeyTranslator.
1615         (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1616         HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1617         (WTF::HashMap::inlineGet): Added. Just like get, but marked inline for use in the
1618         symbol table code.
1619
1620 2008-04-25  Sam Weinig  <sam@webkit.org>
1621
1622         Rubber-stamped by Mark Rowe.
1623
1624         Remove SavedBuiltins and SavedProperties classes and the methods used to
1625         save data to them.  The CachedPage now stores a the JSGlobalObject in full.
1626
1627         * JavaScriptCore.exp:
1628         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1629         * JavaScriptCore.xcodeproj/project.pbxproj:
1630         * kjs/JSGlobalObject.cpp:
1631         * kjs/JSGlobalObject.h:
1632         * kjs/JSVariableObject.cpp:
1633         * kjs/JSVariableObject.h:
1634         (KJS::JSVariableObject::localStorage):
1635         * kjs/SavedBuiltins.h: Removed.
1636         * kjs/object.h:
1637         * kjs/property_map.cpp:
1638         * kjs/property_map.h:
1639
1640 2008-04-25  Mark Rowe  <mrowe@apple.com>
1641
1642         Rubber-stamped by Sam Weinig.
1643
1644         Add some content to an empty ICU header file to prevent verification errors.
1645
1646         * icu/unicode/utf_old.h:
1647
1648 2008-04-25  David Kilzer  <ddkilzer@apple.com>
1649
1650         <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
1651
1652         Patch by George Dicker and Michael Kahl.  Reviewed by Darin.
1653
1654         When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
1655         is invoked, the first line number of the function is returned instead of the last
1656         line number.  This regressed in r28458.
1657
1658         * kjs/nodes.cpp:
1659         (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
1660         when calling Debugger::returnEvent().
1661
1662 2008-04-25  Darin Adler  <darin@apple.com>
1663
1664         Done with Stephanie Lewis.
1665
1666         * JavaScriptCore.xcodeproj/project.pbxproj: Prepare for compilation with gcc 4.2 by
1667         adding -fno-strict-aliasing to CollatorICU.cpp.
1668
1669 2008-04-24  Sam Weinig  <sam@webkit.org>
1670
1671         Reviewed by Geoffrey Garen.
1672
1673         Add a #define to easily enable collecting on every allocation to aid
1674         debugging GC bugs.
1675
1676         * kjs/collector.cpp:
1677         (KJS::Collector::heapAllocate):
1678
1679 2008-04-24  Kevin McCullough  <kmccullough@apple.com>
1680
1681         Reviewed by Adam and Sam.
1682
1683         -<rdar://problem/5770054> JavaScript profiler (10928)
1684         -Only profile the page group that starts profiling to avoid profiling
1685         tools that shouldn't be profiled unless explicitly requested to.
1686
1687         * JavaScriptCore.exp: Export new signature.
1688         * kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
1689         (KJS::JSGlobalObject::init):
1690         * kjs/JSGlobalObject.h: Ditto.
1691         (KJS::JSGlobalObject::setPageGroupIdentifier):
1692         (KJS::JSGlobalObject::pageGroupIdentifier):
1693         * profiler/Profiler.cpp: Check the identifier of the page group of the
1694         lexical global exec state and only profile if it matches the given page
1695         group identifier.
1696         (KJS::Profiler::startProfiling):
1697         (KJS::Profiler::willExecute):
1698         (KJS::Profiler::didExecute):
1699         * profiler/Profiler.h: Ditto.
1700         (KJS::Profiler::Profiler):
1701
1702 2008-04-24  Julien Chaffraix  <jchaffraix@webkit.org>
1703
1704         Reviewed by Simon.
1705
1706         Bug 15940: Implement threading API for Qt
1707         https://bugs.webkit.org/show_bug.cgi?id=15940
1708
1709         Original patch by Justin Haygood, tweaked by me.
1710
1711         * JavaScriptCore.pri:
1712         * wtf/ThreadingQt.cpp: Added.
1713         (WTF::threadMapMutex):
1714         (WTF::threadMap):
1715         (WTF::establishIdentifierForThread):
1716         (WTF::clearThreadForIdentifier):
1717         (WTF::threadForIdentifier):
1718         (WTF::initializeThreading):
1719         (WTF::ThreadPrivate::getReturnValue):
1720         (WTF::ThreadPrivate::ThreadPrivate):
1721         (WTF::ThreadPrivate::run):
1722         (WTF::createThread):
1723         (WTF::waitForThreadCompletion): return !res to return
1724         0 on success (to match the pthreads implementation).
1725         (WTF::detachThread):
1726         (WTF::identifierByQthreadHandle):
1727         (WTF::currentThread):
1728         (WTF::Mutex::Mutex):
1729         (WTF::Mutex::~Mutex):
1730         (WTF::Mutex::lock):
1731         (WTF::Mutex::tryLock):
1732         (WTF::Mutex::unlock):
1733         (WTF::ThreadCondition::ThreadCondition):
1734         (WTF::ThreadCondition::~ThreadCondition):
1735         (WTF::ThreadCondition::wait):
1736         (WTF::ThreadCondition::timedWait):
1737         (WTF::ThreadCondition::signal):
1738
1739 2008-04-22  Darin Adler  <darin@apple.com>
1740
1741         Reviewed by Anders.
1742
1743         - simplify use of HashTraits to prepare for some upcoming hash table changes
1744
1745         * kjs/SymbolTable.h: Made SymbolTableIndexHashTraits derive from HashTraits<size_t>
1746         and specialize only the empty value.
1747
1748 2008-04-23  Holger Hans Peter Freyther  <zecke@selfish.org>
1749
1750         Reviewed by Simon.
1751
1752         Removed the #define for USE_SYSTEM_MALLOC that we set in WebKit.pri
1753         already.
1754
1755         * wtf/Platform.h:
1756
1757 2008-04-21  Kevin McCullough  <kmccullough@apple.com>
1758
1759         Reviewed by Adam.
1760
1761         <rdar://problem/5770054> JavaScript profiler (10928)
1762         - When stop profiling is called we need to stop the timers on all the
1763         functions that are still running.
1764
1765         * profiler/FunctionCallProfile.cpp:
1766         (KJS::FunctionCallProfile::didExecute):
1767         (KJS::FunctionCallProfile::stopProfiling):
1768         * profiler/FunctionCallProfile.h:
1769         * profiler/Profiler.cpp:
1770         (KJS::Profiler::stopProfiling):
1771
1772 2008-04-21  Alexey Proskuryakov  <ap@webkit.org>
1773
1774         Reviewed by Darin.
1775
1776         Move collector main thread initialization from WebKit/win to KJS::initializeThreading.
1777
1778         * kjs/InitializeThreading.cpp:
1779         (KJS::initializeThreading):
1780
1781 2008-04-21  Adam Roben  <aroben@apple.com>
1782
1783         MSVC build fix
1784
1785         Reviewed by Alexey Proskuryakov.
1786
1787         * kjs/ustring.h:
1788         (KJS::UString::cost): Disable a warning about assigning a 32-bit
1789         size_t into a 31-bit size_t.
1790
1791 2008-04-21  Simon Hausmann  <hausmann@webkit.org>
1792
1793         Reviewed by Lars.
1794
1795         Made convertValueToQVariant accessible from within WebKit/qt/Api
1796
1797         * bindings/qt/qt_runtime.h:
1798
1799 2008-04-21  Holger Hans Peter Freyther  <holger.freyther@trolltech.com>
1800
1801         Reviewed by Simon.
1802
1803         Build fix for Qt 4.3
1804
1805         * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
1806         always defined. Do this by adding defines to the compiler line
1807         * For users of our API this is not feasible. Every public header file should
1808         include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
1809         when we are building everything < 4.4.0 and don't have them defined.
1810
1811         * kjs/testkjs.pro:
1812
1813 2008-04-19  Matt Lilek  <webkit@mattlilek.com>
1814
1815         Not reviewed, Windows build fix - copy the profiler headers in all
1816         configurations, not just Debug_Internal.
1817
1818         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1819
1820 2008-04-19  Mike Hommey  <glandium@debian.org>
1821
1822         Reviewed by Alp Toker.
1823
1824         Don't build testkjs with rpath.
1825
1826         * GNUmakefile.am:
1827
1828 2008-04-18  Kevin Ollivier  <kevino@theolliviers.com>
1829
1830         wx build fixes. Rename LocalStorage.h to LocalStorageEntry.h
1831         to avoid header detection issues between WebCore/storage/LocalStorage.h 
1832         and it, and add $(PROFILER_SOURCES) to the wx JSCore build.
1833
1834         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1835         * JavaScriptCore.xcodeproj/project.pbxproj:
1836         * jscore.bkl:
1837         * kjs/ExecState.h:
1838         * kjs/JSVariableObject.h:
1839         * kjs/LocalStorage.h: Removed.
1840         * kjs/LocalStorageEntry.h: Copied from JavaScriptCore/kjs/LocalStorage.h.
1841         * kjs/function.h:
1842
1843 2008-04-18 Jan  Michael Alonzo  <jmalonzo@unpluggable.com>
1844
1845         Reviewed by Alp Toker.
1846
1847         http://bugs.webkit.org/show_bug.cgi?id=16620
1848         [GTK] Autotools make dist and make check support
1849
1850         Cleanups.
1851
1852         * GNUmakefile.am:
1853
1854 2008-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
1855
1856         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Windows
1857         build fix.
1858
1859 2008-04-11  Mark Rowe  <mrowe@apple.com>
1860
1861         Rubber-stamped by Antti Koivisto.
1862
1863         Silence GCC 4.3 warnings by removing extraneous consts.
1864
1865         * kjs/ustring.cpp:
1866         * kjs/ustring.h:
1867
1868 2008-04-18  Kevin McCullough  <kmccullough@apple.com>
1869
1870         Reviewed by Sam.
1871
1872         -<rdar://problem/5770054> JavaScript profiler (10928)
1873         - Use Deque instead of Vector since the profiler uses prepend a lot
1874         and deque is faster at that.
1875
1876         * profiler/FunctionCallProfile.h:
1877         (KJS::FunctionCallProfile::milliSecs): Corrected the name to match
1878         its output.
1879         * wtf/Deque.h:
1880         (WTF::deleteAllValues):
1881
1882 2008-04-18  Kevin McCullough  <kmccullough@apple.com>
1883
1884         Reviewed by Sam and Adam.
1885
1886         -<rdar://problem/5770054> JavaScript profiler (10928)
1887         - Cleaned up the header file and made some functions static, added
1888         a new, sane, printing function, and fixed a few minor bugs.
1889
1890         * JavaScriptCore.exp:
1891         * JavaScriptCore.xcodeproj/project.pbxproj:
1892         * profiler/FunctionCallProfile.cpp:
1893         (KJS::FunctionCallProfile::didExecute): Removed assertion that time is
1894         > 0 because at ms resolution that may not be true and only cross-
1895         platform way to get time differences is in ms.
1896         (KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
1897         printing function for dumping data in a sane style.
1898         (KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
1899         displayed too much precision when printing our floats. Also added logic
1900         to make sure we don't display 0 because that doesn't make sense for a
1901         sampling profile.
1902         * profiler/FunctionCallProfile.h:
1903         * profiler/Profiler.cpp: Moved functions that could be static into the
1904         implementation, and chaned the ASSERTs to early returns.  I did this
1905         because console.profile() is a JS function and so was being profiled
1906         but asserting because the profiler had not been started! In the future
1907         I would like to put the ASSERTs back and not profile the calls to
1908         console.profile() and console.profileEnd().
1909         (KJS::Profiler::willExecute):
1910         (KJS::Profiler::didExecute):
1911         (KJS::getStackNames): Fixed a bug where the wrong ExecState was being
1912         used.
1913         (KJS::getFunctionName):
1914         (KJS::Profiler::printDataInspectorStyle):
1915         * profiler/Profiler.h:
1916
1917 2008-04-18  Alexey Proskuryakov  <ap@webkit.org>
1918
1919         Reviewed by Darin.
1920
1921         Fix leaks during plugin tests (which actually excercise background JS), and potential
1922         PAC brokenness that was not reported, but very likely.
1923
1924         The leaks shadowed a bigger problem with Identifier destruction. Identifier::remove involves
1925         an IdentifierTable lookup, which is now a per-thread instance. Since garbage collection can
1926         currently happen on a different thread than allocation, a wrong table was used.
1927
1928         No measurable change on SunSpider total, ~1% variation on individual tests.
1929
1930         * kjs/ustring.cpp:
1931         (KJS::):
1932         (KJS::UString::Rep::create):
1933         (KJS::UString::Rep::destroy):
1934         * kjs/ustring.h:
1935         Replaced isIdentifier with a pointer to IdentifierTable, so that destruction can be done
1936         correctly. Took one bit from reportedCost, to avoid making UString::Rep larger (performance
1937         effect was measurable on SunSpider).
1938
1939         * kjs/identifier.cpp:
1940         (KJS::IdentifierTable::IdentifierTable):
1941         (KJS::IdentifierTable::~IdentifierTable):
1942         (KJS::IdentifierTable::add):
1943         (KJS::IdentifierTable::remove):
1944         Make IdentifierTable a real class. Its destructor needs to zero out outstanding references,
1945         because some identifiers may briefly outlive it during thread destruction, and we don't want
1946         them to use their stale pointers.
1947
1948         (KJS::LiteralIdentifierTable):
1949         (KJS::Identifier::add):
1950         Now that LiteralIdentifierTable is per-thread and can be destroyed not just during application
1951         shutdown, it is not appropriate to simply bump refcount for strings that get there; changed
1952         the table to hold RefPtrs.
1953
1954         (KJS::CStringTranslator::translate):
1955         (KJS::UCharBufferTranslator::translate):
1956         (KJS::Identifier::addSlowCase):
1957         (KJS::Identifier::remove):
1958         * kjs/identifier.h:
1959         (KJS::Identifier::add):
1960         Use and update UString::Rep::identifierTable as appropriate. Updating it is now done in
1961         IdentifierTable::add, not in translators.
1962
1963 2008-04-18  Alexey Proskuryakov  <ap@webkit.org>
1964
1965         Reviewed by Darin.
1966
1967         Get rid of static compareWithCompareFunctionArguments in array_instance.cpp.
1968
1969         No change on SunSpider, CelticKane or iBench JavaScript. It is probable that in some cases,
1970         merge sort is still faster, but more investigation is needed to determine a new cutoff.
1971         Or possibly, it would be better to do what FIXME says (change to tree sort).
1972
1973         Also, made arguments a local variable - not sure why it was a member of
1974         CompareWithCompareFunctionArguments.
1975
1976         * kjs/array_instance.cpp:
1977         (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1978         (KJS::CompareWithCompareFunctionArguments::operator()):
1979         (KJS::ArrayInstance::sort):
1980
1981 2008-04-18  Simon Hausmann  <hausmann@webkit.org>
1982
1983         Build fix for gcc 4.3. Include stdio.h for printf.
1984
1985         * profiler/FunctionCallProfile.cpp:
1986         * profiler/Profiler.cpp:
1987
1988 2008-04-17  Jon Honeycutt  <jhoneycutt@apple.com>
1989
1990         Reviewed by mrowe.
1991
1992         * wtf/Platform.h: Add HAVE_ACCESSIBILITY to Platform.h.
1993
1994 2008-04-17  Alexey Proskuryakov  <ap@webkit.org>
1995
1996         Reviewed by Maciej.
1997
1998         Thread static data destructors are not guaranteed to be called in any particular order;
1999         turn ThreadSpecific into a phoenix-style singleton to avoid accessing freed memory when
2000         deleted objects are interdependent (e.g. CommonIdentifiers and internal identifier tables).
2001
2002         No change on SunSpider.
2003
2004         * wtf/ThreadSpecific.h:
2005         (WTF::ThreadSpecific::Data::Data):
2006         (WTF::::get):
2007         (WTF::::set):
2008         (WTF::::destroy):
2009
2010 2008-04-15  Srinivas Rao. M Hamse  <msrinirao@gmail.com>
2011
2012         Reviewed by Maciej Stachowiak.
2013
2014         - gcc 3.x build fix
2015
2016         * kjs/nodes.h: CallerType definition made public for gcc 3.x compilation
2017
2018 2008-04-16  Brady Eidson  <beidson@apple.com>
2019
2020         Reviewed by Sam Weinig
2021
2022         Change ThreadSafeShared to act like RefCounted by starting out with a single ref by default
2023
2024         * wtf/Threading.h:
2025         (WTF::ThreadSafeShared::ThreadSafeShared):
2026
2027 2008-04-16  Sam Weinig  <sam@webkit.org>
2028
2029         Reviewed by Geoffrey Garen.
2030
2031         - To keep the behavior of the WebKit and JavaScriptCore API's the same,
2032           we need to hide the fact that the global object and the window object
2033           are no longer the same thing, and the the global object now changes on
2034           navigations.  To do this, only the wrapper should ever be exposed.  This
2035           fixes the two remaining spots where the internal global object is exposed,
2036           the windowScriptObject returned from [WebFrame windowObject] and the object
2037           return by calling JSContextGetGlobalObject on [WebFrame globalContext].
2038
2039         * API/JSContextRef.cpp:
2040         (JSContextGetGlobalObject):
2041         This is a bit of a hack, this returns the "this" representation of the globalObject
2042         which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
2043
2044         * API/JSObjectRef.cpp:
2045         (JSObjectSetProperty):
2046         Call the new putWithAttributes method instead of relying on lower-level calls.
2047         This is needed so that the window wrapper can forward the calls.
2048
2049         * JavaScriptCore.exp:
2050         * kjs/Activation.h:
2051         * kjs/JSGlobalObject.cpp:
2052         (KJS::JSGlobalObject::putWithAttributes):
2053         * kjs/JSGlobalObject.h:
2054         * kjs/JSVariableObject.h:
2055         (KJS::JSVariableObject::symbolTablePutWithAttributes):
2056         * kjs/function.cpp:
2057         (KJS::ActivationImp::putWithAttributes):
2058         * kjs/nodes.cpp:
2059         (KJS::ConstDeclNode::handleSlowCase):
2060         (KJS::ConstDeclNode::evaluateSingle):
2061         (KJS::EvalNode::processDeclarations):
2062         * kjs/object.cpp:
2063         (KJS::JSObject::putWithAttributes):
2064         * kjs/object.h:
2065         Rename initializeVariable to putWithAttributes and move it down to JSObject so it
2066         can be used for JSObjectSetProperty.
2067
2068 2008-04-16  Kevin McCullough  <kmccullough@apple.com>
2069
2070         Reviewed by Sam and Geoff.
2071
2072         -<rdar://problem/5770054> JavaScript profiler (10928)
2073         Inital profiler prototype
2074
2075         * GNUmakefile.am: Added new files to project
2076         * JavaScriptCore.pri: Ditto
2077         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
2078         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto
2079         * JavaScriptCoreSources.bkl: Ditto
2080         * kjs/config.h: Put compiling flag in here.
2081         * kjs/function.cpp: Instrument calling the function eval().
2082         (KJS::eval):
2083         * kjs/interpreter.cpp: Instrument evaluating global scopes.
2084         (KJS::Interpreter::evaluate):
2085         * kjs/object.cpp: Instrument JS function calls.
2086         (KJS::JSObject::call):
2087         * profiler: Added.
2088         * profiler/FunctionCallProfile.cpp: Added.
2089         (KJS::FunctionCallProfile::FunctionCallProfile):
2090         (KJS::FunctionCallProfile::~FunctionCallProfile):
2091         (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
2092         (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
2093         (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
2094         (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
2095         (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
2096         * profiler/FunctionCallProfile.h: Added.
2097         (KJS::FunctionCallProfile::FunctionCallProfile):
2098         (KJS::FunctionCallProfile::~FunctionCallProfile):
2099         (KJS::FunctionCallProfile::functionName):
2100         (KJS::FunctionCallProfile::microSecs):
2101         * profiler/Profiler.cpp: Added.
2102         (KJS::Profiler::profiler):
2103         (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
2104         (KJS::Profiler::startProfiling): Don't start collecting profiling information until the user starts the profiler. Also don't clear old prfiled data until the profiler is restarted.
2105         (KJS::Profiler::stopProfiling): Stop collecting profile information.
2106         (KJS::Profiler::willExecute): Same as above. 
2107         (KJS::Profiler::didExecute): Same as above.
2108         (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
2109         (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
2110         (KJS::Profiler::getFunctionName): Get the function name from the given parameter.
2111         (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
2112         (KJS::Profiler::debugLog):
2113         * profiler/Profiler.h: Added.
2114         (KJS::Profiler::Profiler):
2115
2116 2008-04-16  Sam Weinig  <sam@webkit.org>
2117
2118         Reviewed by Darin Adler.
2119
2120         - Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
2121           in the KJS namespace.
2122         - Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
2123         - Remove mode switching from dtoa.  ~2% improvement on test 26. 
2124         - Removes all unnecessary #defines from dtoa code.
2125
2126         * JavaScriptCore.exp:
2127         * kjs/dtoa.cpp:
2128         (KJS::ulp):
2129         (KJS::b2d):
2130         (KJS::d2b):
2131         (KJS::ratio):
2132         (KJS::):
2133         (KJS::strtod):
2134         (KJS::freedtoa):
2135         (KJS::dtoa):
2136         * kjs/dtoa.h:
2137         * kjs/function.cpp:
2138         (KJS::parseInt):
2139         * kjs/lexer.cpp:
2140         (KJS::Lexer::lex):
2141         * kjs/number_object.cpp:
2142         (KJS::integer_part_noexp):
2143         (KJS::numberProtoFuncToExponential):
2144         * kjs/ustring.cpp:
2145         (KJS::UString::from):
2146         (KJS::UString::toDouble):
2147
2148 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2149
2150         Reviewed by Darin.
2151
2152         Get rid of static execForCompareByStringForQSort in array_instance.cpp.
2153
2154         No change on SunSpider, CelticKane or iBench JavaScript.
2155
2156         * kjs/array_instance.cpp:
2157         (KJS::ArraySortComparator::ArraySortComparator):
2158         (KJS::ArraySortComparator::operator()):
2159         (KJS::ArrayInstance::sort):
2160         Switch slow case to std::sort, so that ExecState can be passed in a comparator.
2161
2162 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2163
2164         Reviewed by Adam Roben.
2165
2166         MSVC build fix.
2167
2168         * kjs/CommonIdentifiers.cpp:
2169         * kjs/CommonIdentifiers.h:
2170         * kjs/Parser.cpp:
2171         * kjs/Parser.h:
2172         * kjs/identifier.cpp:
2173         * kjs/lexer.h:
2174         * wtf/ThreadSpecific.h:
2175
2176 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2177
2178         Build fix.
2179
2180         * kjs/date_object.cpp:
2181         * kjs/date_object.h:
2182         Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
2183         where the former is not available.
2184
2185 2008-04-16  Holger Hans Peter Freyther  <zecke@selfish.org>
2186
2187         Unreviewed build fix for MSVC. It does not want to have
2188         WTF in the KJS namespace.
2189
2190         * kjs/CommonIdentifiers.h:
2191
2192 2008-04-16  Holger Hans Peter Freyther  <zecke@selfish.org>
2193
2194         Unreviewed build fix for gcc.
2195
2196         ::msToGregorianDateTime  is not known to it.
2197
2198         * kjs/date_object.cpp:
2199         (KJS::DateInstance::msToGregorianDateTime):
2200
2201 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2202
2203         Reviewed by Oliver Hunt.
2204
2205         Initialize threadMapMutex safely (as already done in ThreadingWin).
2206
2207         * wtf/ThreadingGtk.cpp:
2208         (WTF::threadMapMutex):
2209         (WTF::initializeThreading):
2210         * wtf/ThreadingPthreads.cpp:
2211         (WTF::threadMapMutex):
2212         (WTF::initializeThreading):
2213
2214 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2215
2216         Reviewed by Adam Roben.
2217
2218         Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
2219         (1.65x on date-format-xparb, 1.13x on date-format-tofte).
2220
2221         * kjs/DateMath.h:
2222         (KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
2223         Noncopyable, so it's not just operator=.
2224
2225         * kjs/date_object.h: Added a per-object cache.
2226
2227         * kjs/date_object.cpp:
2228         (KJS::DateInstance::DateInstance):
2229         (KJS::DateInstance::msToGregorianDateTime):
2230         (KJS::dateProtoFuncToString):
2231         (KJS::dateProtoFuncToUTCString):
2232         (KJS::dateProtoFuncToDateString):
2233         (KJS::dateProtoFuncToTimeString):
2234         (KJS::dateProtoFuncToLocaleString):
2235         (KJS::dateProtoFuncToLocaleDateString):
2236         (KJS::dateProtoFuncToLocaleTimeString):
2237         (KJS::dateProtoFuncGetFullYear):
2238         (KJS::dateProtoFuncGetUTCFullYear):
2239         (KJS::dateProtoFuncToGMTString):
2240         (KJS::dateProtoFuncGetMonth):
2241         (KJS::dateProtoFuncGetUTCMonth):
2242         (KJS::dateProtoFuncGetDate):
2243         (KJS::dateProtoFuncGetUTCDate):
2244         (KJS::dateProtoFuncGetDay):
2245         (KJS::dateProtoFuncGetUTCDay):
2246         (KJS::dateProtoFuncGetHours):
2247         (KJS::dateProtoFuncGetUTCHours):
2248         (KJS::dateProtoFuncGetMinutes):
2249         (KJS::dateProtoFuncGetUTCMinutes):
2250         (KJS::dateProtoFuncGetSeconds):
2251         (KJS::dateProtoFuncGetUTCSeconds):
2252         (KJS::dateProtoFuncGetTimezoneOffset):
2253         (KJS::setNewValueFromTimeArgs):
2254         (KJS::setNewValueFromDateArgs):
2255         (KJS::dateProtoFuncSetYear):
2256         (KJS::dateProtoFuncGetYear):
2257         Use the cache when converting.
2258
2259 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
2260
2261         Reviewed by Darin.
2262
2263         Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
2264
2265         SunSpider results were not conclusive, possibly up to 0.2% slowdown.
2266
2267         * JavaScriptCore.xcodeproj/project.pbxproj:
2268         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2269         Added ThreadSpecific.h
2270
2271         * wtf/ThreadSpecific.h: Added.
2272         (WTF::::ThreadSpecific):
2273         (WTF::::~ThreadSpecific):
2274         (WTF::::get):
2275         (WTF::::set):
2276         (WTF::::destroy):
2277         (WTF::T):
2278         (WTF::::operator):
2279         Only implemented for platforms that use pthreads.
2280
2281         * kjs/CommonIdentifiers.cpp:
2282         (KJS::CommonIdentifiers::shared):
2283         * kjs/CommonIdentifiers.h:
2284         * kjs/InitializeThreading.cpp:
2285         (KJS::initializeThreading):
2286         * kjs/Parser.cpp:
2287         (KJS::parser):
2288         * kjs/Parser.h:
2289         * kjs/identifier.cpp:
2290         (KJS::identifierTable):
2291         (KJS::literalIdentifierTable):
2292         (KJS::Identifier::initializeIdentifierThreading):
2293         * kjs/identifier.h:
2294         * kjs/lexer.cpp:
2295         (KJS::lexer):
2296         * kjs/lexer.h:
2297         Make static instances per-thread.
2298
2299 2008-04-15  Anders Carlsson  <andersca@apple.com>
2300
2301         Reviewed by Adam.
2302
2303         Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
2304         
2305         * Configurations/JavaScriptCore.xcconfig:
2306
2307 2008-04-15  Andre Poenitz  <andre.poenitz@trolltech.com>
2308
2309         Reviewed by Simon.
2310
2311         Fix compilation with Qt namespaces
2312
2313         Qt can be configured to have all of its classes inside a specified namespaces.
2314         This is for example used in plugin/component environments like Eclipse.
2315
2316         This change makes it possible to let the Qt port compile against a namespaced
2317         Qt by the use of macros Qt provides to properly forward declare Qt classes in
2318         the namespace.
2319
2320         * wtf/unicode/qt4/UnicodeQt4.h:
2321
2322 2008-04-14  Anders Carlsson  <andersca@apple.com>
2323
2324         Reviewed by Adam.
2325
2326         Don't leak the prototype class.
2327         
2328         * API/JSClassRef.cpp:
2329         (OpaqueJSClass::create):
2330
2331 2008-04-14  Steve Falkenburg  <sfalken@apple.com>
2332
2333         Fix build.
2334
2335         * wtf/ThreadingWin.cpp:
2336
2337 2008-04-14  Alexey Proskuryakov  <ap@webkit.org>
2338
2339         Reviewed by Adam Roben.
2340
2341         https://bugs.webkit.org/show_bug.cgi?id=18488
2342         FastMalloc doesn't release thread-specific data on Windows
2343
2344         * wtf/ThreadingWin.cpp:
2345         (WTF::threadMapMutex): (WTF::initializeThreading): Call threadMapMutex once to initialize the static safely.
2346         (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): Added a structure to wrap thread entry point and arguments.
2347         (WTF::wtfThreadEntryPoint): Make sure to end all WTF threads with pthread_exit(), to give pthreads-win32 a chance to call
2348         destructors of thread-specific data.
2349         (WTF::createThread): Use _beginthreadex instead of CreateThread, because MSDN says so. Also removed a call to CreateEvent,
2350         for which I could see no reason at all.
2351
2352 2008-04-14  Alexey Proskuryakov  <ap@webkit.org>
2353
2354         Touched a file to make JavaScriptCore.vcproj rebuild.
2355
2356         * wtf/MathExtras.h:
2357
2358 2008-04-14  Adam Roben  <aroben@apple.com>
2359
2360         Windows build fix
2361
2362         Rubberstamped by Alexey Proskuryakov.
2363
2364         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
2365         the "potentially uninitialized variable" warning for grammar.cpp, as
2366         it seems to be incorrect. yylval gets initialized by the lexer, but
2367         MSVC doesn't seem to understand this.
2368
2369 2008-04-11  Antti Koivisto  <antti@apple.com>
2370
2371         Reviewed by Maciej.
2372         
2373         Add default hash for pairs of hashable types.
2374
2375         * wtf/HashFunctions.h:
2376         (WTF::PairHash::hash):
2377         (WTF::PairHash::equal):
2378         (WTF::):
2379
2380 2008-04-11  Alexey Proskuryakov  <ap@webkit.org>
2381
2382         Reviewed by Geoff.
2383
2384         Make DateMath.cpp thread safe.
2385
2386         No measurable change on SunSpider (should be a very small speedup).
2387
2388         * kjs/DateMath.cpp:
2389         (KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
2390         same precomputed value.
2391         (KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
2392         out of getUTCOffset(), and notification setup into initDateMath().
2393
2394         (KJS::initDateMath): Added.
2395
2396         * kjs/DateMath.h:
2397         * kjs/InitializeThreading.cpp:
2398         (KJS::initializeThreading):
2399         Added initDateMath().
2400
2401 2008-04-11  Alexey Proskuryakov  <ap@webkit.org>
2402
2403         Windows build fix.
2404
2405         * kjs/grammar.y:
2406
2407 2008-04-11  Alexey Proskuryakov  <ap@webkit.org>
2408
2409         Tiger build fix. Forward declaring a union didn't work for whatever reason, make the
2410         parameters void*.
2411
2412         * kjs/grammar.y:
2413         * kjs/lexer.cpp:
2414         (kjsyylex):
2415         (KJS::Lexer::lex):
2416         * kjs/lexer.h:
2417
2418 2008-04-11  Alexey Proskuryakov  <ap@webkit.org>
2419
2420         Reviewed by Geoff.
2421
2422         Generate a pure (re-entrant) parser with Bison.
2423
2424         No change on SunSpider.
2425
2426         * kjs/Parser.cpp:
2427         (KJS::Parser::parse):
2428         * kjs/grammar.y:
2429         * kjs/lexer.cpp:
2430         (kjsyylex):
2431         (KJS::Lexer::lex):
2432         * kjs/lexer.h:
2433         Pass state as function arguments, instead of global data. Don't call lexer() as often as
2434         before, as this function is about to become slower due to thread-specific storage.
2435
2436         * kjs/function.cpp:
2437         (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
2438         already taken care of. This is a small speedup, compensating for a small slowdown caused
2439         by switching Bison mode.
2440
2441 2008-04-10  Alexey Proskuryakov  <ap@webkit.org>
2442
2443         Reviewed by Geoff.
2444
2445         https://bugs.webkit.org/show_bug.cgi?id=18402
2446         REGRESSION: visited element handling is incorrect in nested join/toString calls
2447
2448         No change on SunSpider total, possibly a tiny improvement (about 0.1%).
2449
2450         Test: fast/js/array-tostring-and-join.html
2451
2452         * kjs/JSGlobalObject.h:
2453         (KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
2454         common to toString/toLocalizedString/join again.
2455
2456         * kjs/array_object.cpp:
2457         (KJS::arrayProtoFuncToString):
2458         (KJS::arrayProtoFuncToLocaleString):
2459         (KJS::arrayProtoFuncJoin):
2460         Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
2461         regain performance.
2462
2463         * wtf/Vector.h:
2464         (WTF::::resize):
2465         (WTF::::grow):
2466         (WTF::::reserveCapacity):
2467         (WTF::::append):
2468         (WTF::::insert):
2469         Added null checks, so that Vector methods don't crash when out of memory. The caller should
2470         check that data pointer is not null before proceeding.
2471
2472 2008-04-10  Mark Rowe  <mrowe@apple.com>
2473
2474         Reviewed by Maciej Stachowiak.
2475
2476         Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes.
2477         Bug 18367: Crash during celtic kane js speed 2007 test
2478
2479         GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
2480         stack frame.  This lead to the range of addresses the collector treated as stack to exclude the
2481         contents of volatile registers that markCurrentThreadConservatively forces onto the stack.  This was
2482         leading to objects being prematurely collected if the only reference to them was via a register at
2483         the time a collection occurred.
2484
2485         The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
2486         that is called from markCurrentThreadConservatively.  This forces the dummy variable we use for
2487         determining the top of stack to be in a different stack frame which prevents the compiler from
2488         reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
2489
2490         * kjs/collector.cpp:
2491         (KJS::Collector::markCurrentThreadConservativelyInternal):
2492         (KJS::Collector::markCurrentThreadConservatively):
2493         * kjs/collector.h:
2494
2495 2008-04-10  Adam Roben  <aroben@apple.com>
2496
2497         VC++ Express build fix
2498
2499         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
2500         that anyone who links against WTF.lib will get user32.lib
2501         automatically.
2502
2503 2008-04-09  Adam Roben  <aroben@apple.com>
2504
2505         VC++ Express build fix
2506
2507         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
2508         user32.lib.
2509
2510 2008-04-09  Adam Roben  <aroben@apple.com>
2511
2512         Build fix
2513
2514         * JavaScriptCore.exp: Export isMainThread.
2515
2516 2008-04-09  Adam Roben  <aroben@apple.com>
2517
2518         Build fix
2519
2520         * wtf/AlwaysInline.h: Make sure to #include Platform.h before using
2521         the macros it defines.
2522
2523 2008-04-08  Mark Rowe  <mrowe@apple.com>
2524
2525         Export WTF::initializeThreading() from JavaScriptCore.
2526
2527         * JavaScriptCore.exp:
2528
2529 2008-04-04  Sam Weinig  <sam@webkit.org>
2530
2531         Reviewed by Geoffrey Garen.
2532
2533         First step in implementing the "split window"
2534
2535         - Add a GlobalThisValue to ExecState which should be used 
2536           in places that used to implement the "use the global object
2537           as this if null" rule.
2538         - Factor out lookupGetter/lookupSetter into virtual methods 
2539           on JSObject so that they can be forwarded.
2540         - Make defineGetter/defineSetter virtual methods for the same
2541           reason.
2542         - Have PrototypeReflexiveFunction store the globalObject used
2543           to create it so that it can be used to get the correct thisObject
2544           for eval.
2545
2546         * API/JSObjectRef.cpp:
2547         (JSObjectCallAsFunction):
2548         * JavaScriptCore.exp:
2549         * kjs/Activation.h:
2550         * kjs/ExecState.cpp:
2551         (KJS::ExecState::ExecState):
2552         (KJS::GlobalExecState::GlobalExecState):
2553         * kjs/ExecState.h:
2554         (KJS::ExecState::globalThisValue):
2555         * kjs/ExecStateInlines.h:
2556         (KJS::ExecState::ExecState):
2557         (KJS::FunctionExecState::FunctionExecState):
2558         * kjs/JSGlobalObject.cpp:
2559         (KJS::JSGlobalObject::reset):
2560         (KJS::JSGlobalObject::toGlobalObject):
2561         * kjs/JSGlobalObject.h:
2562         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
2563         (KJS::JSGlobalObject::JSGlobalObject):
2564         * kjs/array_instance.cpp:
2565         (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2566         (KJS::compareWithCompareFunctionForQSort):
2567         * kjs/array_object.cpp:
2568         (KJS::arrayProtoFuncSort):
2569         (KJS::arrayProtoFuncFilter):
2570         (KJS::arrayProtoFuncMap):
2571         (KJS::arrayProtoFuncEvery):
2572         (KJS::arrayProtoFuncForEach):
2573         (KJS::arrayProtoFuncSome):
2574         * kjs/function.cpp:
2575         (KJS::FunctionImp::callAsFunction):
2576         (KJS::ActivationImp::toThisObject):
2577         (KJS::globalFuncEval):
2578         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2579         (KJS::PrototypeReflexiveFunction::mark):
2580         * kjs/function.h:
2581         (KJS::PrototypeReflexiveFunction::cachedGlobalObject):
2582         * kjs/function_object.cpp:
2583         (KJS::functionProtoFuncApply):
2584         (KJS::functionProtoFuncCall):
2585         * kjs/nodes.cpp:
2586         (KJS::ExpressionNode::resolveAndCall):
2587         (KJS::FunctionCallValueNode::evaluate):
2588         (KJS::LocalVarFunctionCallNode::inlineEvaluate):
2589         (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
2590         (KJS::FunctionCallBracketNode::evaluate):
2591         (KJS::FunctionCallDotNode::inlineEvaluate):
2592         * kjs/object.cpp:
2593         (KJS::JSObject::call):
2594         (KJS::JSObject::put):
2595         (KJS::tryGetAndCallProperty):
2596         (KJS::JSObject::lookupGetter):
2597         (KJS::JSObject::lookupSetter):
2598         (KJS::JSObject::toThisObject):
2599         (KJS::JSObject::toGlobalObject):
2600         (KJS::JSObject::fillGetterPropertySlot):
2601         * kjs/object.h:
2602         * kjs/object_object.cpp:
2603         (KJS::objectProtoFuncLookupGetter):
2604         (KJS::objectProtoFuncLookupSetter):
2605         * kjs/string_object.cpp:
2606         (KJS::replace):
2607
2608 2008-04-08  Brady Eidson  <beidson@apple.com>
2609
2610         Encourage Windows to rebuild - AGAIN...
2611
2612         * kjs/DateMath.cpp:
2613
2614 2008-04-08  Adam Roben  <aroben@apple.com>
2615
2616         Mac build fix
2617
2618         * JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
2619
2620 2008-04-08  Brady Eidson  <beidson@apple.com>
2621
2622         Rubberstamped by Adam Roben
2623         
2624         Touch some files to *strongly* encourage Windows to rebuilt with DOM_STORAGE enabled
2625
2626         * kjs/DateMath.cpp:
2627
2628 2008-04-08  Adam Roben  <aroben@apple.com>
2629
2630         Move callOnMainThread to WTF
2631
2632         Reviewed by Alexey Proskuryakov.
2633
2634         * GNUmakefile.am:
2635         * JavaScriptCore.pri:
2636         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2637         * JavaScriptCore.xcodeproj/project.pbxproj:
2638         * JavaScriptCoreSources.bkl:
2639         Added new files.
2640
2641         * wtf/MainThread.cpp:
2642         * wtf/MainThread.h:
2643         * wtf/gtk/MainThreadGtk.cpp:
2644         * wtf/mac/MainThreadMac.mm:
2645         * wtf/qt/MainThreadQt.cpp:
2646         * wtf/win/MainThreadWin.cpp:
2647         * wtf/wx/MainThreadWx.cpp:
2648         Moved here from WebCore/platform. Replaced all instances of "WebCore"
2649         with "WTF".
2650
2651         * kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
2652         build.
2653         to the WTF namespace.
2654         * wtf/ThreadingWin.cpp:
2655         (WTF::initializeThreading): Call initializeMainThread.
2656
2657 2008-04-07  Brady Eidson  <beidson@apple.com>
2658
2659         Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
2660
2661         * Configurations/JavaScriptCore.xcconfig:
2662
2663 2008-04-07  Adam Roben  <aroben@apple.com>
2664
2665         Windows build fix
2666
2667         * wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
2668
2669 2008-04-07  Adam Roben  <aroben@apple.com>
2670
2671         Add WTF::isMainThread
2672
2673         Reviewed by Alexey Proskuryakov.
2674
2675         * wtf/Threading.h: Declare the new function.
2676         * wtf/ThreadingGtk.cpp:
2677         (WTF::initializeThreading): Initialize the main thread identifier.
2678         (WTF::isMainThread): Added.
2679         * wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
2680         (WTF::initializeThreading):
2681         (WTF::isMainThread):
2682         * wtf/ThreadingPthreads.cpp: Ditto.
2683         (WTF::initializeThreading):
2684         (WTF::isMainThread):
2685         * wtf/ThreadingWin.cpp: Ditto.
2686         (WTF::initializeThreading):
2687         (WTF::isMainThread):
2688
2689 2008-04-06  Alexey Proskuryakov  <ap@webkit.org>
2690
2691         Reviewed by Darin.
2692
2693         Make UString thread-safe.
2694
2695         No change on SunSpider total, although individual tests have changed a lot, up to 3%.
2696
2697         * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
2698         a static.
2699         
2700         * kjs/identifier.cpp:
2701         (KJS::CStringTranslator::translate):
2702         (KJS::UCharBufferTranslator::translate):
2703         Use "true" for a boolean value instead of 1, because it's C++.
2704
2705         * kjs/ustring.h:
2706         (KJS::CString::adopt): Added a method to create from a char* buffer without copying.
2707         (KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
2708         necessary to hold JSLock when working with strings.
2709         (KJS::UString::Rep::deref): Ditto.
2710         (KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
2711         or null static string.
2712
2713         * kjs/ustring.cpp:
2714         (KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
2715         an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
2716         about UChar.
2717         (KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
2718         (KJS::UString::Rep::create): Ditto.
2719         (KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
2720         as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
2721         apparently this functiton is hot enough for SunSpider to see an effect from this!
2722         (KJS::UString::null): Moved a star, added a comment.
2723         (KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
2724         (KJS::UString::ascii): Simplified statBuffer handling logic.
2725         (KJS::UString::toDouble): Use cstring() instead of ascii().
2726
2727 2008-04-02  Mark Rowe  <mrowe@apple.com>
2728
2729         Reviewed by Oliver Hunt.
2730
2731         Ensure that debug symbols are generated for x86_64 and ppc64 builds.
2732
2733         * Configurations/Base.xcconfig:
2734
2735 2008-04-01  Christian Dywan  <christian@imendio.com>
2736
2737         Build fix for GCC 4.3.
2738
2739         * wtf/unicode/icu/CollatorICU.cpp: include string.h
2740
2741 2008-04-01  Alexey Proskuryakov  <ap@webkit.org>
2742
2743         Rubber-stamped by Darin.
2744
2745         Turn off using 64-bit arithmetic on 32-bit hardware, as dtoa own code is faster than
2746         compiler-provided emulation.
2747
2748         1% speedup on Acid3 test 26.
2749
2750         * kjs/dtoa.cpp:
2751
2752 2008-04-01  Alexey Proskuryakov  <ap@webkit.org>
2753
2754         Reviewed by Darin.
2755
2756         Make MathExtras.h thread safe.
2757
2758         * kjs/math_object.cpp:
2759         (KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call
2760         wtf_random_init().
2761
2762         * wtf/Threading.h:
2763         * wtf/ThreadingGtk.cpp:
2764         (WTF::initializeThreading):
2765         * wtf/ThreadingNone.cpp:
2766         (WTF::initializeThreading):
2767         * wtf/ThreadingPthreads.cpp:
2768         (WTF::initializeThreading):
2769         * wtf/ThreadingWin.cpp:
2770         (WTF::initializeThreading):
2771         Call wtf_random_init(); made the function non-inline to avoid having to include too many
2772         headers in Threading.h.
2773
2774 2008-03-31  Eric Seidel  <eric@webkit.org>
2775
2776         Reviewed by darin.
2777
2778         Make matching of regexps using ^ much faster
2779         http://bugs.webkit.org/show_bug.cgi?id=18086
2780
2781         * pcre/pcre_compile.cpp:
2782         (compileBranch):
2783         (branchNeedsLineStart):
2784         * pcre/pcre_exec.cpp:
2785         (match):
2786         (jsRegExpExecute):
2787         * pcre/pcre_internal.h:
2788
2789 2008-03-29  Alexey Proskuryakov  <ap@webkit.org>
2790
2791         Reviewed by Oliver Hunt.
2792
2793         <rdar://problem/5829556> REGRESSION: Leak in KJS::initializeThreading()
2794
2795         * kjs/InitializeThreading.cpp: (KJS::initializeThreading): There is no guarantee that
2796         initializeThreading() is called only once; check that the mutex hasn't been already allocated.
2797
2798 2008-03-29  Oliver Hunt  <oliver@apple.com>
2799
2800         Reviewed by Geoff.
2801
2802         Bug 17924: Crash in KJS::ConstDeclNode::evaluate with |with| and |const|
2803         <http://bugs.webkit.org/show_bug.cgi?id=17924>
2804         <rdar://problem/5806933>
2805
2806         It turns out this is trivially avoidable if we just match firefox's
2807         semantics and ensure that an assignment in a const declaration always
2808         writes to the variable object.
2809
2810         * kjs/nodes.cpp:
2811         (KJS::ConstDeclNode::handleSlowCase):
2812
2813 2008-03-28  Alexey Proskuryakov  <ap@webkit.org>
2814
2815         Reviewed by Sam Weinig.
2816
2817         Fix a dtoa thread safety issue.
2818
2819         WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
2820         compiled in for dtoa.
2821
2822         This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
2823         his recent improvement.
2824
2825         * kjs/dtoa.cpp:
2826         (Bigint::Balloc):
2827         (Bigint::Bfree):
2828         Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
2829         in the presence of locking (but somewhat slower in single-threaded case).
2830         (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
2831         restructure the code to avoid significant performance implications).
2832         (Bigint::lshift): Rewrote to avoid an allocation, if possible.
2833
2834         (Bigint::rv_alloc):
2835         (Bigint::kjs_freedtoa):
2836         (Bigint::kjs_dtoa):
2837         Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
2838
2839         * kjs/InitializeThreading.cpp: Added.
2840         (KJS::initializeThreading):
2841         * kjs/InitializeThreading.h: Added.
2842         Initialize threading at KJS level, if enabled.
2843
2844         * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
2845
2846         * kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
2847
2848         * JavaScriptCore.exp: Export KJS::initializeThreading.
2849
2850         * GNUmakefile.am:
2851         * JavaScriptCore.exp:
2852         * JavaScriptCore.pri:
2853         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2854         * JavaScriptCoreSources.bkl:
2855         * JavaScriptCore.xcodeproj/project.pbxproj:
2856         Added InitializeThreading.{h,cpp}.
2857
2858         * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
2859         to be called from KJS::initializeThreading, and having it in the global namespace is useless.
2860
2861 2008-03-28  Brady Eidson  <beidson@apple.com>
2862
2863         Reviewed by Darin
2864
2865         Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
2866
2867         * JavaScriptCore.exp:
2868         * JavaScriptCore.xcodeproj/project.pbxproj:
2869
2870 2008-03-27  Darin Adler  <darin@apple.com>
2871
2872         Reviewed by Mark Rowe.
2873
2874         <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
2875         compiled length calculated incorrectly.
2876
2877         * pcre/pcre_compile.cpp:
2878         (multiplyWithOverflowCheck):
2879         (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
2880         and bail with an error rather than returning incorrect results.
2881
2882 2008-03-26  Mark Rowe  <mrowe@apple.com>
2883
2884         Rubber-stamped by Brady Eidson.
2885
2886         Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
2887
2888         * Configurations/JavaScriptCore.xcconfig:
2889
2890 2008-03-26  Adam Roben  <aroben@apple.com>
2891
2892         Fix Bug 18060: Assertion failure (JSLock not held) beneath
2893         JSCallbackObject<Base>::toString
2894
2895         <http://bugs.webkit.org/show_bug.cgi?id=18060>
2896
2897         Reviewed by Geoff Garen.
2898
2899         Bug fix:
2900
2901         * API/JSCallbackObjectFunctions.h:
2902         (KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks
2903         instance only be in scope while calling convertToType.
2904
2905         Test:
2906
2907         * API/testapi.c:
2908         (MyObject_convertToType): Implement type conversion to string.
2909         * API/testapi.js: Add a test for type conversion to string.
2910
2911 2008-03-26  Adam Roben  <aroben@apple.com>
2912
2913         Windows build fix
2914
2915         * kjs/array_instance.cpp: Touched this.
2916         * wtf/HashFunctions.h:
2917         (WTF::intHash): Added 8- and 16-bit versions of intHash.
2918
2919 2008-03-26  Adam Roben  <aroben@apple.com>
2920
2921         Force JSC headers to be copied by touching a file
2922
2923         * kjs/array_instance.cpp:
2924         (KJS::ArrayInstance::getPropertyNames):
2925
2926 2008-03-26  Adam Roben  <aroben@apple.com>
2927
2928         Windows build fix after r31324
2929
2930         Written with Darin.
2931
2932         Added HashTable plumbing to support using wchar_t as a key type.
2933
2934         * wtf/HashFunctions.h:
2935         * wtf/HashTraits.h:
2936         (WTF::):
2937
2938 2008-03-26  Maciej Stachowiak  <mjs@apple.com>
2939
2940         Reviewed by Darin.
2941
2942         - JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
2943         http://bugs.webkit.org/show_bug.cgi?id=18118
2944
2945         * wtf/HashFunctions.h:
2946         (WTF::):
2947         * wtf/HashTraits.h:
2948         (WTF::):
2949
2950 2008-03-26  Alexey Proskuryakov  <ap@webkit.org>
2951
2952         Reviewed by Darin.
2953
2954         Cache C string identifiers by address, not value, assuming that C strings can only
2955         be literals.
2956
2957         1% speedup on Acid3 test 26.
2958
2959         * kjs/identifier.cpp:
2960         (KJS::literalIdentifierTable):
2961         (KJS::Identifier::add):
2962         Added a new table to cache UString::Reps created from C strings by address. Elements are
2963         never removed from this cache, as only predefined identifiers can get there.
2964
2965         * kjs/identifier.h:
2966         (KJS::Identifier::Identifier): Added a warning.
2967
2968 2008-03-26  Alexey Proskuryakov  <ap@webkit.org>
2969
2970         Rubber-stamped by Maciej.
2971
2972         An assertion was failing in function-toString-object-literals.html when parsing 1e-500.
2973         The condition existed before, and got uncovered by turning compiled-out dtoa checks into
2974         ASSERTs.
2975
2976         The assertion was verifying that the caller wasn't constructing a Bigint from 0.
2977         This might have had some reason behind it originally, but I couldn't find any,
2978         and this doesn't look like a reasonable requirement.
2979
2980         * kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths).
2981
2982 2008-03-25  Adam Roben  <aroben@apple.com>
2983
2984         Fix Bug 18077: Integrate testapi.c into the Windows build
2985
2986         <http://bugs.webkit.org/show_bug.cgi?id=18077>
2987
2988         Reviewed by Steve Falkenburg.
2989
2990         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
2991
2992 2008-03-25  Adam Roben  <aroben@apple.com>
2993
2994         Make testapi.c compile under MSVC
2995
2996         Currently you must compile testapi.c as C++ code since MSVC does not
2997         support many C features that GCC does.
2998
2999         Reviewed by Steve Falkenburg.
3000
3001         * API/testapi.c:
3002         (nan): Added an implementation of this for MSVC.
3003         (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
3004         stack arrays.
3005         (assertEqualsAsCharactersPtr): Ditto.
3006         (print_callAsFunction): Ditto.
3007         (main): Ditto, and explicitly cast from UniChar* to JSChar*.
3008
3009 2008-03-25  Adam Roben  <aroben@apple.com>
3010
3011         Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows
3012
3013         We can't remove the os-win32 directory yet because other ports (at
3014         least wx) are still relying on it.
3015
3016         Reviewed by Steve Falkenburg.
3017
3018         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3019           - Made all the include paths match the one for the Debug
3020             configuration (these got out of sync in r30797)
3021           - Removed os-win32 from the include path
3022           - Removed os-win32 from the directories we copy to $WebKitOutputDir.
3023           - Removed stdint.h from the project
3024         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3025         Delete the files that we may have previously copied from the os-win32
3026         directory.
3027
3028 2008-03-25  Alexey Proskuryakov  <ap@webkit.org>
3029
3030         Windows build fix.
3031
3032         * kjs/dtoa.cpp: Include stdint.h.
3033
3034 2008-03-25  Alexey Proskuryakov  <ap@webkit.org>
3035
3036         Rubber-stamped by Darin.
3037
3038         Cleanup dtoa.cpp style.
3039
3040         * kjs/dtoa.cpp:
3041         (Bigint::Balloc):
3042         (Bigint::Bfree):
3043         (Bigint::multadd):
3044         (Bigint::s2b):
3045         (Bigint::hi0bits):
3046         (Bigint::lo0bits):
3047         (Bigint::i2b):
3048         (Bigint::mult):
3049         (Bigint::pow5mult):
3050         (Bigint::lshift):
3051         (Bigint::cmp):
3052         (Bigint::diff):
3053         (Bigint::ulp):
3054         (Bigint::b2d):
3055         (Bigint::d2b):
3056         (Bigint::ratio):
3057         (Bigint::):
3058         (Bigint::match):
3059         (Bigint::hexnan):
3060         (Bigint::kjs_strtod):
3061         (Bigint::quorem):
3062         (Bigint::rv_alloc):
3063         (Bigint::nrv_alloc):
3064         (Bigint::kjs_freedtoa):
3065         (Bigint::kjs_dtoa):
3066         * kjs/dtoa.h:
3067
3068 2008-03-24  Darin Adler  <darin@apple.com>
3069
3070         Reviewed by Sam.
3071
3072         - convert a JavaScript immediate number to a string more efficiently
3073
3074         2% speedup of Acid3 test 26
3075
3076         * kjs/JSImmediate.cpp:
3077         (KJS::JSImmediate::toString): Take advantage of the fact that all immediate
3078         numbers are integers, and use the faster UString function for formatting integers
3079         instead of the slower one that works for floating point. I think this is a leftover
3080         from when immediate numbers were floating point.
3081
3082 2008-03-23  Sam Weinig  <sam@webkit.org>
3083
3084         Reviewed by Darin Adler.
3085
3086         Fix http://bugs.webkit.org/show_bug.cgi?id=18048
3087         The "thisObject" parameter to JSEvaluateScript is not used properly
3088
3089         Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
3090         ExecState.
3091
3092         * API/testapi.c:
3093         (main): Add tests for setting the thisObject when calling JSEvaluateScript.
3094
3095         * kjs/ExecState.cpp:
3096         (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment. 
3097
3098 2008-03-22  Jesse Ruderman  <jruderman@gmail.com>
3099
3100         Reviewed by Sam Weinig.  Landed by eseidel.
3101         
3102         Make testkjs flush stdout after printing.
3103
3104         * JavaScriptCore.xcodeproj/project.pbxproj:
3105         * kjs/testkjs.cpp:
3106         (functionPrint):
3107
3108 2008-03-21  Oliver Hunt  <oliver@apple.com>
3109
3110         Reviewed by Maciej.
3111
3112         Optimise lookup of Math, undefined, NaN and Infinity
3113
3114         Added a method to JSVariableObject to allow us to inject DontDelete properties
3115         into the symbol table and localStorage.  This results in a 0.4% progression in
3116         SunSpider, with a 8% gain in math-partial-sums.
3117
3118         * kjs/JSGlobalObject.cpp:
3119         (KJS::JSGlobalObject::reset):
3120         * kjs/JSVariableObject.h:
3121         (KJS::JSVariableObject::symbolTableInsert):
3122
3123 2008-03-21  Oliver Hunt  <oliver@apple.com>
3124
3125         Reviewed by Geoff Garen.
3126
3127         Global properties that use LocalStorage are not correctly listed as enumerable.
3128
3129         The problem was caused by JSObject::getPropertyAttributes not being aware
3130         of the JSVariableObject SymbolTable.  The fix is to make getPropertyAttributes
3131         virtual and override in JSVariableObject.  This does not produce any performance
3132         regression.
3133
3134         * JavaScriptCore.exp:
3135         * kjs/JSVariableObject.cpp:
3136         (KJS::JSVariableObject::getPropertyNames):
3137         (KJS::JSVariableObject::getPropertyAttributes):
3138         * kjs/JSVariableObject.h:
3139         * kjs/object.h:
3140
3141 2008-03-21  Arkadiusz Miskiewicz  <arekm@maven.pl>
3142
3143         Webkit does not build on linux powerpc
3144
3145         <http://bugs.webkit.org/show_bug.cgi?id=17019>
3146
3147         Reviewed by David Kilzer.
3148
3149         * wtf/TCSpinLock.h:
3150         (TCMalloc_SpinLock::Unlock):
3151
3152 2008-03-21  Rodney Dawes  <dobey@wayofthemonkey.com>
3153
3154         Reviewed by Holger.
3155
3156         http://bugs.webkit.org/show_bug.cgi?id=17981
3157
3158         Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS.
3159
3160         * GNUmakefile.am:
3161
3162 2008-03-21  Alexey Proskuryakov  <ap@webkit.org>
3163
3164         Reviewed by Oliver Hunt.
3165
3166         Consolidate static identifier initializers within CommonIdentifiers.
3167
3168         No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
3169
3170         * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
3171         throughout the code.
3172
3173         * kjs/date_object.cpp:
3174         (KJS::DateObjectImp::DateObjectImp):
3175         * kjs/function_object.cpp:
3176         (KJS::FunctionPrototype::FunctionPrototype):
3177         * kjs/object_object.cpp:
3178         (KJS::ObjectPrototype::ObjectPrototype):
3179         * kjs/regexp_object.cpp:
3180         (KJS::RegExpPrototype::RegExpPrototype):
3181         Use the values from CommonIdentifiers. 
3182
3183         * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
3184
3185         * kjs/value.h:
3186         (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
3187
3188         * wtf/MathExtras.h:
3189         (wtf_atan2): Having local variables for numeric_limits constants is good for readability,
3190         but there is no reason to keep them static.
3191
3192         * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
3193
3194 2008-03-20  Oliver Hunt  <oliver@apple.com>
3195
3196         Reviewed by Maciej.
3197
3198         Fix for leak introduced by inline ScopeChainNode use
3199
3200         To avoid any extra branches when managing an inline ScopeChainNode
3201         in the ScopeChain the inline node gets inserted with a refcount of
3202         2.  This meant than when the ScopeChain was destroyed the ScopeChainNodes
3203         above the inline node would be leaked.
3204
3205         We resolve this by manually popping the inline node in the
3206         FunctionExecState destructor.
3207
3208         * JavaScriptCore.xcodeproj/project.pbxproj:
3209         * kjs/ExecStateInlines.h:
3210         (KJS::FunctionExecState::~FunctionExecState):
3211         * kjs/scope_chain.h:
3212         (KJS::ScopeChain::popInlineScopeNode):
3213
3214 2008-03-20  Mark Rowe  <mrowe@apple.com>
3215
3216         Reviewed by Sam Weinig.
3217
3218         Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
3219         This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
3220         command-line.
3221
3222         * Configurations/JavaScriptCore.xcconfig:
3223
3224 2008-03-20  David Krause  <david.krause@gmail.com>
3225
3226         Reviewed by David Kilzer.
3227
3228         Fix http://bugs.webkit.org/show_bug.cgi?id=17923
3229         Bug 17923: ARM platform endian defines inaccurate
3230
3231         * wtf/Platform.h: 
3232         Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__)
3233         for PLATFORM(MIDDLE_ENDIAN)
3234
3235 2008-03-20  Maciej Stachowiak  <mjs@apple.com>
3236
3237         - fix build
3238
3239         * JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private
3240
3241 2008-03-20  Maciej Stachowiak  <mjs@apple.com>
3242
3243         Reviewed by Oliver.
3244         
3245         - reduce function call overhead for 1.014x speedup on SunSpider
3246
3247         I moved some functions from ExecState.cpp to ExecStateInline.h and
3248         from JSGlobalObject.cpp to JSGlobalObject.h, and declared them
3249         inline; machine function call overhead for these was hurting JS
3250         funcion call overhead.
3251         
3252         * kjs/ExecState.cpp:
3253         * kjs/ExecStateInlines.h: Added.
3254         (KJS::ExecState::ExecState):
3255         (KJS::ExecState::~ExecState):
3256         (KJS::FunctionExecState::FunctionExecState):
3257         (KJS::FunctionExecState::~FunctionExecState):
3258         * kjs/JSGlobalObject.cpp:
3259         * kjs/JSGlobalObject.h:
3260         (KJS::JSGlobalObject::pushActivation):
3261         (KJS::JSGlobalObject::checkActivationCount):
3262         (KJS::JSGlobalObject::popActivation):
3263         * kjs/function.cpp:
3264
3265 2008-03-19  Oliver Hunt  <oliver@apple.com>
3266
3267         Reviewed by Maciej.
3268
3269         Avoid heap allocating the root scope chain node for eval and closure free functions
3270
3271         Maciej suggested using an inline ScopeChainNode for functions that don't use eval
3272         or closures as they are unable to ever capture the scope chain.  This gives us a 2.4%
3273         win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number 
3274         of other tests.
3275
3276         * kjs/ExecState.cpp:
3277         (KJS::ExecState::ExecState):
3278         * kjs/ExecState.h:
3279         * kjs/scope_chain.h:
3280         (KJS::ScopeChain::push):
3281
3282 2008-03-19  Mark Rowe  <mrowe@apple.com>
3283
3284         Reviewed by Sam Weinig.
3285
3286         Fix release build.
3287
3288         * kjs/JSGlobalObject.cpp:  Add missing #include.
3289
3290 2008-03-19  Sam Weinig  <sam@webkit.org>
3291
3292         Reviewed by Anders Carlsson.
3293
3294         Fix for <rdar://problem/5785694>
3295         Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
3296
3297         Make the activeExecStates stack per JSGlobalObject instead of static to ensure
3298         thread safety.
3299
3300         * JavaScriptCore.exp:
3301         * kjs/ExecState.cpp:
3302         (KJS::InterpreterExecState::InterpreterExecState):
3303         (KJS::InterpreterExecState::~InterpreterExecState):
3304         (KJS::EvalExecState::EvalExecState):
3305         (KJS::EvalExecState::~EvalExecState):
3306         (KJS::FunctionExecState::FunctionExecState):
3307         (KJS::FunctionExecState::~FunctionExecState):
3308         * kjs/ExecState.h:
3309         (KJS::):
3310         * kjs/JSGlobalObject.cpp:
3311         (KJS::JSGlobalObject::mark):
3312         * kjs/JSGlobalObject.h:
3313         (KJS::JSGlobalObject::activeExecStates):
3314         * kjs/collector.cpp:
3315         (KJS::Collector::collect):
3316         (KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report
3317         the OutOfMemory condition to all the ExecStates in each.
3318
3319 2008-03-19  Jasper Bryant-Greene  <jasper@unix.geek.nz>
3320
3321         Reviewed by Maciej Stachowiak.
3322
3323         Fix http://bugs.webkit.org/show_bug.cgi?id=17941
3324         Bug 17941: C++-style comments in JavaScriptCore API
3325
3326         * API/JSBase.h:
3327         Remove C++-style comments from public JavaScriptCore API, replacing
3328         with standard C90 block comments.
3329
3330 2008-03-19  Mark Rowe  <mrowe@apple.com>
3331
3332         Reviewed by Oliver Hunt.
3333
3334         Fix http://bugs.webkit.org/show_bug.cgi?id=17939
3335         Bug 17939: Crash decompiling "const a = 1, b;"
3336
3337         * kjs/nodes2string.cpp:
3338         (KJS::ConstDeclNode::streamTo): Null-check the correct variable.
3339
3340 2008-03-18  Oliver Hunt  <oliver@apple.com>
3341
3342         Reviewed by Mark Rowe.
3343
3344         Bug 17929: Incorrect decompilation with |const|, comma
3345         http://bugs.webkit.org/show_bug.cgi?id=17929
3346
3347         There were actually two bugs here. First we weren't correctly handling const
3348         nodes with multiple declarations. The second issue was caused by us not 
3349         giving the correct precedence to the initialisers.
3350
3351         * kjs/nodes2string.cpp:
3352         (KJS::ConstDeclNode::streamTo):
3353
3354 2008-03-18  Darin Adler  <darin@apple.com>
3355
3356         Reviewed by Maciej.
3357
3358         - Speed up JavaScript built-in properties by changing the
3359           hash table to take advantage of the identifier objects
3360
3361         5% speedup for Acid3 test 26
3362
3363         * JavaScriptCore.exp: Updated.
3364         * kjs/create_hash_table: Compute size of hash table large enough so that there
3365         are no collisions, but don't generate the hash table.
3366         * kjs/identifier.h: Made the add function that returns a PassRefPtr public.
3367         * kjs/lexer.cpp:
3368         (KJS::Lexer::lex): Updated for change to HashTable interface.
3369         * kjs/lookup.cpp:
3370         (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for
3371         each property so the equality comparision can be done with pointer comparision.
3372         * kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can
3373         hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed
3374         the Lookup functions to be member functions of HashTable instead.
3375         * kjs/object.cpp:
3376         (KJS::JSObject::deleteProperty): Update for change to HashTable.
3377         (KJS::JSObject::findPropertyHashEntry): Ditto.
3378         (KJS::JSObject::getPropertyAttributes): Ditto.
3379         (KJS::JSObject::getPropertyNames): Ditto.
3380
3381 2008-03-18  Mark Rowe  <mrowe@apple.com>
3382
3383         Reviewed by Oliver Hunt.
3384
3385         Fix http://bugs.webkit.org/show_bug.cgi?id=17925 and http://bugs.webkit.org/show_bug.cgi?id=17927.
3386         - Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__
3387         - Bug 17927: Hang after attempting to create circular __proto__
3388
3389         * kjs/object.cpp:
3390         (KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value.
3391         Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that
3392         the cyclic value is not set.
3393
3394 2008-03-18  Maciej Stachowiak  <mjs@apple.com>
3395
3396         Reviewed by Oliver.
3397         
3398         - inline ActivationImp::init for 0.8% SunSpider speedup
3399
3400         * kjs/Activation.h:
3401         (KJS::ActivationImp::init): Moved here from function.cpp
3402         * kjs/function.cpp:
3403
3404 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
3405
3406         Fix the Qt build.
3407
3408         Including config.h like in the other .cpp files gets the #ifdeffery
3409         correct for rand_s.
3410
3411         * kjs/JSWrapperObject.cpp:
3412
3413 2008-03-17  Darin Adler  <darin@apple.com>
3414
3415         Reviewed by Maciej.
3416
3417         JavaScriptCore changes to support a WebCore speedup.
3418
3419         * JavaScriptCore.exp: Export the UString::Rep::computeHash function.
3420         * wtf/HashSet.h: Added a find and contains function that take a translator,
3421         like the add function.
3422
3423 2008-03-18  Maciej Stachowiak  <mjs@apple.com>
3424
3425         Reviewed by Oliver.
3426         
3427         - a few micro-optimizations for 1.2% SunSpider speedup
3428
3429         * kjs/function.cpp:
3430         (KJS::FunctionImp::callAsFunction): check for Return completion before Throw,
3431         it is more likely.
3432         * kjs/object.cpp:
3433         (KJS::JSObject::put): When walking prototype chain, instead of
3434         checking isObject (a virtual call), compare to jsNull (compare to
3435         a constant) since null is the only non-object that can be in a
3436         prototype chain.
3437
3438 2008-03-17  Oliver Hunt  <oliver@apple.com>
3439
3440         Reviewed by Geoff.
3441
3442         Optimise multi-scope function call resolution
3443
3444         Refactor multiscope variable resolution and use to add
3445         optimised FunctionCallResolveNode subclasses.  
3446
3447         2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
3448
3449         * kjs/nodes.cpp:
3450         (KJS::getSymbolTableEntry):
3451         (KJS::ResolveNode::optimizeVariableAccess):
3452         (KJS::getNonLocalSymbol):
3453         (KJS::ExpressionNode::resolveAndCall):
3454         (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3455         (KJS::FunctionCallResolveNode::inlineEvaluate):
3456         (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
3457         (KJS::ScopedVarFunctionCallNode::evaluate):
3458         (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
3459         (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
3460         (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
3461         (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
3462         (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
3463         (KJS::NonLocalVarFunctionCallNode::evaluate):
3464         (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
3465         (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
3466         (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
3467         (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
3468         * kjs/nodes.h:
3469         (KJS::ScopedVarFunctionCallNode::):
3470         (KJS::NonLocalVarFunctionCallNode::):
3471
3472 2008-03-17  David Kilzer  <ddkilzer@apple.com>
3473
3474         Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
3475
3476         Reviewed by Darin.
3477
3478         See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
3479
3480         * wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
3481         PLATFORM(MIDDLE_ENDIAN).
3482
3483 2008-03-17  Oliver Hunt  <oliver@apple.com>
3484
3485         Reviewed by Geoff, Darin and Weinig.
3486
3487         Add fast multi-level scope lookup
3488         
3489         Add logic and AST nodes to provide rapid variable resolution across
3490         static scope boundaries.  This also adds logic that allows us to skip
3491         any static scopes that do not contain the variable to be resolved.
3492         
3493         This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
3494         in some simple and ad hoc closure and global variable access tests.
3495
3496         * JavaScriptCore.exp:
3497         * kjs/Activation.h:
3498         * kjs/JSGlobalObject.cpp:
3499         * kjs/JSGlobalObject.h:
3500         * kjs/JSVariableObject.cpp:
3501         * kjs/JSVariableObject.h:
3502         * kjs/function.cpp:
3503         (KJS::ActivationImp::isDynamicScope):
3504         * kjs/nodes.cpp:
3505         (KJS::ResolveNode::optimizeVariableAccess):
3506         (KJS::ScopedVarAccessNode::inlineEvaluate):
3507         (KJS::ScopedVarAccessNode::evaluate):
3508         (KJS::ScopedVarAccessNode::evaluateToNumber):
3509         (KJS::ScopedVarAccessNode::evaluateToBoolean):
3510         (KJS::ScopedVarAccessNode::evaluateToInt32):
3511         (KJS::ScopedVarAccessNode::evaluateToUInt32):
3512         (KJS::NonLocalVarAccessNode::inlineEvaluate):
3513         (KJS::NonLocalVarAccessNode::evaluate):
3514         (KJS::NonLocalVarAccessNode::evaluateToNumber):
3515         (KJS::NonLocalVarAccessNode::evaluateToBoolean):
3516         (KJS::NonLocalVarAccessNode::evaluateToInt32):
3517         (KJS::NonLocalVarAccessNode::evaluateToUInt32):
3518         (KJS::IfElseNode::optimizeVariableAccess):
3519         (KJS::ScopeNode::optimizeVariableAccess):
3520         * kjs/nodes.h:
3521         (KJS::ScopedVarAccessNode::):
3522         (KJS::NonLocalVarAccessNode::):
3523         * kjs/object.h:
3524
3525  2008-03-16  weihongzeng  <weihong.zeng@hotmail.com>
3526  
3527          Reviewed by Darin Adler.
3528  
3529          http://bugs.webkit.org/show_bug.cgi?id=15416
3530          Add support for mixed-endian processors
3531  
3532          * kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
3533  
3534 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
3535
3536         Rubber stamped by Darin.
3537
3538         Add set-webkit-configuration support for wx port, and centralize
3539         build dir location setting.
3540
3541         http://bugs.webkit.org/show_bug.cgi?id=17790
3542
3543         * jscore.bkl: