34370e77665bc168e8d64b56ad4fde66edf9bd2a
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-06-20  Ariya Hidayat  <ariya.hidayat@trolltech.com>
2
3         Reviewed by Adam Roben.
4
5         Fix compile with MinGW.
6
7         * kjs/Shell.cpp:
8         * wtf/Threading.h:
9         (WTF::atomicIncrement):
10         (WTF::atomicDecrement):
11
12 2008-06-23  Mark Rowe  <mrowe@apple.com>
13
14         Reviewed by Oliver Hunt.
15
16         Prepration for returning memory to the OS on Windows.  Track whether a portion of a span of memory was returned to the OS.
17         If it was, ask that it be recommitted before returning it to the application as an allocated region.
18
19         * wtf/FastMalloc.cpp:
20         (WTF::TCMalloc_PageHeap::New):  If the span was decommitted, ask that it be recommitted before returning it.
21         (WTF::TCMalloc_PageHeap::AllocLarge):  Ditto.
22         (WTF::TCMalloc_PageHeap::Carve):  When splitting a span, ensure that the decommitted state propogates to the two new spans.
23         (WTF::TCMalloc_PageHeap::Delete):  When merging a span, ensure that the resulting span is marked as decommitted if any of the
24         spans being merged were marked as decommitted.
25         (WTF::TCMalloc_PageHeap::IncrementalScavenge):  Mark as decommitted after releasing the span.
26         (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Add an assertion to catch a decommitted span being returned to the application
27         without first being recommitted.
28         (WTF::TCMalloc_Central_FreeList::Populate): Ditto.
29         * wtf/TCSystemAlloc.cpp: Stub out TCMalloc_SystemCommit.
30         * wtf/TCSystemAlloc.h:
31
32 2008-06-23  Mark Rowe  <mrowe@apple.com>
33
34         Reviewed by Sam Weinig.
35
36         Remove the sample member of Span when NO_TCMALLOC_SAMPLES is defined.
37
38         * wtf/FastMalloc.cpp:
39         (WTF::TCMalloc_PageHeap::Delete): Only update Span::sample if NO_TCMALLOC_SAMPLES is not defined.
40         (WTF::TCMallocStats::do_free):  Ditto.
41
42 2008-06-23  Darin Adler  <darin@apple.com>
43
44         Reviewed by Geoff.
45
46         - work toward https://bugs.webkit.org/show_bug.cgi?id=19721
47
48         More preparation toward making functions work on primitive types without
49         creating wrapper objects. No speedup this time, but prepares for a future
50         speedup without slowing things down.
51
52         SunSpider reports no change.
53
54         - Eliminated the implementsCall, callAsFunction and construct virtual
55           functions from JSObject. Instead, the CallData and ConstructData for
56           a native function includes a function pointer that the caller can use
57           directly. Changed all call sites to use CallData and ConstructData.
58
59         - Changed the "this" argument to native functions to be a JSValue rather
60           than a JSObject. This prepares us for passing primitives into these
61           functions. The conversion to an object now must be done inside the
62           function. Critically, if it's a function that can be called on a DOM
63           window object, then we have to be sure to call toThisObject on the
64           argument before we use it for anything even if it's already an object.
65
66         - Eliminated the practice of using constructor objects in the global
67           object to make objects of the various basic types. Since these
68           constructors can't be replaced by script, there's no reason to involve
69           a constructor object at all. Added functions to do the construction
70           directly.
71
72         - Made some more class members private and protected, including virtual
73           function overrides. This can catch code using unnecessarily slow virtual
74           function code paths when the type of an object is known statically. If we
75           later find a new reason use the members outside the class it's easy to
76           make them public again.
77
78         - Moved the declarations of the native implementations for functions out
79           of header files. These can have internal linkage and be declared inside
80           the source file.
81
82         - Changed PrototypeFunction to take function pointers with the right
83           arguments to be put directly into CallData. This eliminates the
84           need to have a separate PrototypeReflexiveFunction, and reveals that the
85           real purpose of that class included something else specific to eval --
86           storage of a cached global object. So renamed PrototypeReflexiveFunction
87           to GlobalEvalFunction.
88
89         * API/JSCallbackConstructor.cpp:
90         (KJS::constructJSCallback):
91         (KJS::JSCallbackConstructor::getConstructData):
92         * API/JSCallbackConstructor.h:
93         * API/JSCallbackFunction.cpp:
94         (KJS::JSCallbackFunction::implementsHasInstance):
95         (KJS::JSCallbackFunction::call):
96         (KJS::JSCallbackFunction::getCallData):
97         * API/JSCallbackFunction.h:
98         (KJS::JSCallbackFunction::classInfo):
99         * API/JSCallbackObject.h:
100         (KJS::JSCallbackObject::classRef):
101         (KJS::JSCallbackObject::classInfo):
102         * API/JSCallbackObjectFunctions.h:
103         (KJS::::getConstructData):
104         (KJS::::construct):
105         (KJS::::getCallData):
106         (KJS::::call):
107         * API/JSObjectRef.cpp:
108         (JSObjectMakeFunction):
109         (JSObjectIsFunction):
110         (JSObjectCallAsFunction):
111         (JSObjectCallAsConstructor):
112         * JavaScriptCore.exp:
113         * VM/Machine.cpp:
114         (KJS::jsTypeStringForValue):
115         (KJS::Machine::privateExecute):
116         * kjs/ArrayPrototype.cpp:
117         (KJS::arrayProtoFuncToString):
118         (KJS::arrayProtoFuncToLocaleString):
119         (KJS::arrayProtoFuncJoin):
120         (KJS::arrayProtoFuncConcat):
121         (KJS::arrayProtoFuncPop):
122         (KJS::arrayProtoFuncPush):
123         (KJS::arrayProtoFuncReverse):
124         (KJS::arrayProtoFuncShift):
125         (KJS::arrayProtoFuncSlice):
126         (KJS::arrayProtoFuncSort):
127         (KJS::arrayProtoFuncSplice):
128         (KJS::arrayProtoFuncUnShift):
129         (KJS::arrayProtoFuncFilter):
130         (KJS::arrayProtoFuncMap):
131         (KJS::arrayProtoFuncEvery):
132         (KJS::arrayProtoFuncForEach):
133         (KJS::arrayProtoFuncSome):
134         (KJS::arrayProtoFuncIndexOf):
135         (KJS::arrayProtoFuncLastIndexOf):
136         (KJS::ArrayConstructor::ArrayConstructor):
137         (KJS::constructArrayWithSizeQuirk):
138         (KJS::constructWithArrayConstructor):
139         (KJS::ArrayConstructor::getConstructData):
140         (KJS::callArrayConstructor):
141         (KJS::ArrayConstructor::getCallData):
142         * kjs/ArrayPrototype.h:
143         * kjs/BooleanObject.cpp:
144         (KJS::booleanProtoFuncToString):
145         (KJS::booleanProtoFuncValueOf):
146         (KJS::constructBoolean):
147         (KJS::constructWithBooleanConstructor):
148         (KJS::BooleanConstructor::getConstructData):
149         (KJS::callBooleanConstructor):
150         (KJS::BooleanConstructor::getCallData):
151         (KJS::constructBooleanFromImmediateBoolean):
152         * kjs/BooleanObject.h:
153         * kjs/CallData.h:
154         (KJS::):
155         * kjs/ConstructData.h:
156         (KJS::):
157         * kjs/FunctionPrototype.cpp:
158         (KJS::callFunctionPrototype):
159         (KJS::FunctionPrototype::getCallData):
160         (KJS::functionProtoFuncToString):
161         (KJS::functionProtoFuncApply):
162         (KJS::functionProtoFuncCall):
163         (KJS::constructWithFunctionConstructor):
164         (KJS::FunctionConstructor::getConstructData):
165         (KJS::callFunctionConstructor):
166         (KJS::FunctionConstructor::getCallData):
167         (KJS::constructFunction):
168         * kjs/FunctionPrototype.h:
169         * kjs/JSArray.cpp:
170         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
171         (KJS::JSArray::sort):
172         (KJS::constructEmptyArray):
173         (KJS::constructArray):
174         * kjs/JSArray.h:
175         (KJS::JSArray::classInfo):
176         * kjs/JSFunction.cpp:
177         (KJS::JSFunction::call):
178         (KJS::globalFuncEval):
179         (KJS::globalFuncParseInt):
180         (KJS::globalFuncParseFloat):
181         (KJS::globalFuncIsNaN):
182         (KJS::globalFuncIsFinite):
183         (KJS::globalFuncDecodeURI):
184         (KJS::globalFuncDecodeURIComponent):
185         (KJS::globalFuncEncodeURI):
186         (KJS::globalFuncEncodeURIComponent):
187         (KJS::globalFuncEscape):
188         (KJS::globalFuncUnescape):
189         (KJS::globalFuncKJSPrint):
190         (KJS::PrototypeFunction::PrototypeFunction):
191         (KJS::PrototypeFunction::getCallData):
192         (KJS::GlobalEvalFunction::GlobalEvalFunction):
193         (KJS::GlobalEvalFunction::mark):
194         * kjs/JSFunction.h:
195         (KJS::InternalFunction::classInfo):
196         (KJS::InternalFunction::functionName):
197         (KJS::JSFunction::classInfo):
198         (KJS::GlobalEvalFunction::cachedGlobalObject):
199         * kjs/JSGlobalObject.cpp:
200         (KJS::JSGlobalObject::reset):
201         (KJS::JSGlobalObject::mark):
202         * kjs/JSGlobalObject.h:
203         (KJS::JSGlobalObject::JSGlobalObject):
204         (KJS::JSGlobalObject::evalFunction):
205         * kjs/JSImmediate.cpp:
206         (KJS::JSImmediate::toObject):
207         * kjs/JSNotAnObject.cpp:
208         * kjs/JSNotAnObject.h:
209         * kjs/JSObject.cpp:
210         (KJS::JSObject::put):
211         (KJS::callDefaultValueFunction):
212         (KJS::JSObject::defaultValue):
213         (KJS::JSObject::lookupGetter):
214         (KJS::JSObject::lookupSetter):
215         (KJS::JSObject::hasInstance):
216         (KJS::JSObject::fillGetterPropertySlot):
217         (KJS::Error::create):
218         (KJS::constructEmptyObject):
219         * kjs/JSObject.h:
220         (KJS::GetterSetter::GetterSetter):
221         (KJS::GetterSetter::getter):
222         (KJS::GetterSetter::setGetter):
223         (KJS::GetterSetter::setter):
224         (KJS::GetterSetter::setSetter):
225         * kjs/JSValue.cpp:
226         (KJS::JSCell::deleteProperty):
227         (KJS::call):
228         (KJS::construct):
229         * kjs/JSValue.h:
230         * kjs/MathObject.cpp:
231         (KJS::mathProtoFuncAbs):
232         (KJS::mathProtoFuncACos):
233         (KJS::mathProtoFuncASin):
234         (KJS::mathProtoFuncATan):
235         (KJS::mathProtoFuncATan2):
236         (KJS::mathProtoFuncCeil):
237         (KJS::mathProtoFuncCos):
238         (KJS::mathProtoFuncExp):
239         (KJS::mathProtoFuncFloor):
240         (KJS::mathProtoFuncLog):
241         (KJS::mathProtoFuncMax):
242         (KJS::mathProtoFuncMin):
243         (KJS::mathProtoFuncPow):
244         (KJS::mathProtoFuncRandom):
245         (KJS::mathProtoFuncRound):
246         (KJS::mathProtoFuncSin):
247         (KJS::mathProtoFuncSqrt):
248         (KJS::mathProtoFuncTan):
249         * kjs/MathObject.h:
250         * kjs/NumberObject.cpp:
251         (KJS::numberProtoFuncToString):
252         (KJS::numberProtoFuncToLocaleString):
253         (KJS::numberProtoFuncValueOf):
254         (KJS::numberProtoFuncToFixed):
255         (KJS::numberProtoFuncToExponential):
256         (KJS::numberProtoFuncToPrecision):
257         (KJS::NumberConstructor::NumberConstructor):
258         (KJS::constructWithNumberConstructor):
259         (KJS::NumberConstructor::getConstructData):
260         (KJS::callNumberConstructor):
261         (KJS::NumberConstructor::getCallData):
262         (KJS::constructNumber):
263         (KJS::constructNumberFromImmediateNumber):
264         * kjs/NumberObject.h:
265         (KJS::NumberObject::classInfo):
266         (KJS::NumberConstructor::classInfo):
267         * kjs/PropertySlot.cpp:
268         (KJS::PropertySlot::functionGetter):
269         * kjs/RegExpObject.cpp:
270         (KJS::regExpProtoFuncTest):
271         (KJS::regExpProtoFuncExec):
272         (KJS::regExpProtoFuncCompile):
273         (KJS::regExpProtoFuncToString):
274         (KJS::callRegExpObject):
275         (KJS::RegExpObject::getCallData):
276         (KJS::constructRegExp):
277         (KJS::constructWithRegExpConstructor):
278         (KJS::RegExpConstructor::getConstructData):
279         (KJS::callRegExpConstructor):
280         (KJS::RegExpConstructor::getCallData):
281         * kjs/RegExpObject.h:
282         (KJS::RegExpConstructor::classInfo):
283         * kjs/Shell.cpp:
284         (GlobalObject::GlobalObject):
285         (functionPrint):
286         (functionDebug):
287         (functionGC):
288         (functionVersion):
289         (functionRun):
290         (functionLoad):
291         (functionReadline):
292         (functionQuit):
293         * kjs/date_object.cpp:
294         (KJS::gmtoffset):
295         (KJS::formatLocaleDate):
296         (KJS::fillStructuresUsingDateArgs):
297         (KJS::DateInstance::getTime):
298         (KJS::DateInstance::getUTCTime):
299         (KJS::DateConstructor::DateConstructor):
300         (KJS::constructDate):
301         (KJS::DateConstructor::getConstructData):
302         (KJS::callDate):
303         (KJS::DateConstructor::getCallData):
304         (KJS::dateParse):
305         (KJS::dateNow):
306         (KJS::dateUTC):
307         (KJS::dateProtoFuncToString):
308         (KJS::dateProtoFuncToUTCString):
309         (KJS::dateProtoFuncToDateString):
310         (KJS::dateProtoFuncToTimeString):
311         (KJS::dateProtoFuncToLocaleString):
312         (KJS::dateProtoFuncToLocaleDateString):
313         (KJS::dateProtoFuncToLocaleTimeString):
314         (KJS::dateProtoFuncValueOf):
315         (KJS::dateProtoFuncGetTime):
316         (KJS::dateProtoFuncGetFullYear):
317         (KJS::dateProtoFuncGetUTCFullYear):
318         (KJS::dateProtoFuncToGMTString):
319         (KJS::dateProtoFuncGetMonth):
320         (KJS::dateProtoFuncGetUTCMonth):
321         (KJS::dateProtoFuncGetDate):
322         (KJS::dateProtoFuncGetUTCDate):
323         (KJS::dateProtoFuncGetDay):
324         (KJS::dateProtoFuncGetUTCDay):
325         (KJS::dateProtoFuncGetHours):
326         (KJS::dateProtoFuncGetUTCHours):
327         (KJS::dateProtoFuncGetMinutes):
328         (KJS::dateProtoFuncGetUTCMinutes):
329         (KJS::dateProtoFuncGetSeconds):
330         (KJS::dateProtoFuncGetUTCSeconds):
331         (KJS::dateProtoFuncGetMilliSeconds):
332         (KJS::dateProtoFuncGetUTCMilliseconds):
333         (KJS::dateProtoFuncGetTimezoneOffset):
334         (KJS::dateProtoFuncSetTime):
335         (KJS::setNewValueFromTimeArgs):
336         (KJS::setNewValueFromDateArgs):
337         (KJS::dateProtoFuncSetMilliSeconds):
338         (KJS::dateProtoFuncSetUTCMilliseconds):
339         (KJS::dateProtoFuncSetSeconds):
340         (KJS::dateProtoFuncSetUTCSeconds):
341         (KJS::dateProtoFuncSetMinutes):
342         (KJS::dateProtoFuncSetUTCMinutes):
343         (KJS::dateProtoFuncSetHours):
344         (KJS::dateProtoFuncSetUTCHours):
345         (KJS::dateProtoFuncSetDate):
346         (KJS::dateProtoFuncSetUTCDate):
347         (KJS::dateProtoFuncSetMonth):
348         (KJS::dateProtoFuncSetUTCMonth):
349         (KJS::dateProtoFuncSetFullYear):
350         (KJS::dateProtoFuncSetUTCFullYear):
351         (KJS::dateProtoFuncSetYear):
352         (KJS::dateProtoFuncGetYear):
353         * kjs/date_object.h:
354         (KJS::DateInstance::internalNumber):
355         (KJS::DateInstance::classInfo):
356         * kjs/error_object.cpp:
357         (KJS::errorProtoFuncToString):
358         (KJS::constructError):
359         (KJS::constructWithErrorConstructor):
360         (KJS::ErrorConstructor::getConstructData):
361         (KJS::callErrorConstructor):
362         (KJS::ErrorConstructor::getCallData):
363         (KJS::NativeErrorConstructor::construct):
364         (KJS::constructWithNativeErrorConstructor):
365         (KJS::NativeErrorConstructor::getConstructData):
366         (KJS::callNativeErrorConstructor):
367         (KJS::NativeErrorConstructor::getCallData):
368         * kjs/error_object.h:
369         (KJS::NativeErrorConstructor::classInfo):
370         * kjs/internal.cpp:
371         (KJS::JSNumberCell::toObject):
372         (KJS::JSNumberCell::toThisObject):
373         (KJS::GetterSetter::mark):
374         (KJS::GetterSetter::toPrimitive):
375         (KJS::GetterSetter::toBoolean):
376         (KJS::GetterSetter::toNumber):
377         (KJS::GetterSetter::toString):
378         (KJS::GetterSetter::toObject):
379         (KJS::InternalFunction::InternalFunction):
380         (KJS::InternalFunction::implementsHasInstance):
381         * kjs/lookup.h:
382         (KJS::HashEntry::):
383         * kjs/nodes.cpp:
384         (KJS::FuncDeclNode::makeFunction):
385         (KJS::FuncExprNode::makeFunction):
386         * kjs/object_object.cpp:
387         (KJS::objectProtoFuncValueOf):
388         (KJS::objectProtoFuncHasOwnProperty):
389         (KJS::objectProtoFuncIsPrototypeOf):
390         (KJS::objectProtoFuncDefineGetter):
391         (KJS::objectProtoFuncDefineSetter):
392         (KJS::objectProtoFuncLookupGetter):
393         (KJS::objectProtoFuncLookupSetter):
394         (KJS::objectProtoFuncPropertyIsEnumerable):
395         (KJS::objectProtoFuncToLocaleString):
396         (KJS::objectProtoFuncToString):
397         (KJS::ObjectConstructor::ObjectConstructor):
398         (KJS::constructObject):
399         (KJS::constructWithObjectConstructor):
400         (KJS::ObjectConstructor::getConstructData):
401         (KJS::callObjectConstructor):
402         (KJS::ObjectConstructor::getCallData):
403         * kjs/object_object.h:
404         * kjs/string_object.cpp:
405         (KJS::replace):
406         (KJS::stringProtoFuncToString):
407         (KJS::stringProtoFuncValueOf):
408         (KJS::stringProtoFuncCharAt):
409         (KJS::stringProtoFuncCharCodeAt):
410         (KJS::stringProtoFuncConcat):
411         (KJS::stringProtoFuncIndexOf):
412         (KJS::stringProtoFuncLastIndexOf):
413         (KJS::stringProtoFuncMatch):
414         (KJS::stringProtoFuncSearch):
415         (KJS::stringProtoFuncReplace):
416         (KJS::stringProtoFuncSlice):
417         (KJS::stringProtoFuncSplit):
418         (KJS::stringProtoFuncSubstr):
419         (KJS::stringProtoFuncSubstring):
420         (KJS::stringProtoFuncToLowerCase):
421         (KJS::stringProtoFuncToUpperCase):
422         (KJS::stringProtoFuncToLocaleLowerCase):
423         (KJS::stringProtoFuncToLocaleUpperCase):
424         (KJS::stringProtoFuncLocaleCompare):
425         (KJS::stringProtoFuncBig):
426         (KJS::stringProtoFuncSmall):
427         (KJS::stringProtoFuncBlink):
428         (KJS::stringProtoFuncBold):
429         (KJS::stringProtoFuncFixed):
430         (KJS::stringProtoFuncItalics):
431         (KJS::stringProtoFuncStrike):
432         (KJS::stringProtoFuncSub):
433         (KJS::stringProtoFuncSup):
434         (KJS::stringProtoFuncFontcolor):
435         (KJS::stringProtoFuncFontsize):
436         (KJS::stringProtoFuncAnchor):
437         (KJS::stringProtoFuncLink):
438         (KJS::stringFromCharCode):
439         (KJS::StringConstructor::StringConstructor):
440         (KJS::constructWithStringConstructor):
441         (KJS::StringConstructor::getConstructData):
442         (KJS::callStringConstructor):
443         (KJS::StringConstructor::getCallData):
444         * kjs/string_object.h:
445
446 2008-06-23  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
447
448         Reviewed by Oliver.
449
450         Bug 19716: REGRESSION (SquirrelFish): Reproducible crash after entering a username at mint.com
451         <https://bugs.webkit.org/show_bug.cgi?id=19716>
452
453         When unwinding callframes for exceptions, check whether the callframe
454         was created by a reentrant native call to JavaScript after tearing off
455         the local variables instead of before.
456
457         * VM/Machine.cpp:
458         (KJS::Machine::unwindCallFrame):
459
460 2008-06-23  Mark Rowe  <mrowe@apple.com>
461
462         Reviewed by Oliver Hunt.
463
464         Get testapi passing again in a debug build.
465
466         * API/testapi.c:
467         (main): Update the expected output of calling JSValueMakeString on a function object.
468
469 2008-06-21  Mark Rowe  <mrowe@apple.com>
470
471         Reviewed by Sam Weinig.
472
473         Print a blank line when exiting the jsc interactive mode to ensure that the shell
474         prompt will start on a new line.
475
476         * kjs/Shell.cpp:
477         (runInteractive):
478
479 2008-06-21  Mark Rowe  <mrowe@apple.com>
480
481         Rubber-stamped by Sam Weinig.
482
483         Tweak the paths of the items in the "tests" group to clean things up a little.
484
485         * JavaScriptCore.xcodeproj/project.pbxproj:
486
487 2008-06-21  Mark Rowe  <mrowe@apple.com>
488
489         Rubber-stamped by Sam Weinig.
490
491         Fix jsc to link against libedit.dylib rather than libedit.2.dylib.
492
493         * JavaScriptCore.xcodeproj/project.pbxproj:
494
495 2008-06-21  Mark Rowe  <mrowe@apple.com>
496
497         Reviewed by Sam Weinig.
498
499         Copy the JavaScriptCore shell (jsc) into JavaScriptCore.framework so that it will
500         be included in nightly builds.
501         https://bugs.webkit.org/show_bug.cgi?id=19691
502
503         * JavaScriptCore.xcodeproj/project.pbxproj:
504
505 2008-06-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
506
507         Reviewed by Mark Rowe.
508
509         Fix the build for non-Mac Darwin platforms by disabling their support
510         for readline in the JavaScript shell.
511
512         * kjs/config.h:
513
514 2008-06-20  Timothy Hatcher  <timothy@apple.com>
515
516         Use member function pointers for the Profile::forEach function.
517         Eliminating a few static functions and simplified things a little.
518
519         Reviewed by Alexey Proskuryakov.
520
521         * JavaScriptCore.exp: Change the symbol for forEach.
522         * profiler/Profile.cpp:
523         (KJS::Profile::forEach): Use a member function pointer.
524         * profiler/Profile.h:
525         (KJS::Profile::sortTotalTimeDescending): Pass a function pointer.
526         (KJS::Profile::sortTotalTimeAscending): Ditto.
527         (KJS::Profile::sortSelfTimeDescending): Ditto.
528         (KJS::Profile::sortSelfTimeAscending): Ditto.
529         (KJS::Profile::sortCallsDescending): Ditto.
530         * profiler/ProfileNode.h:
531         (KJS::ProfileNode::sortTotalTimeDescending): No longer static.
532         (KJS::ProfileNode::sortTotalTimeAscending): Ditto.
533         (KJS::ProfileNode::sortSelfTimeDescending): Ditto.
534         (KJS::ProfileNode::sortSelfTimeAscending): Ditto.
535         (KJS::ProfileNode::sortCallsDescending): Ditto.
536
537 2008-06-20  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
538
539         Reviewed by Oliver.
540
541         Remove unused destructors.
542
543         * kjs/nodes.cpp:
544         * kjs/nodes.h:
545
546 2008-06-20  Timothy Hatcher  <timothy@apple.com>
547
548         Fixed an ASSERT(m_actualSelfTime <= m_actualTotalTime) when starting
549         and stopping a profile from the Develop menu. Also prevents
550         inserting an incorrect parent node as the new head after profiling
551         is stopped from the Develop menu.
552
553         Reviewed by Dan Bernstein.
554
555         * profiler/Profile.cpp:
556         (KJS::Profile::stopProfiling): If the current node is already the head
557         then there is no more need to record future nodes in didExecute.
558         (KJS::Profile::didExecute): Move the code of setupCurrentNodeAsStopped
559         into here since this was the only caller. When setting the total time
560         keep any current total time while adding the self time of the head.
561         (KJS::Profile::setupCurrentNodeAsStopped): Removed.
562         * profiler/Profile.h: Removed setupCurrentNodeAsStopped.
563
564 2008-06-20  Kevin Ollivier  <kevino@theolliviers.com>
565
566         !USE(MULTIPLE_THREADS) on Darwin build fix
567
568         * kjs/InitializeThreading.cpp:
569         (KJS::initializeThreading):
570         * kjs/collector.h:
571
572 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
573
574         -Leopard Build Fix.
575
576         * profiler/Profile.cpp:
577         (KJS::Profile::removeProfileStart):
578         (KJS::Profile::removeProfileEnd):
579
580 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
581
582         Just giving credit.
583
584         * ChangeLog:
585
586 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
587
588         Reviewed by Tim and Dan.
589
590         <rdar://problem/6024846> JSProfiler: ASSERT hit in Profiler.
591         - Because InspectorController can call startProfiling() and
592         stopProfiling() we cannot assert that console.profile() and
593         console.profileEnd() will be in the profile tree.
594
595         * profiler/Profile.cpp:
596         (KJS::Profile::removeProfileStart):
597         (KJS::Profile::removeProfileEnd):
598
599 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
600
601         Reviewed by Tim.
602
603         <rdar://problem/5958770> JSProfiler: Time incorrectly given to (idle)
604         if profiling is started and finished within the same function. (19230)
605         - Now we profile one more stack frame up from the last frame to allocate
606         the time spent in it, if it exists.
607
608         * JavaScriptCore.exp:
609         * VM/Machine.cpp: We need to let the profiler know when the JS program 
610         has finished since that is what will actually stop the profiler instead
611         of just calling stopProfiling().
612         (KJS::Machine::execute):
613         * profiler/Profile.cpp:
614         (KJS::Profile::create): Moved from Profile.h since it was getting pretty
615         long.
616         (KJS::Profile::Profile): We now have a client, which is a listener who
617         we will return this profile to, once it has actually finished.
618         (KJS::Profile::stopProfiling): Instead of fully stopping the profiler
619         here, we set the flag and keep it profiling in the background.
620         (KJS::Profile::didFinishAllExecution): This is where the profiler
621         actually finishes and creates the (idle) node if one should be made.
622         (KJS::Profile::removeProfileStart): Don't use m_currentNode since it is
623         needed by the profiler as it runs silently in the background.
624         (KJS::Profile::removeProfileEnd): Ditto.
625         (KJS::Profile::willExecute): Don't profile new functions if we have
626         stopped profiling.
627         (KJS::Profile::didExecute): Only record one more return as all the
628         remaining time will be attributed to that function.
629         (KJS::Profile::setupCurrentNodeAsStopped): Sets the current node's time.
630         * profiler/Profile.h: Added functions and variables for the above
631         changes.
632         (KJS::Profile::client):
633         * profiler/ProfileNode.h:
634         (KJS::CallIdentifier::toString): Debug method.
635         * profiler/Profiler.cpp: Added support for the ProfilerClient.
636         (KJS::Profiler::startProfiling):
637         (KJS::Profiler::stopProfiling): No longer return sthe profile.
638         (KJS::Profiler::didFinishAllExecution): Now returns the profile to the
639         client instead of stopProfiling.
640         * profiler/Profiler.h:
641         (KJS::ProfilerClient::~ProfilerClient): Clients will implement this
642         interface.
643
644 2008-06-19  Ariya Hidayat  <ariya.hidayat@trolltech.com>
645
646         Reviewed by Simon.
647
648         Surpress compiler warning (int vs unsigned comparison).
649
650         * wtf/unicode/qt4/UnicodeQt4.h:
651         (WTF::Unicode::toLower):
652
653 2008-06-19  Ariya Hidayat  <ariya.hidayat@trolltech.com>
654
655         Reviewed by Timothy Hatcher.
656
657         Introduce compiler define for MinGW, to have COMPILER(MINGW).
658
659         * wtf/Platform.h:
660
661 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
662
663         Reviewed by Geoff.
664
665         Make Machine per-JSGlobalData.
666
667         * VM/CodeBlock.cpp:
668         (KJS::CodeBlock::dump):
669         * VM/CodeGenerator.cpp:
670         (KJS::CodeGenerator::emitOpcode):
671         * VM/Machine.cpp:
672         (KJS::callEval):
673         (KJS::Machine::unwindCallFrame):
674         (KJS::Machine::throwException):
675         (KJS::Machine::execute):
676         (KJS::Machine::debug):
677         * VM/Machine.h:
678         * kjs/DebuggerCallFrame.cpp:
679         (KJS::DebuggerCallFrame::evaluate):
680         * kjs/DebuggerCallFrame.h:
681         (KJS::DebuggerCallFrame::DebuggerCallFrame):
682         * kjs/ExecState.cpp:
683         (KJS::ExecState::ExecState):
684         * kjs/ExecState.h:
685         (KJS::ExecState::machine):
686         * kjs/JSFunction.cpp:
687         (KJS::JSFunction::callAsFunction):
688         (KJS::JSFunction::argumentsGetter):
689         (KJS::JSFunction::callerGetter):
690         (KJS::JSFunction::construct):
691         (KJS::globalFuncEval):
692         * kjs/JSGlobalData.cpp:
693         (KJS::JSGlobalData::JSGlobalData):
694         * kjs/JSGlobalData.h:
695         * kjs/interpreter.cpp:
696         (KJS::Interpreter::evaluate):
697
698 2008-06-19  Alp Toker  <alp@nuanti.com>
699
700         GTK+/autotools build fix. JSGlobalObject.cpp in now in
701         AllInOneFile.cpp and shouldn't be built separately.
702
703         * GNUmakefile.am:
704
705 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
706
707         Reviewed by Darin.
708
709         Get rid of some threadInstance calls.
710
711         * kjs/JSGlobalObject.cpp:
712         (KJS::JSGlobalObject::init):
713         * kjs/Parser.cpp:
714         (KJS::Parser::parse):
715         * kjs/Shell.cpp:
716         (jscmain):
717
718 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
719
720         Reviewed by Sam.
721
722         Fix an assertion failure at startup.
723
724         * kjs/JSObject.h: (KJS::JSObject::JSObject): Allow jsNull prototype in an assertion (I had
725         it fixed in a wrong copy of the file, so I wasn't getting the failure).
726
727 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
728
729         Build fix.
730
731         * kjs/collector.cpp:
732         (KJS::Heap::Heap):
733         (KJS::allocateBlock):
734         * kjs/collector.h:
735         No, #if PLATFORM(UNIX) was not right. I've just moved the unsafe initialization back for now,
736         as the platforms that use that code path do not use multiple threads yet.
737
738 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
739
740         Windows and Qt build fixes.
741
742         * kjs/collector.h: 
743         * kjs/collector.cpp:
744         (KJS::Heap::Heap):
745         Wrapped m_pagesize in #if PLATFORM(UNIX), which should better match the sequence of #elifs
746         in allocateBlock(). Changed MIN_ARRAY_SIZE to be explicitly size_t, as this type is different
747         on different platforms.
748
749 2008-06-17  Alexey Proskuryakov  <ap@webkit.org>
750
751         Reviewed by Darin.
752
753         Prepare JavaScript heap for being per-thread.
754
755         * kjs/ExecState.h: Shuffle includes, making it possible to include ExecState.h in JSValue.h.
756         (KJS::ExecState::heap): Added an accessor.
757
758         * API/JSBase.cpp: (JSGarbageCollect): Collect both shared and per-thread heaps.
759
760         * API/JSContextRef.cpp: (JSGlobalContextCreate): When allocating JSGlobalObject, indicate
761         that it belongs to a shared heap.
762
763         * JavaScriptCore.xcodeproj/project.pbxproj:
764         * kjs/AllInOneFile.cpp:
765         Moved JSGlobalObject.cpp to AllInOneFile, as a build fix for inlineAllocate magic.
766
767         * VM/CodeGenerator.h: (KJS::CodeGenerator::globalExec): Added an accessor (working via
768         m_scopeChain).
769
770         * VM/RegisterFile.h:
771         (KJS::RegisterFile::mark):
772         * VM/RegisterFileStack.h:
773         (KJS::RegisterFileStack::mark):
774         Made these pseudo-mark functions take Heap*.
775
776         * kjs/InitializeThreading.cpp:
777         (KJS::initializeThreading): Initialize heap introspector.
778
779         * kjs/JSGlobalData.h: Added Heap to the structure.
780
781         * kjs/JSGlobalData.cpp:
782         (KJS::JSGlobalData::JSGlobalData): Initialize Heap.
783         (KJS::JSGlobalData::sharedInstance): Added a method to access shared global data instance
784         for legacy clients.
785
786         * kjs/JSGlobalObject.cpp:
787         (KJS::JSGlobalObject::~JSGlobalObject): Changed to work with per-thread head; fixed list
788         maintenance logic.
789         (KJS::JSGlobalObject::init): Changed to work with per-thread head.
790         (KJS::JSGlobalObject::put): Assert that a cross-heap operation is not being attempted.
791         (KJS::JSGlobalObject::reset): Pass ExecState* where now required.
792         (KJS::JSGlobalObject::mark): Pass the current heap to RegisterFileStack::mark.
793         (KJS::JSGlobalObject::operator new): Overload operator new to use per-thread or shared heap.
794         * kjs/JSGlobalObject.h: Removed static s_head member.
795
796         * kjs/PropertyMap.h: (KJS::PropertyMap::PropertyMap): Removed unused SavedProperty.
797
798         * kjs/collector.h: Turned Collector into an actual object with its own data, renamed to Heap.
799         (KJS::Heap::initializeHeapIntrospector): Added.
800         (KJS::Heap::heap): Added a method to determine which heap a JSValue is in, if any.
801         (KJS::Heap::allocate): Made non-static.
802         (KJS::Heap::inlineAllocateNumber): Ditto.
803         (KJS::Heap::markListSet): Ditto.
804         (KJS::Heap::cellBlock): Ditto.
805         (KJS::Heap::cellOffset): Ditto.
806         (KJS::Heap::isCellMarked): Ditto.
807         (KJS::Heap::markCell): Ditto.
808         (KJS::Heap::reportExtraMemoryCost): Ditto.
809         (KJS::CollectorBlock): Added a back-reference to Heap for Heap::heap() method.
810         (KJS::SmallCellCollectorBlock): Ditto.
811
812         * kjs/collector.cpp: Changed MIN_ARRAY_SIZE to a #define to avoid a PIC branch. Removed
813         main thread related machinery.
814         (KJS::Heap::Heap): Initialize the newly added data members.
815         (KJS::allocateBlock): Marked NEVER_INLINE, as this is a rare case that uses a PIC branch.
816         Moved static pagesize to the class to make it safely initialized.
817         (KJS::Heap::heapAllocate): Initialize heap back reference after a new block is allocated.
818         (KJS::Heap::registerThread): Removed introspector initialization, as it is now performed
819         in InitializeThreading.cpp.
820         (KJS::Heap::markOtherThreadConservatively): Assert that the "other thread" case only occurs
821         for legacy clients using a shared heap.
822         (KJS::Heap::markStackObjectsConservatively): Moved fastMallocForbid/Allow down here, since
823         it doesn't need to be forbidden during other GC phases.
824
825         * kjs/JSImmediate.h:
826         (KJS::jsUndefined):
827         (KJS::jsNull):
828         (KJS::jsBoolean):
829         Moved from JSvalue.h, to make these usable in files that cannot include JSValue.h (such
830         as list.h).
831
832         * API/JSCallbackObjectFunctions.h:
833         (KJS::::staticFunctionGetter):
834         * API/JSClassRef.cpp:
835         (OpaqueJSClass::prototype):
836         * API/JSObjectRef.cpp:
837         (JSObjectMake):
838         (JSObjectMakeFunctionWithCallback):
839         (JSObjectMakeConstructor):
840         (JSObjectMakeFunction):
841         * API/JSValueRef.cpp:
842         (JSValueMakeNumber):
843         (JSValueMakeString):
844         * JavaScriptCore.exp:
845         * VM/CodeGenerator.cpp:
846         (KJS::CodeGenerator::emitLoad):
847         * VM/JSPropertyNameIterator.cpp:
848         (KJS::JSPropertyNameIterator::create):
849         (KJS::JSPropertyNameIterator::next):
850         * VM/Machine.cpp:
851         (KJS::jsAddSlowCase):
852         (KJS::jsAdd):
853         (KJS::jsTypeStringForValue):
854         (KJS::scopeChainForCall):
855         (KJS::Machine::throwException):
856         (KJS::Machine::execute):
857         (KJS::Machine::privateExecute):
858         (KJS::Machine::retrieveArguments):
859         * kjs/ArrayPrototype.cpp:
860         (KJS::arrayProtoFuncToString):
861         (KJS::arrayProtoFuncToLocaleString):
862         (KJS::arrayProtoFuncJoin):
863         (KJS::arrayProtoFuncConcat):
864         (KJS::arrayProtoFuncPop):
865         (KJS::arrayProtoFuncPush):
866         (KJS::arrayProtoFuncShift):
867         (KJS::arrayProtoFuncSlice):
868         (KJS::arrayProtoFuncSplice):
869         (KJS::arrayProtoFuncUnShift):
870         (KJS::arrayProtoFuncFilter):
871         (KJS::arrayProtoFuncMap):
872         (KJS::arrayProtoFuncEvery):
873         (KJS::arrayProtoFuncForEach):
874         (KJS::arrayProtoFuncSome):
875         (KJS::arrayProtoFuncIndexOf):
876         (KJS::arrayProtoFuncLastIndexOf):
877         (KJS::ArrayConstructor::ArrayConstructor):
878         (KJS::ArrayConstructor::construct):
879         (KJS::ArrayConstructor::callAsFunction):
880         * kjs/BooleanObject.cpp:
881         (KJS::BooleanPrototype::BooleanPrototype):
882         (KJS::booleanProtoFuncToString):
883         (KJS::BooleanConstructor::BooleanConstructor):
884         (KJS::BooleanConstructor::construct):
885         * kjs/FunctionPrototype.cpp:
886         (KJS::FunctionPrototype::FunctionPrototype):
887         (KJS::functionProtoFuncToString):
888         (KJS::FunctionConstructor::FunctionConstructor):
889         (KJS::FunctionConstructor::construct):
890         * kjs/JSActivation.cpp:
891         (KJS::JSActivation::createArgumentsObject):
892         * kjs/JSArray.cpp:
893         (KJS::JSArray::JSArray):
894         (KJS::JSArray::lengthGetter):
895         * kjs/JSFunction.cpp:
896         (KJS::JSFunction::lengthGetter):
897         (KJS::JSFunction::construct):
898         (KJS::Arguments::Arguments):
899         (KJS::encode):
900         (KJS::decode):
901         (KJS::globalFuncParseInt):
902         (KJS::globalFuncParseFloat):
903         (KJS::globalFuncEscape):
904         (KJS::globalFuncUnescape):
905         (KJS::PrototypeFunction::PrototypeFunction):
906         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
907         * kjs/JSImmediate.cpp:
908         (KJS::JSImmediate::toObject):
909         * kjs/JSLock.cpp:
910         (KJS::JSLock::registerThread):
911         * kjs/JSObject.cpp:
912         (KJS::JSObject::put):
913         (KJS::JSObject::defineGetter):
914         (KJS::JSObject::defineSetter):
915         (KJS::Error::create):
916         * kjs/JSObject.h:
917         (KJS::JSObject::putDirect):
918         * kjs/JSString.h:
919         (KJS::JSString::JSString):
920         * kjs/JSValue.cpp:
921         (KJS::JSCell::operator new):
922         (KJS::jsString):
923         (KJS::jsOwnedString):
924         * kjs/JSValue.h:
925         (KJS::JSNumberCell::operator new):
926         (KJS::jsNumberCell):
927         (KJS::jsNaN):
928         (KJS::jsNumber):
929         (KJS::JSCell::marked):
930         (KJS::JSCell::mark):
931         (KJS::JSValue::toJSNumber):
932         * kjs/MathObject.cpp:
933         (KJS::MathObject::getValueProperty):
934         (KJS::mathProtoFuncAbs):
935         (KJS::mathProtoFuncACos):
936         (KJS::mathProtoFuncASin):
937         (KJS::mathProtoFuncATan):
938         (KJS::mathProtoFuncATan2):
939         (KJS::mathProtoFuncCeil):
940         (KJS::mathProtoFuncCos):
941         (KJS::mathProtoFuncExp):
942         (KJS::mathProtoFuncFloor):
943         (KJS::mathProtoFuncLog):
944         (KJS::mathProtoFuncMax):
945         (KJS::mathProtoFuncMin):
946         (KJS::mathProtoFuncPow):
947         (KJS::mathProtoFuncRandom):
948         (KJS::mathProtoFuncRound):
949         (KJS::mathProtoFuncSin):
950         (KJS::mathProtoFuncSqrt):
951         (KJS::mathProtoFuncTan):
952         * kjs/NumberObject.cpp:
953         (KJS::NumberPrototype::NumberPrototype):
954         (KJS::numberProtoFuncToString):
955         (KJS::numberProtoFuncToLocaleString):
956         (KJS::numberProtoFuncToFixed):
957         (KJS::numberProtoFuncToExponential):
958         (KJS::numberProtoFuncToPrecision):
959         (KJS::NumberConstructor::NumberConstructor):
960         (KJS::NumberConstructor::getValueProperty):
961         (KJS::NumberConstructor::construct):
962         (KJS::NumberConstructor::callAsFunction):
963         * kjs/RegExpObject.cpp:
964         (KJS::RegExpPrototype::RegExpPrototype):
965         (KJS::regExpProtoFuncToString):
966         (KJS::RegExpObject::getValueProperty):
967         (KJS::RegExpConstructor::RegExpConstructor):
968         (KJS::RegExpMatchesArray::fillArrayInstance):
969         (KJS::RegExpConstructor::arrayOfMatches):
970         (KJS::RegExpConstructor::getBackref):
971         (KJS::RegExpConstructor::getLastParen):
972         (KJS::RegExpConstructor::getLeftContext):
973         (KJS::RegExpConstructor::getRightContext):
974         (KJS::RegExpConstructor::getValueProperty):
975         (KJS::RegExpConstructor::construct):
976         * kjs/RegExpObject.h:
977         * kjs/Shell.cpp:
978         (GlobalObject::GlobalObject):
979         (functionGC):
980         (functionRun):
981         (functionReadline):
982         (jscmain):
983         * kjs/date_object.cpp:
984         (KJS::formatLocaleDate):
985         (KJS::DatePrototype::DatePrototype):
986         (KJS::DateConstructor::DateConstructor):
987         (KJS::DateConstructor::construct):
988         (KJS::DateConstructor::callAsFunction):
989         (KJS::DateFunction::DateFunction):
990         (KJS::DateFunction::callAsFunction):
991         (KJS::dateProtoFuncToString):
992         (KJS::dateProtoFuncToUTCString):
993         (KJS::dateProtoFuncToDateString):
994         (KJS::dateProtoFuncToTimeString):
995         (KJS::dateProtoFuncToLocaleString):
996         (KJS::dateProtoFuncToLocaleDateString):
997         (KJS::dateProtoFuncToLocaleTimeString):
998         (KJS::dateProtoFuncValueOf):
999         (KJS::dateProtoFuncGetTime):
1000         (KJS::dateProtoFuncGetFullYear):
1001         (KJS::dateProtoFuncGetUTCFullYear):
1002         (KJS::dateProtoFuncToGMTString):
1003         (KJS::dateProtoFuncGetMonth):
1004         (KJS::dateProtoFuncGetUTCMonth):
1005         (KJS::dateProtoFuncGetDate):
1006         (KJS::dateProtoFuncGetUTCDate):
1007         (KJS::dateProtoFuncGetDay):
1008         (KJS::dateProtoFuncGetUTCDay):
1009         (KJS::dateProtoFuncGetHours):
1010         (KJS::dateProtoFuncGetUTCHours):
1011         (KJS::dateProtoFuncGetMinutes):
1012         (KJS::dateProtoFuncGetUTCMinutes):
1013         (KJS::dateProtoFuncGetSeconds):
1014         (KJS::dateProtoFuncGetUTCSeconds):
1015         (KJS::dateProtoFuncGetMilliSeconds):
1016         (KJS::dateProtoFuncGetUTCMilliseconds):
1017         (KJS::dateProtoFuncGetTimezoneOffset):
1018         (KJS::dateProtoFuncSetTime):
1019         (KJS::setNewValueFromTimeArgs):
1020         (KJS::setNewValueFromDateArgs):
1021         (KJS::dateProtoFuncSetYear):
1022         (KJS::dateProtoFuncGetYear):
1023         * kjs/error_object.cpp:
1024         (KJS::ErrorPrototype::ErrorPrototype):
1025         (KJS::errorProtoFuncToString):
1026         (KJS::ErrorConstructor::ErrorConstructor):
1027         (KJS::ErrorConstructor::construct):
1028         (KJS::NativeErrorPrototype::NativeErrorPrototype):
1029         (KJS::NativeErrorConstructor::NativeErrorConstructor):
1030         (KJS::NativeErrorConstructor::construct):
1031         * kjs/identifier.h:
1032         * kjs/internal.cpp:
1033         (KJS::StringObject::create):
1034         (KJS::JSString::lengthGetter):
1035         (KJS::JSString::indexGetter):
1036         (KJS::JSString::indexNumericPropertyGetter):
1037         * kjs/interpreter.cpp:
1038         * kjs/list.cpp:
1039         (KJS::ArgList::slowAppend):
1040         * kjs/list.h:
1041         * kjs/lookup.h:
1042         (KJS::staticFunctionGetter):
1043         (KJS::cacheGlobalObject):
1044         * kjs/nodes.cpp:
1045         (KJS::Node::emitThrowError):
1046         (KJS::StringNode::emitCode):
1047         (KJS::ArrayNode::emitCode):
1048         (KJS::FuncDeclNode::makeFunction):
1049         (KJS::FuncExprNode::makeFunction):
1050         * kjs/nodes.h:
1051         * kjs/object_object.cpp:
1052         (KJS::ObjectPrototype::ObjectPrototype):
1053         (KJS::objectProtoFuncToLocaleString):
1054         (KJS::objectProtoFuncToString):
1055         (KJS::ObjectConstructor::ObjectConstructor):
1056         (KJS::ObjectConstructor::construct):
1057         * kjs/protect.h:
1058         (KJS::gcProtect):
1059         (KJS::gcUnprotect):
1060         * kjs/string_object.cpp:
1061         (KJS::StringObject::StringObject):
1062         (KJS::StringPrototype::StringPrototype):
1063         (KJS::replace):
1064         (KJS::stringProtoFuncCharAt):
1065         (KJS::stringProtoFuncCharCodeAt):
1066         (KJS::stringProtoFuncConcat):
1067         (KJS::stringProtoFuncIndexOf):
1068         (KJS::stringProtoFuncLastIndexOf):
1069         (KJS::stringProtoFuncMatch):
1070         (KJS::stringProtoFuncSearch):
1071         (KJS::stringProtoFuncReplace):
1072         (KJS::stringProtoFuncSlice):
1073         (KJS::stringProtoFuncSplit):
1074         (KJS::stringProtoFuncSubstr):
1075         (KJS::stringProtoFuncSubstring):
1076         (KJS::stringProtoFuncToLowerCase):
1077         (KJS::stringProtoFuncToUpperCase):
1078         (KJS::stringProtoFuncToLocaleLowerCase):
1079         (KJS::stringProtoFuncToLocaleUpperCase):
1080         (KJS::stringProtoFuncLocaleCompare):
1081         (KJS::stringProtoFuncBig):
1082         (KJS::stringProtoFuncSmall):
1083         (KJS::stringProtoFuncBlink):
1084         (KJS::stringProtoFuncBold):
1085         (KJS::stringProtoFuncFixed):
1086         (KJS::stringProtoFuncItalics):
1087         (KJS::stringProtoFuncStrike):
1088         (KJS::stringProtoFuncSub):
1089         (KJS::stringProtoFuncSup):
1090         (KJS::stringProtoFuncFontcolor):
1091         (KJS::stringProtoFuncFontsize):
1092         (KJS::stringProtoFuncAnchor):
1093         (KJS::stringProtoFuncLink):
1094         (KJS::StringConstructor::StringConstructor):
1095         (KJS::StringConstructor::construct):
1096         (KJS::StringConstructor::callAsFunction):
1097         (KJS::StringConstructorFunction::StringConstructorFunction):
1098         (KJS::StringConstructorFunction::callAsFunction):
1099         * kjs/string_object.h:
1100         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1101         * kjs/ustring.h:
1102         Updated for the above changes.
1103
1104 2008-06-17  Timothy Hatcher  <timothy@apple.com>
1105
1106         Added a type to DebuggerCallFrame so the under interface can
1107         distinguish anonymous functions and program call frames.
1108
1109         https://bugs.webkit.org/show_bug.cgi?id=19585
1110
1111         Reviewed by Geoff Garen.
1112
1113         * JavaScriptCore.exp: Export the DebuggerCallFrame::type symbol.
1114         * kjs/DebuggerCallFrame.cpp:
1115         (KJS::DebuggerCallFrame::type): Added.
1116         * kjs/DebuggerCallFrame.h:
1117
1118 2008-06-17  Eric Seidel  <eric@webkit.org>
1119
1120         Reviewed by Tim H.
1121         
1122         Remove bogus ASSERT which tripped every time for those who use PAC files.
1123
1124         * kjs/Parser.cpp:
1125         (KJS::Parser::parse):
1126
1127 2008-06-17  Kevin McCullough  <kmccullough@apple.com>
1128
1129         Reviewed by Geoff.
1130
1131         <rdar://problem/5951534> JSProfiler: Don't profile console.profile()
1132         or console.profileEnd()
1133
1134         * profiler/Profile.cpp:
1135         (KJS::Profile::stopProfiling): Moved the creation of the (idle) node to
1136         the Profile (not ProfileNode).  This makes sense since the Profile
1137         should be the one to modify the profile tree.  Also each stopProfiling()
1138         does not need to check if it's the head node anymore.  Also fixed an
1139         oddity where I was using willExecute to create the node.
1140         (KJS::Profile::removeProfileStart): Removes the call to console.profile
1141         that started this profile.
1142         (KJS::Profile::removeProfileEnd): Removes the call to console.profileEnd
1143         that ended this profile.
1144         * profiler/Profile.h:
1145         * profiler/ProfileNode.cpp: Moved the creation of the (idle) node to
1146         the Profile object.
1147         (KJS::ProfileNode::stopProfiling):
1148         * profiler/ProfileNode.h: Added some helper functions and whitespace to
1149         facilitate readability and the removal of profile() and profileEnd()
1150         from the Profile tree.
1151         (KJS::CallIdentifier::operator const char* ):
1152         (KJS::ProfileNode::firstChild):
1153         (KJS::ProfileNode::lastChild):
1154         (KJS::ProfileNode::removeChild):
1155         (KJS::ProfileNode::toString):
1156
1157 2008-06-17  Ariya Hidayat  <ariya.hidayat@trolltech.com>
1158
1159         Rubber stamped by Adam Roben.
1160
1161         Include JSGlobalObject.h to fix the build.
1162
1163         * kjs/ScopeChain.cpp:
1164
1165 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1166
1167         Reviewed by Oliver.
1168
1169         Reduce code duplication in emitReadModifyAssignment().
1170
1171         * kjs/nodes.cpp:
1172         (KJS::emitReadModifyAssignment):
1173
1174 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1175
1176         Reviewed by Oliver.
1177
1178         Sort includes alphabetically.
1179
1180         * kjs/nodes.cpp:
1181
1182 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1183
1184         Reviewed by Maciej.
1185
1186         Bug 19596: LEAK: Gmail leaks SegmentedVector<RegisterID>
1187         <https://bugs.webkit.org/show_bug.cgi?id=19596>
1188
1189         When growing SegmentedVector, we start adding segments at the position
1190         of the last segment, overwriting it. The destructor frees allocated
1191         segments starting at the segment of index 1, because the segment of
1192         index 0 is assumed to be the initial inline segment. This causes a leak
1193         of the segment that is referenced by index 0. Modifying grow() so that
1194         it starts adding segments at the position after the last segment fixes
1195         the leak.
1196
1197         Since the initial segment is a special case in the lookup code, this
1198         bug never manifested itself via incorrect results.
1199
1200         * VM/SegmentedVector.h:
1201         (KJS::SegmentedVector::grow):
1202
1203 2008-06-16  Maciej Stachowiak  <mjs@apple.com>
1204
1205         Reviewed by Alexey.
1206         
1207         - removed nearly unused types.h and LocalStorageEntry.h headers
1208
1209         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1210         * JavaScriptCore.xcodeproj/project.pbxproj:
1211         * kjs/ExecState.h:
1212         * kjs/LocalStorageEntry.h: Removed.
1213         * kjs/RegExpObject.cpp:
1214         * kjs/error_object.cpp:
1215         * kjs/grammar.y:
1216         * kjs/nodes.cpp:
1217         * kjs/types.h: Removed.
1218
1219 2008-06-16  Alp Toker  <alp@nuanti.com>
1220
1221         Rubber-stamped by Geoff.
1222
1223         Change c++ to c in minidom and testapi emacs mode line comments.
1224
1225         * API/Node.h:
1226         * API/NodeList.c:
1227         * API/NodeList.h:
1228         * API/testapi.c:
1229
1230 >>>>>>> .r34623
1231 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1232
1233         Trying to fix Windows build.
1234
1235         * kjs/PropertyNameArray.h:
1236         * kjs/identifier.cpp:
1237         Include ExecState.h
1238
1239 2008-06-16  Geoffrey Garen  <ggaren@apple.com>
1240
1241         Reviewed by Oliver Hunt.
1242         
1243         Slight cleanup to the SymbolTableEntry class.
1244         
1245         Renamed isEmpty to isNull, since we usually use "empty" to mean "holds
1246         the valid, empty value", and "null" to mean "holds no value".
1247         
1248         Changed an "== 0" to a "!", to match our style guidelines.
1249         
1250         Added some ASSERTs to verify the (possibly questionable) assumption that
1251         all register indexes will have their high two bits set. Also clarified a
1252         comment to make that assumption clear.
1253
1254 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1255
1256         Reviewed by Darin.
1257
1258         Initialize functionQueueMutex in a safe manner.
1259
1260         * wtf/MainThread.cpp:
1261         (WTF::functionQueueMutex): Made it an AtomicallyInitializedStatic.
1262
1263         (WTF::dispatchFunctionsFromMainThread):
1264         (WTF::setMainThreadCallbacksPaused):
1265         Assert that the current thread is main, meaning that the callbacksPaused static can be
1266         accessed.
1267
1268 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1269
1270         Reviewed by Geoff Garen.
1271
1272         Make Identifier construction use an explicitly passed IdentifierTable.
1273
1274         No change on SunSpider total.
1275
1276         * API/JSCallbackObjectFunctions.h:
1277         (KJS::::getOwnPropertySlot):
1278         (KJS::::put):
1279         (KJS::::deleteProperty):
1280         (KJS::::getPropertyNames):
1281         * API/JSObjectRef.cpp:
1282         (JSObjectMakeFunctionWithCallback):
1283         (JSObjectMakeFunction):
1284         (JSObjectHasProperty):
1285         (JSObjectGetProperty):
1286         (JSObjectSetProperty):
1287         (JSObjectDeleteProperty):
1288         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1289         (JSObjectCopyPropertyNames):
1290         * JavaScriptCore.exp:
1291         * VM/CodeGenerator.cpp:
1292         (KJS::CodeGenerator::CodeGenerator):
1293         (KJS::CodeGenerator::registerForLocal):
1294         (KJS::CodeGenerator::isLocal):
1295         (KJS::CodeGenerator::addConstant):
1296         (KJS::CodeGenerator::findScopedProperty):
1297         * VM/CodeGenerator.h:
1298         (KJS::CodeGenerator::globalData):
1299         (KJS::CodeGenerator::propertyNames):
1300         * VM/JSPropertyNameIterator.cpp:
1301         (KJS::JSPropertyNameIterator::create):
1302         * VM/Machine.cpp:
1303         (KJS::Machine::throwException):
1304         (KJS::Machine::privateExecute):
1305         * kjs/ArrayPrototype.cpp:
1306         (KJS::ArrayConstructor::ArrayConstructor):
1307         * kjs/BooleanObject.cpp:
1308         (KJS::BooleanConstructor::BooleanConstructor):
1309         * kjs/FunctionPrototype.cpp:
1310         (KJS::FunctionConstructor::FunctionConstructor):
1311         (KJS::FunctionConstructor::construct):
1312         * kjs/JSArray.cpp:
1313         (KJS::JSArray::inlineGetOwnPropertySlot):
1314         (KJS::JSArray::put):
1315         (KJS::JSArray::deleteProperty):
1316         (KJS::JSArray::getPropertyNames):
1317         * kjs/JSFunction.cpp:
1318         (KJS::Arguments::Arguments):
1319         * kjs/JSGlobalData.cpp:
1320         (KJS::JSGlobalData::JSGlobalData):
1321         * kjs/JSGlobalObject.cpp:
1322         (KJS::JSGlobalObject::reset):
1323         * kjs/JSObject.cpp:
1324         (KJS::JSObject::getOwnPropertySlot):
1325         (KJS::JSObject::put):
1326         (KJS::JSObject::putWithAttributes):
1327         (KJS::JSObject::deleteProperty):
1328         (KJS::JSObject::findPropertyHashEntry):
1329         (KJS::JSObject::getPropertyNames):
1330         (KJS::Error::create):
1331         * kjs/JSVariableObject.cpp:
1332         (KJS::JSVariableObject::getPropertyNames):
1333         * kjs/NumberObject.cpp:
1334         (KJS::NumberConstructor::NumberConstructor):
1335         * kjs/PropertyNameArray.cpp:
1336         (KJS::PropertyNameArray::add):
1337         * kjs/PropertyNameArray.h:
1338         (KJS::PropertyNameArray::PropertyNameArray):
1339         (KJS::PropertyNameArray::addKnownUnique):
1340         * kjs/PropertySlot.h:
1341         (KJS::PropertySlot::getValue):
1342         * kjs/RegExpObject.cpp:
1343         (KJS::RegExpConstructor::RegExpConstructor):
1344         * kjs/ScopeChain.cpp:
1345         (KJS::ScopeChainNode::print):
1346         * kjs/Shell.cpp:
1347         (GlobalObject::GlobalObject):
1348         * kjs/date_object.cpp:
1349         (KJS::DateConstructor::DateConstructor):
1350         * kjs/error_object.cpp:
1351         (KJS::ErrorConstructor::ErrorConstructor):
1352         (KJS::NativeErrorConstructor::NativeErrorConstructor):
1353         * kjs/grammar.y:
1354         * kjs/identifier.cpp:
1355         (KJS::Identifier::add):
1356         (KJS::Identifier::addSlowCase):
1357         * kjs/identifier.h:
1358         (KJS::Identifier::Identifier):
1359         (KJS::Identifier::from):
1360         (KJS::Identifier::equal):
1361         (KJS::Identifier::add):
1362         (KJS::operator==):
1363         (KJS::operator!=):
1364         * kjs/internal.cpp:
1365         (KJS::JSString::getOwnPropertySlot):
1366         * kjs/lexer.cpp:
1367         (KJS::Lexer::Lexer):
1368         (KJS::Lexer::lex):
1369         (KJS::Lexer::makeIdentifier):
1370         * kjs/lexer.h:
1371         * kjs/lookup.cpp:
1372         (KJS::HashTable::createTable):
1373         * kjs/lookup.h:
1374         (KJS::HashTable::initializeIfNeeded):
1375         (KJS::HashTable::entry):
1376         (KJS::getStaticPropertySlot):
1377         (KJS::getStaticFunctionSlot):
1378         (KJS::getStaticValueSlot):
1379         (KJS::lookupPut):
1380         * kjs/object_object.cpp:
1381         (KJS::objectProtoFuncHasOwnProperty):
1382         (KJS::objectProtoFuncDefineGetter):
1383         (KJS::objectProtoFuncDefineSetter):
1384         (KJS::objectProtoFuncLookupGetter):
1385         (KJS::objectProtoFuncLookupSetter):
1386         (KJS::objectProtoFuncPropertyIsEnumerable):
1387         (KJS::ObjectConstructor::ObjectConstructor):
1388         * kjs/string_object.cpp:
1389         (KJS::StringObject::getOwnPropertySlot):
1390         (KJS::StringObject::getPropertyNames):
1391         (KJS::StringConstructor::StringConstructor):
1392         Just pass ExecState or JSGlobalData everywhere. Identifier construction is now always
1393         explicit.
1394
1395         * kjs/nodes.cpp: (KJS::RegExpNode::emitCode): Here, Identifier was created from a non-literal
1396         char*, which was incorrect, as that uses the pointer value as a key.
1397
1398 2008-06-16  Thiago Macieira  <tjmaciei@trolltech.com>
1399
1400         Reviewed by Darin.
1401
1402         https://bugs.webkit.org/show_bug.cgi?id=19577
1403
1404         Fix compilation in C++ environments where C99 headers are not present
1405
1406         The stdbool.h header is a C99 feature, defining the "_Bool" type as well as the
1407         "true" and "false" constants. But it's completely unnecessary in C++ as the
1408         language already defines the "bool" type and its two values.
1409
1410         * API/JSBase.h:
1411         * API/JSContextRef.h:
1412         * API/JSObjectRef.h:
1413         * API/JSStringRef.h:
1414         * API/JSValueRef.h:
1415
1416 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1417
1418         Reviewed by John.
1419
1420         <rdar://problem/6012509> JSProfiler: %s are incorrect if you exclude a
1421         top level node like (idle)
1422
1423         * profiler/Profile.cpp:
1424         (KJS::Profile::focus):
1425         (KJS::Profile::exclude): Subtract the selfTime from the totalTime of the
1426         head since its self time will only be non-zero when one of its children
1427         were excluded. Since the head's totalTime is used to calculate %s when
1428         its totalTime is the same as the sum of all its visible childrens' times
1429         their %s will sum to 100%.
1430
1431 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1432
1433         Reviewed by Sam Weinig.
1434
1435         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the profiler.
1436
1437         * profiler/Profile.cpp:
1438         (KJS::Profile::willExecute):
1439
1440 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1441
1442         Reviewed by Sam.
1443
1444         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
1445         profiler.
1446         - Remove the last of the uses of recursion in the profiler.
1447
1448         * JavaScriptCore.exp: Export the new function's signature.
1449         * profiler/Profile.cpp: 
1450         (KJS::calculateVisibleTotalTime): Added a new static method for
1451         recalculating the visibleTotalTime of methods after focus has changed
1452         which are visible.
1453         (KJS::stopProfiling): 
1454         (KJS::Profile::focus): Implemented focus without recursion.
1455         * profiler/Profile.h: Moved implementation into the definition file.
1456         * profiler/ProfileNode.cpp:
1457         (KJS::ProfileNode::traverseNextNodePreOrder): Added an argument for
1458         whether or not to process the children nodes, this allows focus to skip
1459         sub trees which have been set as not visible.
1460         (KJS::ProfileNode::calculateVisibleTotalTime): This function set's a
1461         node's total visible time to the sum of its self time and its children's
1462         total times.
1463         (KJS::ProfileNode::focus): Implemented focus without recursion.
1464         * profiler/ProfileNode.h:
1465         (KJS::CallIdentifier::operator!= ):
1466         (KJS::ProfileNode::setActualTotalTime): Expanded setting the total time
1467         so that focus could modify only the visible total time.
1468         (KJS::ProfileNode::setVisibleTotalTime):
1469
1470 2008-06-16  Christian Dywan  <christian@twotoasts.de>
1471
1472         Reviewed by Sam.
1473
1474         https://bugs.webkit.org/show_bug.cgi?id=19552
1475         JavaScriptCore headers use C++ style comments
1476
1477         Replace all C++ style comments with C style multiline
1478         comments and remove all "mode" lines.
1479
1480         * API/JSBase.h:
1481         * API/JSClassRef.h:
1482         * API/JSContextRef.h:
1483         * API/JSObjectRef.h:
1484         * API/JSStringRef.h:
1485         * API/JSStringRefBSTR.h:
1486         * API/JSStringRefCF.h:
1487         * API/JSValueRef.h:
1488         * API/JavaScript.h:
1489         * API/JavaScriptCore.h:
1490
1491 2008-06-16  Christian Dywan  <christian@twotoasts.de>
1492
1493         Reviewed by Sam.
1494
1495         https://bugs.webkit.org/show_bug.cgi?id=19557
1496         (JavaScriptCore) minidom uses C++ style comments
1497
1498         Use only C style comments in minidom sources
1499
1500         * API/JSNode.c:
1501         (JSNode_appendChild):
1502         (JSNode_removeChild):
1503         * API/JSNode.h:
1504         * API/JSNodeList.c:
1505         (JSNodeList_getProperty):
1506         * API/JSNodeList.h:
1507         * API/Node.c:
1508         * API/Node.h:
1509         * API/NodeList.c:
1510         (NodeList_new):
1511         (NodeList_item):
1512         * API/NodeList.h:
1513         * API/minidom.c:
1514         (createStringWithContentsOfFile):
1515         * wtf/Assertions.h:
1516         * wtf/UnusedParam.h:
1517
1518 2008-06-16  Adriaan de Groot  <groot@kde.org>
1519
1520         Reviewed by Simon.
1521
1522         Fix compilation on Solaris
1523
1524         On some systems, munmap takes a char* instead of a void* (contrary to POSIX and
1525         Single Unix Specification). Since you can always convert from char* to void*
1526         but not vice-versa, do the casting to char*.
1527
1528         * kjs/collector.cpp:
1529         (KJS::allocateBlock):
1530         (KJS::freeBlock):
1531
1532 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1533
1534         Reviewed by Maciej.
1535
1536         Make a UnaryOpNode class to reduce boilerplate code for UnaryPlusNode,
1537         NegateNode, BitwiseNotNode, and LogicalNotNode.
1538
1539         * VM/CodeGenerator.h:
1540         (KJS::CodeGenerator::emitToJSNumber):
1541         * kjs/nodes.cpp:
1542         (KJS::UnaryOpNode::emitCode):
1543         * kjs/nodes.h:
1544         (KJS::UnaryOpNode::UnaryOpNode):
1545         (KJS::UnaryPlusNode::):
1546         (KJS::NegateNode::):
1547         (KJS::NegateNode::precedence):
1548         (KJS::BitwiseNotNode::):
1549         (KJS::BitwiseNotNode::precedence):
1550         (KJS::LogicalNotNode::):
1551         (KJS::LogicalNotNode::precedence):
1552
1553 2008-06-16  Jan Michael Alonzo  <jmalonzo@webkit.org>
1554
1555         Gtk build fix
1556
1557         * GNUmakefile.am:
1558
1559 2008-06-15  Darin Adler  <darin@apple.com>
1560
1561         - rename KJS::List to KJS::ArgList
1562
1563         * API/JSCallbackConstructor.cpp:
1564         (KJS::JSCallbackConstructor::construct):
1565         * API/JSCallbackConstructor.h:
1566         * API/JSCallbackFunction.cpp:
1567         (KJS::JSCallbackFunction::callAsFunction):
1568         * API/JSCallbackFunction.h:
1569         * API/JSCallbackObject.h:
1570         * API/JSCallbackObjectFunctions.h:
1571         (KJS::::construct):
1572         (KJS::::callAsFunction):
1573         * API/JSObjectRef.cpp:
1574         (JSObjectMakeFunction):
1575         (JSObjectCallAsFunction):
1576         (JSObjectCallAsConstructor):
1577         * JavaScriptCore.exp:
1578         * VM/Machine.cpp:
1579         (KJS::Machine::execute):
1580         (KJS::Machine::privateExecute):
1581         * VM/Machine.h:
1582         * kjs/ArrayPrototype.cpp:
1583         (KJS::arrayProtoFuncToString):
1584         (KJS::arrayProtoFuncToLocaleString):
1585         (KJS::arrayProtoFuncJoin):
1586         (KJS::arrayProtoFuncConcat):
1587         (KJS::arrayProtoFuncPop):
1588         (KJS::arrayProtoFuncPush):
1589         (KJS::arrayProtoFuncReverse):
1590         (KJS::arrayProtoFuncShift):
1591         (KJS::arrayProtoFuncSlice):
1592         (KJS::arrayProtoFuncSort):
1593         (KJS::arrayProtoFuncSplice):
1594         (KJS::arrayProtoFuncUnShift):
1595         (KJS::arrayProtoFuncFilter):
1596         (KJS::arrayProtoFuncMap):
1597         (KJS::arrayProtoFuncEvery):
1598         (KJS::arrayProtoFuncForEach):
1599         (KJS::arrayProtoFuncSome):
1600         (KJS::arrayProtoFuncIndexOf):
1601         (KJS::arrayProtoFuncLastIndexOf):
1602         (KJS::ArrayConstructor::construct):
1603         (KJS::ArrayConstructor::callAsFunction):
1604         * kjs/ArrayPrototype.h:
1605         * kjs/BooleanObject.cpp:
1606         (KJS::booleanProtoFuncToString):
1607         (KJS::booleanProtoFuncValueOf):
1608         (KJS::BooleanConstructor::construct):
1609         (KJS::BooleanConstructor::callAsFunction):
1610         * kjs/BooleanObject.h:
1611         * kjs/CommonIdentifiers.h:
1612         * kjs/ExecState.h:
1613         (KJS::ExecState::emptyList):
1614         * kjs/FunctionPrototype.cpp:
1615         (KJS::FunctionPrototype::callAsFunction):
1616         (KJS::functionProtoFuncToString):
1617         (KJS::functionProtoFuncApply):
1618         (KJS::functionProtoFuncCall):
1619         (KJS::FunctionConstructor::construct):
1620         (KJS::FunctionConstructor::callAsFunction):
1621         * kjs/FunctionPrototype.h:
1622         * kjs/JSActivation.cpp:
1623         (KJS::JSActivation::createArgumentsObject):
1624         * kjs/JSArray.cpp:
1625         (KJS::JSArray::JSArray):
1626         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
1627         * kjs/JSArray.h:
1628         * kjs/JSFunction.cpp:
1629         (KJS::JSFunction::callAsFunction):
1630         (KJS::JSFunction::construct):
1631         (KJS::IndexToNameMap::IndexToNameMap):
1632         (KJS::Arguments::Arguments):
1633         (KJS::encode):
1634         (KJS::decode):
1635         (KJS::globalFuncEval):
1636         (KJS::globalFuncParseInt):
1637         (KJS::globalFuncParseFloat):
1638         (KJS::globalFuncIsNaN):
1639         (KJS::globalFuncIsFinite):
1640         (KJS::globalFuncDecodeURI):
1641         (KJS::globalFuncDecodeURIComponent):
1642         (KJS::globalFuncEncodeURI):
1643         (KJS::globalFuncEncodeURIComponent):
1644         (KJS::globalFuncEscape):
1645         (KJS::globalFuncUnescape):
1646         (KJS::globalFuncKJSPrint):
1647         (KJS::PrototypeFunction::callAsFunction):
1648         (KJS::PrototypeReflexiveFunction::callAsFunction):
1649         * kjs/JSFunction.h:
1650         * kjs/JSGlobalData.h:
1651         * kjs/JSImmediate.cpp:
1652         (KJS::JSImmediate::toObject):
1653         * kjs/JSNotAnObject.cpp:
1654         (KJS::JSNotAnObject::construct):
1655         (KJS::JSNotAnObject::callAsFunction):
1656         * kjs/JSNotAnObject.h:
1657         * kjs/JSObject.cpp:
1658         (KJS::JSObject::put):
1659         (KJS::JSObject::construct):
1660         (KJS::JSObject::callAsFunction):
1661         (KJS::Error::create):
1662         * kjs/JSObject.h:
1663         * kjs/MathObject.cpp:
1664         (KJS::mathProtoFuncAbs):
1665         (KJS::mathProtoFuncACos):
1666         (KJS::mathProtoFuncASin):
1667         (KJS::mathProtoFuncATan):
1668         (KJS::mathProtoFuncATan2):
1669         (KJS::mathProtoFuncCeil):
1670         (KJS::mathProtoFuncCos):
1671         (KJS::mathProtoFuncExp):
1672         (KJS::mathProtoFuncFloor):
1673         (KJS::mathProtoFuncLog):
1674         (KJS::mathProtoFuncMax):
1675         (KJS::mathProtoFuncMin):
1676         (KJS::mathProtoFuncPow):
1677         (KJS::mathProtoFuncRandom):
1678         (KJS::mathProtoFuncRound):
1679         (KJS::mathProtoFuncSin):
1680         (KJS::mathProtoFuncSqrt):
1681         (KJS::mathProtoFuncTan):
1682         * kjs/MathObject.h:
1683         * kjs/NumberObject.cpp:
1684         (KJS::numberProtoFuncToString):
1685         (KJS::numberProtoFuncToLocaleString):
1686         (KJS::numberProtoFuncValueOf):
1687         (KJS::numberProtoFuncToFixed):
1688         (KJS::numberProtoFuncToExponential):
1689         (KJS::numberProtoFuncToPrecision):
1690         (KJS::NumberConstructor::construct):
1691         (KJS::NumberConstructor::callAsFunction):
1692         * kjs/NumberObject.h:
1693         * kjs/RegExpObject.cpp:
1694         (KJS::regExpProtoFuncTest):
1695         (KJS::regExpProtoFuncExec):
1696         (KJS::regExpProtoFuncCompile):
1697         (KJS::regExpProtoFuncToString):
1698         (KJS::RegExpObject::match):
1699         (KJS::RegExpObject::test):
1700         (KJS::RegExpObject::exec):
1701         (KJS::RegExpObject::callAsFunction):
1702         (KJS::RegExpConstructor::construct):
1703         (KJS::RegExpConstructor::callAsFunction):
1704         * kjs/RegExpObject.h:
1705         * kjs/Shell.cpp:
1706         (functionPrint):
1707         (functionDebug):
1708         (functionGC):
1709         (functionVersion):
1710         (functionRun):
1711         (functionLoad):
1712         (functionReadline):
1713         (functionQuit):
1714         * kjs/collector.cpp:
1715         (KJS::Collector::collect):
1716         * kjs/collector.h:
1717         (KJS::Collector::markListSet):
1718         * kjs/date_object.cpp:
1719         (KJS::formatLocaleDate):
1720         (KJS::fillStructuresUsingTimeArgs):
1721         (KJS::fillStructuresUsingDateArgs):
1722         (KJS::DateConstructor::construct):
1723         (KJS::DateConstructor::callAsFunction):
1724         (KJS::DateFunction::callAsFunction):
1725         (KJS::dateProtoFuncToString):
1726         (KJS::dateProtoFuncToUTCString):
1727         (KJS::dateProtoFuncToDateString):
1728         (KJS::dateProtoFuncToTimeString):
1729         (KJS::dateProtoFuncToLocaleString):
1730         (KJS::dateProtoFuncToLocaleDateString):
1731         (KJS::dateProtoFuncToLocaleTimeString):
1732         (KJS::dateProtoFuncValueOf):
1733         (KJS::dateProtoFuncGetTime):
1734         (KJS::dateProtoFuncGetFullYear):
1735         (KJS::dateProtoFuncGetUTCFullYear):
1736         (KJS::dateProtoFuncToGMTString):
1737         (KJS::dateProtoFuncGetMonth):
1738         (KJS::dateProtoFuncGetUTCMonth):
1739         (KJS::dateProtoFuncGetDate):
1740         (KJS::dateProtoFuncGetUTCDate):
1741         (KJS::dateProtoFuncGetDay):
1742         (KJS::dateProtoFuncGetUTCDay):
1743         (KJS::dateProtoFuncGetHours):
1744         (KJS::dateProtoFuncGetUTCHours):
1745         (KJS::dateProtoFuncGetMinutes):
1746         (KJS::dateProtoFuncGetUTCMinutes):
1747         (KJS::dateProtoFuncGetSeconds):
1748         (KJS::dateProtoFuncGetUTCSeconds):
1749         (KJS::dateProtoFuncGetMilliSeconds):
1750         (KJS::dateProtoFuncGetUTCMilliseconds):
1751         (KJS::dateProtoFuncGetTimezoneOffset):
1752         (KJS::dateProtoFuncSetTime):
1753         (KJS::setNewValueFromTimeArgs):
1754         (KJS::setNewValueFromDateArgs):
1755         (KJS::dateProtoFuncSetMilliSeconds):
1756         (KJS::dateProtoFuncSetUTCMilliseconds):
1757         (KJS::dateProtoFuncSetSeconds):
1758         (KJS::dateProtoFuncSetUTCSeconds):
1759         (KJS::dateProtoFuncSetMinutes):
1760         (KJS::dateProtoFuncSetUTCMinutes):
1761         (KJS::dateProtoFuncSetHours):
1762         (KJS::dateProtoFuncSetUTCHours):
1763         (KJS::dateProtoFuncSetDate):
1764         (KJS::dateProtoFuncSetUTCDate):
1765         (KJS::dateProtoFuncSetMonth):
1766         (KJS::dateProtoFuncSetUTCMonth):
1767         (KJS::dateProtoFuncSetFullYear):
1768         (KJS::dateProtoFuncSetUTCFullYear):
1769         (KJS::dateProtoFuncSetYear):
1770         (KJS::dateProtoFuncGetYear):
1771         * kjs/date_object.h:
1772         * kjs/debugger.h:
1773         * kjs/error_object.cpp:
1774         (KJS::errorProtoFuncToString):
1775         (KJS::ErrorConstructor::construct):
1776         (KJS::ErrorConstructor::callAsFunction):
1777         (KJS::NativeErrorConstructor::construct):
1778         (KJS::NativeErrorConstructor::callAsFunction):
1779         * kjs/error_object.h:
1780         * kjs/internal.cpp:
1781         (KJS::JSNumberCell::toObject):
1782         (KJS::JSNumberCell::toThisObject):
1783         * kjs/list.cpp:
1784         (KJS::ArgList::getSlice):
1785         (KJS::ArgList::markLists):
1786         (KJS::ArgList::slowAppend):
1787         * kjs/list.h:
1788         (KJS::ArgList::ArgList):
1789         (KJS::ArgList::~ArgList):
1790         * kjs/object_object.cpp:
1791         (KJS::objectProtoFuncValueOf):
1792         (KJS::objectProtoFuncHasOwnProperty):
1793         (KJS::objectProtoFuncIsPrototypeOf):
1794         (KJS::objectProtoFuncDefineGetter):
1795         (KJS::objectProtoFuncDefineSetter):
1796         (KJS::objectProtoFuncLookupGetter):
1797         (KJS::objectProtoFuncLookupSetter):
1798         (KJS::objectProtoFuncPropertyIsEnumerable):
1799         (KJS::objectProtoFuncToLocaleString):
1800         (KJS::objectProtoFuncToString):
1801         (KJS::ObjectConstructor::construct):
1802         (KJS::ObjectConstructor::callAsFunction):
1803         * kjs/object_object.h:
1804         * kjs/string_object.cpp:
1805         (KJS::replace):
1806         (KJS::stringProtoFuncToString):
1807         (KJS::stringProtoFuncValueOf):
1808         (KJS::stringProtoFuncCharAt):
1809         (KJS::stringProtoFuncCharCodeAt):
1810         (KJS::stringProtoFuncConcat):
1811         (KJS::stringProtoFuncIndexOf):
1812         (KJS::stringProtoFuncLastIndexOf):
1813         (KJS::stringProtoFuncMatch):
1814         (KJS::stringProtoFuncSearch):
1815         (KJS::stringProtoFuncReplace):
1816         (KJS::stringProtoFuncSlice):
1817         (KJS::stringProtoFuncSplit):
1818         (KJS::stringProtoFuncSubstr):
1819         (KJS::stringProtoFuncSubstring):
1820         (KJS::stringProtoFuncToLowerCase):
1821         (KJS::stringProtoFuncToUpperCase):
1822         (KJS::stringProtoFuncToLocaleLowerCase):
1823         (KJS::stringProtoFuncToLocaleUpperCase):
1824         (KJS::stringProtoFuncLocaleCompare):
1825         (KJS::stringProtoFuncBig):
1826         (KJS::stringProtoFuncSmall):
1827         (KJS::stringProtoFuncBlink):
1828         (KJS::stringProtoFuncBold):
1829         (KJS::stringProtoFuncFixed):
1830         (KJS::stringProtoFuncItalics):
1831         (KJS::stringProtoFuncStrike):
1832         (KJS::stringProtoFuncSub):
1833         (KJS::stringProtoFuncSup):
1834         (KJS::stringProtoFuncFontcolor):
1835         (KJS::stringProtoFuncFontsize):
1836         (KJS::stringProtoFuncAnchor):
1837         (KJS::stringProtoFuncLink):
1838         (KJS::StringConstructor::construct):
1839         (KJS::StringConstructor::callAsFunction):
1840         (KJS::StringConstructorFunction::callAsFunction):
1841         * kjs/string_object.h:
1842
1843 2008-06-15  Darin Adler  <darin@apple.com>
1844
1845         - new names for more JavaScriptCore files
1846
1847         * API/JSCallbackFunction.cpp:
1848         * API/JSObjectRef.cpp:
1849         * DerivedSources.make:
1850         * GNUmakefile.am:
1851         * JavaScriptCore.exp:
1852         * JavaScriptCore.pri:
1853         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1854         * JavaScriptCore.xcodeproj/project.pbxproj:
1855         * JavaScriptCoreSources.bkl:
1856         * VM/Machine.cpp:
1857         * kjs/AllInOneFile.cpp:
1858         * kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
1859         * kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
1860         * kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
1861         * kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
1862         * kjs/ExecState.cpp:
1863         * kjs/ExecState.h:
1864         * kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
1865         * kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
1866         * kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
1867         * kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
1868         * kjs/JSFunction.cpp:
1869         * kjs/JSFunction.h:
1870         * kjs/JSGlobalObject.cpp:
1871         * kjs/JSImmediate.cpp:
1872         * kjs/JSObject.h:
1873         * kjs/JSString.h:
1874         * kjs/JSValue.h:
1875         * kjs/JSVariableObject.cpp:
1876         * kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
1877         * kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
1878         * kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
1879         * kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
1880         * kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
1881         * kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
1882         * kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
1883         * kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
1884         * kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
1885         * kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
1886         * kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
1887         * kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
1888         * kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
1889         * kjs/Shell.cpp:
1890         * kjs/array_instance.cpp: Removed.
1891         * kjs/array_instance.h: Removed.
1892         * kjs/array_object.cpp: Removed.
1893         * kjs/array_object.h: Removed.
1894         * kjs/bool_object.cpp: Removed.
1895         * kjs/bool_object.h: Removed.
1896         * kjs/error_object.h:
1897         * kjs/function_object.cpp: Removed.
1898         * kjs/function_object.h: Removed.
1899         * kjs/internal.cpp:
1900         * kjs/math_object.cpp: Removed.
1901         * kjs/math_object.h: Removed.
1902         * kjs/nodes.cpp:
1903         * kjs/number_object.cpp: Removed.
1904         * kjs/number_object.h: Removed.
1905         * kjs/object_object.cpp:
1906         * kjs/property_map.cpp: Removed.
1907         * kjs/property_map.h: Removed.
1908         * kjs/property_slot.cpp: Removed.
1909         * kjs/property_slot.h: Removed.
1910         * kjs/regexp_object.cpp: Removed.
1911         * kjs/regexp_object.h: Removed.
1912         * kjs/scope_chain.cpp: Removed.
1913         * kjs/scope_chain.h: Removed.
1914         * kjs/scope_chain_mark.h: Removed.
1915         * kjs/string_object.cpp:
1916         * kjs/string_object.h:
1917
1918 2008-06-15  Darin Adler  <darin@apple.com>
1919
1920         - new names for a few key JavaScriptCore files
1921
1922         * API/JSBase.cpp:
1923         * API/JSCallbackConstructor.h:
1924         * API/JSCallbackFunction.cpp:
1925         * API/JSCallbackFunction.h:
1926         * API/JSCallbackObject.h:
1927         * API/JSCallbackObjectFunctions.h:
1928         * API/JSClassRef.h:
1929         * API/JSContextRef.cpp:
1930         * API/JSObjectRef.cpp:
1931         * API/JSStringRef.cpp:
1932         * API/JSStringRefCF.cpp:
1933         * API/JSValueRef.cpp:
1934         * GNUmakefile.am:
1935         * JavaScriptCore.pri:
1936         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1937         * JavaScriptCore.xcodeproj/project.pbxproj:
1938         * JavaScriptCoreSources.bkl:
1939         * VM/CodeBlock.cpp:
1940         * VM/CodeGenerator.cpp:
1941         * VM/ExceptionHelpers.cpp:
1942         * VM/ExceptionHelpers.h:
1943         * VM/JSPropertyNameIterator.cpp:
1944         * VM/JSPropertyNameIterator.h:
1945         * VM/Machine.cpp:
1946         * kjs/AllInOneFile.cpp:
1947         * kjs/DateMath.cpp:
1948         * kjs/DebuggerCallFrame.cpp:
1949         * kjs/ExecState.cpp:
1950         * kjs/JSActivation.cpp:
1951         * kjs/JSFunction.cpp: Copied from JavaScriptCore/kjs/function.cpp.
1952         * kjs/JSFunction.h: Copied from JavaScriptCore/kjs/function.h.
1953         * kjs/JSImmediate.cpp:
1954         * kjs/JSNotAnObject.h:
1955         * kjs/JSObject.cpp: Copied from JavaScriptCore/kjs/object.cpp.
1956         * kjs/JSObject.h: Copied from JavaScriptCore/kjs/object.h.
1957         * kjs/JSString.h: Copied from JavaScriptCore/kjs/internal.h.
1958         * kjs/JSValue.cpp: Copied from JavaScriptCore/kjs/value.cpp.
1959         * kjs/JSValue.h: Copied from JavaScriptCore/kjs/value.h.
1960         * kjs/JSVariableObject.h:
1961         * kjs/JSWrapperObject.h:
1962         * kjs/Shell.cpp:
1963         * kjs/SymbolTable.h:
1964         * kjs/array_instance.h:
1965         * kjs/collector.cpp:
1966         * kjs/date_object.cpp:
1967         * kjs/date_object.h:
1968         * kjs/error_object.cpp:
1969         * kjs/function.cpp: Removed.
1970         * kjs/function.h: Removed.
1971         * kjs/function_object.cpp:
1972         * kjs/function_object.h:
1973         * kjs/grammar.y:
1974         * kjs/internal.cpp:
1975         * kjs/internal.h: Removed.
1976         * kjs/lexer.cpp:
1977         * kjs/list.h:
1978         * kjs/lookup.h:
1979         * kjs/nodes.h:
1980         * kjs/object.cpp: Removed.
1981         * kjs/object.h: Removed.
1982         * kjs/object_object.h:
1983         * kjs/operations.cpp:
1984         * kjs/property_map.cpp:
1985         * kjs/property_slot.cpp:
1986         * kjs/property_slot.h:
1987         * kjs/protect.h:
1988         * kjs/regexp_object.cpp:
1989         * kjs/scope_chain.cpp:
1990         * kjs/string_object.h:
1991         * kjs/ustring.cpp:
1992         * kjs/value.cpp: Removed.
1993         * kjs/value.h: Removed.
1994         * profiler/Profile.cpp:
1995         * profiler/Profiler.cpp:
1996
1997 2008-06-15  Darin Adler  <darin@apple.com>
1998
1999         Rubber stamped by Sam.
2000
2001         - cut down on confusing uses of "Object" and "Imp" in
2002           JavaScriptCore class names
2003
2004         * API/JSCallbackFunction.cpp:
2005         (KJS::JSCallbackFunction::JSCallbackFunction):
2006         * API/JSCallbackFunction.h:
2007         * VM/Machine.cpp:
2008         (KJS::Machine::privateExecute):
2009         * kjs/ExecState.h:
2010         (KJS::ExecState::regExpTable):
2011         (KJS::ExecState::regExpConstructorTable):
2012         * kjs/JSGlobalData.cpp:
2013         (KJS::JSGlobalData::JSGlobalData):
2014         (KJS::JSGlobalData::~JSGlobalData):
2015         * kjs/JSGlobalData.h:
2016         * kjs/JSGlobalObject.cpp:
2017         (KJS::JSGlobalObject::reset):
2018         * kjs/JSGlobalObject.h:
2019         (KJS::JSGlobalObject::objectConstructor):
2020         (KJS::JSGlobalObject::functionConstructor):
2021         (KJS::JSGlobalObject::arrayConstructor):
2022         (KJS::JSGlobalObject::booleanConstructor):
2023         (KJS::JSGlobalObject::stringConstructor):
2024         (KJS::JSGlobalObject::numberConstructor):
2025         (KJS::JSGlobalObject::dateConstructor):
2026         (KJS::JSGlobalObject::regExpConstructor):
2027         (KJS::JSGlobalObject::errorConstructor):
2028         (KJS::JSGlobalObject::evalErrorConstructor):
2029         (KJS::JSGlobalObject::rangeErrorConstructor):
2030         (KJS::JSGlobalObject::referenceErrorConstructor):
2031         (KJS::JSGlobalObject::syntaxErrorConstructor):
2032         (KJS::JSGlobalObject::typeErrorConstructor):
2033         (KJS::JSGlobalObject::URIErrorConstructor):
2034         * kjs/array_object.cpp:
2035         (KJS::ArrayConstructor::ArrayConstructor):
2036         (KJS::ArrayConstructor::getConstructData):
2037         (KJS::ArrayConstructor::construct):
2038         (KJS::ArrayConstructor::callAsFunction):
2039         * kjs/array_object.h:
2040         * kjs/bool_object.cpp:
2041         (KJS::BooleanObject::BooleanObject):
2042         (KJS::BooleanPrototype::BooleanPrototype):
2043         (KJS::booleanProtoFuncToString):
2044         (KJS::booleanProtoFuncValueOf):
2045         (KJS::BooleanConstructor::BooleanConstructor):
2046         (KJS::BooleanConstructor::getConstructData):
2047         (KJS::BooleanConstructor::construct):
2048         (KJS::BooleanConstructor::callAsFunction):
2049         * kjs/bool_object.h:
2050         * kjs/date_object.cpp:
2051         (KJS::DatePrototype::DatePrototype):
2052         (KJS::DateConstructor::DateConstructor):
2053         (KJS::DateConstructor::getConstructData):
2054         (KJS::DateConstructor::construct):
2055         (KJS::DateConstructor::callAsFunction):
2056         (KJS::DateFunction::DateFunction):
2057         (KJS::DateFunction::callAsFunction):
2058         * kjs/date_object.h:
2059         * kjs/error_object.cpp:
2060         (KJS::ErrorPrototype::ErrorPrototype):
2061         (KJS::ErrorConstructor::ErrorConstructor):
2062         (KJS::ErrorConstructor::getConstructData):
2063         (KJS::ErrorConstructor::construct):
2064         (KJS::ErrorConstructor::callAsFunction):
2065         (KJS::NativeErrorConstructor::NativeErrorConstructor):
2066         (KJS::NativeErrorConstructor::getConstructData):
2067         (KJS::NativeErrorConstructor::construct):
2068         (KJS::NativeErrorConstructor::callAsFunction):
2069         (KJS::NativeErrorConstructor::mark):
2070         * kjs/error_object.h:
2071         * kjs/function.cpp:
2072         (KJS::JSFunction::JSFunction):
2073         (KJS::JSFunction::mark):
2074         (KJS::JSFunction::getOwnPropertySlot):
2075         (KJS::JSFunction::put):
2076         (KJS::JSFunction::deleteProperty):
2077         (KJS::PrototypeFunction::PrototypeFunction):
2078         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2079         (KJS::PrototypeReflexiveFunction::mark):
2080         * kjs/function.h:
2081         * kjs/function_object.cpp:
2082         (KJS::functionProtoFuncToString):
2083         (KJS::FunctionConstructor::FunctionConstructor):
2084         (KJS::FunctionConstructor::getConstructData):
2085         (KJS::FunctionConstructor::construct):
2086         (KJS::FunctionConstructor::callAsFunction):
2087         * kjs/function_object.h:
2088         * kjs/internal.cpp:
2089         (KJS::StringObject::create):
2090         (KJS::JSString::toObject):
2091         (KJS::JSString::toThisObject):
2092         (KJS::JSString::getOwnPropertySlot):
2093         (KJS::InternalFunction::InternalFunction):
2094         (KJS::InternalFunction::getCallData):
2095         (KJS::InternalFunction::implementsHasInstance):
2096         * kjs/math_object.cpp:
2097         (KJS::MathObject::MathObject):
2098         (KJS::MathObject::getOwnPropertySlot):
2099         (KJS::MathObject::getValueProperty):
2100         * kjs/math_object.h:
2101         * kjs/number_object.cpp:
2102         (KJS::NumberObject::NumberObject):
2103         (KJS::NumberPrototype::NumberPrototype):
2104         (KJS::numberProtoFuncToString):
2105         (KJS::numberProtoFuncToLocaleString):
2106         (KJS::numberProtoFuncValueOf):
2107         (KJS::numberProtoFuncToFixed):
2108         (KJS::numberProtoFuncToExponential):
2109         (KJS::numberProtoFuncToPrecision):
2110         (KJS::NumberConstructor::NumberConstructor):
2111         (KJS::NumberConstructor::getOwnPropertySlot):
2112         (KJS::NumberConstructor::getValueProperty):
2113         (KJS::NumberConstructor::getConstructData):
2114         (KJS::NumberConstructor::construct):
2115         (KJS::NumberConstructor::callAsFunction):
2116         * kjs/number_object.h:
2117         * kjs/object.cpp:
2118         (KJS::JSObject::putDirectFunction):
2119         * kjs/object.h:
2120         * kjs/object_object.cpp:
2121         (KJS::ObjectConstructor::ObjectConstructor):
2122         (KJS::ObjectConstructor::getConstructData):
2123         (KJS::ObjectConstructor::construct):
2124         (KJS::ObjectConstructor::callAsFunction):
2125         * kjs/object_object.h:
2126         * kjs/regexp.cpp:
2127         (KJS::RegExp::RegExp):
2128         * kjs/regexp_object.cpp:
2129         (KJS::regExpProtoFuncTest):
2130         (KJS::regExpProtoFuncExec):
2131         (KJS::regExpProtoFuncCompile):
2132         (KJS::regExpProtoFuncToString):
2133         (KJS::RegExpObject::RegExpObject):
2134         (KJS::RegExpObject::~RegExpObject):
2135         (KJS::RegExpObject::getOwnPropertySlot):
2136         (KJS::RegExpObject::getValueProperty):
2137         (KJS::RegExpObject::put):
2138         (KJS::RegExpObject::putValueProperty):
2139         (KJS::RegExpObject::match):
2140         (KJS::RegExpObject::test):
2141         (KJS::RegExpObject::exec):
2142         (KJS::RegExpObject::getCallData):
2143         (KJS::RegExpObject::callAsFunction):
2144         (KJS::RegExpConstructorPrivate::RegExpConstructorPrivate):
2145         (KJS::RegExpConstructor::RegExpConstructor):
2146         (KJS::RegExpConstructor::performMatch):
2147         (KJS::RegExpMatchesArray::RegExpMatchesArray):
2148         (KJS::RegExpMatchesArray::~RegExpMatchesArray):
2149         (KJS::RegExpMatchesArray::fillArrayInstance):
2150         (KJS::RegExpConstructor::arrayOfMatches):
2151         (KJS::RegExpConstructor::getBackref):
2152         (KJS::RegExpConstructor::getLastParen):
2153         (KJS::RegExpConstructor::getLeftContext):
2154         (KJS::RegExpConstructor::getRightContext):
2155         (KJS::RegExpConstructor::getOwnPropertySlot):
2156         (KJS::RegExpConstructor::getValueProperty):
2157         (KJS::RegExpConstructor::put):
2158         (KJS::RegExpConstructor::putValueProperty):
2159         (KJS::RegExpConstructor::getConstructData):
2160         (KJS::RegExpConstructor::construct):
2161         (KJS::RegExpConstructor::callAsFunction):
2162         (KJS::RegExpConstructor::input):
2163         * kjs/regexp_object.h:
2164         * kjs/string_object.cpp:
2165         (KJS::StringObject::StringObject):
2166         (KJS::StringObject::getOwnPropertySlot):
2167         (KJS::StringObject::put):
2168         (KJS::StringObject::deleteProperty):
2169         (KJS::StringObject::getPropertyNames):
2170         (KJS::StringPrototype::StringPrototype):
2171         (KJS::StringPrototype::getOwnPropertySlot):
2172         (KJS::replace):
2173         (KJS::stringProtoFuncToString):
2174         (KJS::stringProtoFuncValueOf):
2175         (KJS::stringProtoFuncCharAt):
2176         (KJS::stringProtoFuncCharCodeAt):
2177         (KJS::stringProtoFuncConcat):
2178         (KJS::stringProtoFuncIndexOf):
2179         (KJS::stringProtoFuncLastIndexOf):
2180         (KJS::stringProtoFuncMatch):
2181         (KJS::stringProtoFuncSearch):
2182         (KJS::stringProtoFuncReplace):
2183         (KJS::stringProtoFuncSlice):
2184         (KJS::stringProtoFuncSplit):
2185         (KJS::stringProtoFuncSubstr):
2186         (KJS::stringProtoFuncSubstring):
2187         (KJS::stringProtoFuncToLowerCase):
2188         (KJS::stringProtoFuncToUpperCase):
2189         (KJS::stringProtoFuncToLocaleLowerCase):
2190         (KJS::stringProtoFuncToLocaleUpperCase):
2191         (KJS::stringProtoFuncLocaleCompare):
2192         (KJS::stringProtoFuncBig):
2193         (KJS::stringProtoFuncSmall):
2194         (KJS::stringProtoFuncBlink):
2195         (KJS::stringProtoFuncBold):
2196         (KJS::stringProtoFuncFixed):
2197         (KJS::stringProtoFuncItalics):
2198         (KJS::stringProtoFuncStrike):
2199         (KJS::stringProtoFuncSub):
2200         (KJS::stringProtoFuncSup):
2201         (KJS::stringProtoFuncFontcolor):
2202         (KJS::stringProtoFuncFontsize):
2203         (KJS::stringProtoFuncAnchor):
2204         (KJS::stringProtoFuncLink):
2205         (KJS::StringConstructor::StringConstructor):
2206         (KJS::StringConstructor::getConstructData):
2207         (KJS::StringConstructor::construct):
2208         (KJS::StringConstructor::callAsFunction):
2209         (KJS::StringConstructorFunction::StringConstructorFunction):
2210         (KJS::StringConstructorFunction::callAsFunction):
2211         * kjs/string_object.h:
2212         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
2213         * profiler/Profiler.cpp:
2214         (KJS::createCallIdentifier):
2215
2216 2008-06-15  Darin Adler  <darin@apple.com>
2217
2218         Rubber stamped by Sam.
2219
2220         - use JS prefix and simpler names for basic JavaScriptCore types,
2221           to complement JSValue and JSObject
2222
2223         * JavaScriptCore.exp:
2224         * VM/Machine.cpp:
2225         (KJS::jsLess):
2226         (KJS::jsLessEq):
2227         (KJS::jsAdd):
2228         (KJS::callEval):
2229         (KJS::Machine::execute):
2230         (KJS::Machine::retrieveArguments):
2231         (KJS::Machine::retrieveCaller):
2232         (KJS::Machine::getCallFrame):
2233         (KJS::Machine::getFunctionAndArguments):
2234         * VM/Machine.h:
2235         * VM/Register.h:
2236         * kjs/DebuggerCallFrame.cpp:
2237         (KJS::DebuggerCallFrame::functionName):
2238         * kjs/ExecState.h:
2239         * kjs/JSActivation.cpp:
2240         (KJS::JSActivation::createArgumentsObject):
2241         * kjs/array_instance.cpp:
2242         (KJS::JSArray::checkConsistency):
2243         (KJS::JSArray::JSArray):
2244         (KJS::JSArray::~JSArray):
2245         (KJS::JSArray::getItem):
2246         (KJS::JSArray::lengthGetter):
2247         (KJS::JSArray::inlineGetOwnPropertySlot):
2248         (KJS::JSArray::getOwnPropertySlot):
2249         (KJS::JSArray::put):
2250         (KJS::JSArray::deleteProperty):
2251         (KJS::JSArray::getPropertyNames):
2252         (KJS::JSArray::increaseVectorLength):
2253         (KJS::JSArray::setLength):
2254         (KJS::JSArray::mark):
2255         (KJS::JSArray::sort):
2256         (KJS::JSArray::compactForSorting):
2257         (KJS::JSArray::lazyCreationData):
2258         (KJS::JSArray::setLazyCreationData):
2259         * kjs/array_instance.h:
2260         * kjs/array_object.cpp:
2261         (KJS::ArrayPrototype::ArrayPrototype):
2262         (KJS::ArrayPrototype::getOwnPropertySlot):
2263         (KJS::arrayProtoFuncToString):
2264         (KJS::arrayProtoFuncToLocaleString):
2265         (KJS::arrayProtoFuncConcat):
2266         (KJS::arrayProtoFuncSort):
2267         (KJS::ArrayObjectImp::construct):
2268         * kjs/array_object.h:
2269         * kjs/completion.h:
2270         * kjs/function.cpp:
2271         (KJS::JSFunction::JSFunction):
2272         (KJS::JSFunction::mark):
2273         (KJS::JSFunction::getCallData):
2274         (KJS::JSFunction::callAsFunction):
2275         (KJS::JSFunction::argumentsGetter):
2276         (KJS::JSFunction::callerGetter):
2277         (KJS::JSFunction::lengthGetter):
2278         (KJS::JSFunction::getOwnPropertySlot):
2279         (KJS::JSFunction::put):
2280         (KJS::JSFunction::deleteProperty):
2281         (KJS::JSFunction::getParameterName):
2282         (KJS::JSFunction::getConstructData):
2283         (KJS::JSFunction::construct):
2284         (KJS::IndexToNameMap::IndexToNameMap):
2285         (KJS::Arguments::Arguments):
2286         * kjs/function.h:
2287         * kjs/function_object.cpp:
2288         (KJS::functionProtoFuncToString):
2289         (KJS::functionProtoFuncApply):
2290         (KJS::FunctionObjectImp::construct):
2291         * kjs/internal.cpp:
2292         (KJS::JSString::toPrimitive):
2293         (KJS::JSString::getPrimitiveNumber):
2294         (KJS::JSString::toBoolean):
2295         (KJS::JSString::toNumber):
2296         (KJS::JSString::toString):
2297         (KJS::StringInstance::create):
2298         (KJS::JSString::toObject):
2299         (KJS::JSString::toThisObject):
2300         (KJS::JSString::lengthGetter):
2301         (KJS::JSString::indexGetter):
2302         (KJS::JSString::indexNumericPropertyGetter):
2303         (KJS::JSString::getOwnPropertySlot):
2304         (KJS::JSNumberCell::type):
2305         (KJS::JSNumberCell::toPrimitive):
2306         (KJS::JSNumberCell::getPrimitiveNumber):
2307         (KJS::JSNumberCell::toBoolean):
2308         (KJS::JSNumberCell::toNumber):
2309         (KJS::JSNumberCell::toString):
2310         (KJS::JSNumberCell::toObject):
2311         (KJS::JSNumberCell::toThisObject):
2312         (KJS::JSNumberCell::getUInt32):
2313         (KJS::JSNumberCell::getTruncatedInt32):
2314         (KJS::JSNumberCell::getTruncatedUInt32):
2315         (KJS::GetterSetter::mark):
2316         (KJS::GetterSetter::toPrimitive):
2317         (KJS::GetterSetter::getPrimitiveNumber):
2318         (KJS::GetterSetter::toBoolean):
2319         (KJS::GetterSetter::toNumber):
2320         (KJS::GetterSetter::toString):
2321         (KJS::GetterSetter::toObject):
2322         (KJS::GetterSetter::getOwnPropertySlot):
2323         (KJS::GetterSetter::put):
2324         (KJS::GetterSetter::toThisObject):
2325         * kjs/internal.h:
2326         (KJS::JSString::JSString):
2327         (KJS::JSString::getStringPropertySlot):
2328         * kjs/nodes.cpp:
2329         (KJS::FuncDeclNode::makeFunction):
2330         (KJS::FuncExprNode::makeFunction):
2331         * kjs/nodes.h:
2332         * kjs/object.cpp:
2333         (KJS::JSObject::put):
2334         (KJS::JSObject::deleteProperty):
2335         (KJS::JSObject::defineGetter):
2336         (KJS::JSObject::defineSetter):
2337         (KJS::JSObject::lookupGetter):
2338         (KJS::JSObject::lookupSetter):
2339         (KJS::JSObject::fillGetterPropertySlot):
2340         * kjs/object.h:
2341         (KJS::GetterSetter::GetterSetter):
2342         * kjs/operations.cpp:
2343         (KJS::equal):
2344         (KJS::strictEqual):
2345         * kjs/property_map.cpp:
2346         (KJS::PropertyMap::containsGettersOrSetters):
2347         * kjs/regexp_object.cpp:
2348         (KJS::RegExpMatchesArray::getOwnPropertySlot):
2349         (KJS::RegExpMatchesArray::put):
2350         (KJS::RegExpMatchesArray::deleteProperty):
2351         (KJS::RegExpMatchesArray::getPropertyNames):
2352         (KJS::RegExpMatchesArray::RegExpMatchesArray):
2353         (KJS::RegExpMatchesArray::fillArrayInstance):
2354         * kjs/string_object.cpp:
2355         (KJS::StringInstance::StringInstance):
2356         (KJS::replace):
2357         (KJS::stringProtoFuncReplace):
2358         (KJS::stringProtoFuncToLowerCase):
2359         (KJS::stringProtoFuncToUpperCase):
2360         (KJS::stringProtoFuncToLocaleLowerCase):
2361         (KJS::stringProtoFuncToLocaleUpperCase):
2362         * kjs/string_object.h:
2363         (KJS::StringInstance::internalValue):
2364         * kjs/value.cpp:
2365         (KJS::JSCell::getNumber):
2366         (KJS::JSCell::getString):
2367         (KJS::JSCell::getObject):
2368         (KJS::jsString):
2369         (KJS::jsOwnedString):
2370         * kjs/value.h:
2371         (KJS::JSNumberCell::JSNumberCell):
2372         (KJS::jsNumberCell):
2373         (KJS::JSValue::uncheckedGetNumber):
2374         * profiler/Profiler.cpp:
2375         (KJS::createCallIdentifier):
2376         (KJS::createCallIdentifierFromFunctionImp):
2377
2378 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
2379
2380         Reviewed by Alexey.
2381         
2382         - add emitUnaryOp, emitNullaryOp and emitUnaryOpNoDst; use them
2383         
2384         This removes some boilerplate code and also reduces the number of
2385         places that will need to be changed to do on-demand emit of
2386         loads (and thus support k operands).
2387
2388         * VM/CodeGenerator.cpp:
2389         (KJS::CodeGenerator::emitUnaryOp):
2390         (KJS::CodeGenerator::emitNullaryOp):
2391         (KJS::CodeGenerator::emitUnaryOpNoDst):
2392         (KJS::CodeGenerator::emitPushScope):
2393         * VM/CodeGenerator.h:
2394         (KJS::CodeGenerator::emitNewObject):
2395         (KJS::CodeGenerator::emitNewArray):
2396         (KJS::CodeGenerator::emitNot):
2397         (KJS::CodeGenerator::emitBitNot):
2398         (KJS::CodeGenerator::emitToJSNumber):
2399         (KJS::CodeGenerator::emitNegate):
2400         (KJS::CodeGenerator::emitInstanceOf):
2401         (KJS::CodeGenerator::emitTypeOf):
2402         (KJS::CodeGenerator::emitIn):
2403         (KJS::CodeGenerator::emitReturn):
2404         (KJS::CodeGenerator::emitEnd):
2405         (KJS::CodeGenerator::emitGetPropertyNames):
2406
2407 2008-06-15  Alp Toker  <alp@nuanti.com>
2408
2409         Rubber-stamped by Maciej.
2410
2411         Install 'jsc' application by default.
2412
2413         * GNUmakefile.am:
2414
2415 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
2416
2417         Reviewed by Oliver.
2418         
2419         - rename testkjs to jsc
2420
2421         * GNUmakefile.am:
2422         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2423         * JavaScriptCore.vcproj/jsc: Added.
2424         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Copied from JavaScriptCore.vcproj/testkjs/testkjs.vcproj.
2425         * JavaScriptCore.vcproj/testkjs: Removed.
2426         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Removed.
2427         * JavaScriptCore.xcodeproj/project.pbxproj:
2428         * jscore.bkl:
2429         * kjs/Shell.cpp: Copied from kjs/testkjs.cpp.
2430         (main):
2431         (printUsageStatement):
2432         (jscmain):
2433         * kjs/jsc.pro: Copied from kjs/testkjs.pro.
2434         * kjs/testkjs.cpp: Removed.
2435         * kjs/testkjs.pro: Removed.
2436         * tests/mozilla/expected.html:
2437         * tests/mozilla/js1_2/Array/tostring_1.js:
2438         * tests/mozilla/js1_2/Array/tostring_2.js:
2439         * tests/mozilla/jsDriver.pl:
2440
2441 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2442
2443         Reviewed by Maciej.
2444
2445         Mac build fix.
2446
2447         * JavaScriptCore.xcodeproj/project.pbxproj:
2448         * kjs/nodes.h:
2449
2450 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2451
2452         Reviewed by Maciej.
2453
2454         Change the spelling of PrecMultiplicitave to PrecMultiplicative.
2455
2456         * kjs/nodes.h:
2457         (KJS::MultNode::precedence):
2458         (KJS::DivNode::precedence):
2459         (KJS::ModNode::precedence):
2460
2461 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2462
2463         Reviewed by Maciej.
2464
2465         Remove unused preprocessor macros related to exceptions in the old
2466         interpreter.
2467
2468         * kjs/nodes.cpp:
2469
2470 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2471
2472         Reviewed by Maciej.
2473
2474         Bug 19484: More instructions needs to use temporary registers
2475         <https://bugs.webkit.org/show_bug.cgi?id=19484>
2476
2477         Fix codegen for all binary operations so that temporaries are used if
2478         necessary. This was done by making BinaryOpNode and ReverseBinaryOpNode
2479         subclasses of ExpressionNode, and eliminating the custom emitCode()
2480         methods for the individual node classes.
2481
2482         This only adds 3 new instructions to SunSpider code, and there is no
2483         difference in SunSpider execution time.
2484
2485         * VM/CodeGenerator.cpp:
2486         (KJS::CodeGenerator::emitBitNot):
2487         (KJS::CodeGenerator::emitBinaryOp):
2488         * VM/CodeGenerator.h:
2489         * kjs/grammar.y:
2490         * kjs/nodes.cpp:
2491         (KJS::PreIncResolveNode::emitCode):
2492         (KJS::PreDecResolveNode::emitCode):
2493         (KJS::BinaryOpNode::emitCode):
2494         (KJS::ReverseBinaryOpNode::emitCode):
2495         (KJS::emitReadModifyAssignment):
2496         (KJS::CaseBlockNode::emitCodeForBlock):
2497         * kjs/nodes.h:
2498         (KJS::BinaryOpNode::BinaryOpNode):
2499         (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
2500         (KJS::MultNode::):
2501         (KJS::DivNode::):
2502         (KJS::DivNode::precedence):
2503         (KJS::ModNode::):
2504         (KJS::ModNode::precedence):
2505         (KJS::AddNode::):
2506         (KJS::AddNode::precedence):
2507         (KJS::SubNode::):
2508         (KJS::SubNode::precedence):
2509         (KJS::LeftShiftNode::):
2510         (KJS::LeftShiftNode::precedence):
2511         (KJS::RightShiftNode::):
2512         (KJS::RightShiftNode::precedence):
2513         (KJS::UnsignedRightShiftNode::):
2514         (KJS::UnsignedRightShiftNode::precedence):
2515         (KJS::LessNode::):
2516         (KJS::LessNode::precedence):
2517         (KJS::GreaterNode::):
2518         (KJS::GreaterNode::precedence):
2519         (KJS::LessEqNode::):
2520         (KJS::LessEqNode::precedence):
2521         (KJS::GreaterEqNode::):
2522         (KJS::GreaterEqNode::precedence):
2523         (KJS::InstanceOfNode::):
2524         (KJS::InstanceOfNode::precedence):
2525         (KJS::InNode::):
2526         (KJS::InNode::precedence):
2527         (KJS::EqualNode::):
2528         (KJS::EqualNode::precedence):
2529         (KJS::NotEqualNode::):
2530         (KJS::NotEqualNode::precedence):
2531         (KJS::StrictEqualNode::):
2532         (KJS::StrictEqualNode::precedence):
2533         (KJS::NotStrictEqualNode::):
2534         (KJS::NotStrictEqualNode::precedence):
2535         (KJS::BitAndNode::):
2536         (KJS::BitAndNode::precedence):
2537         (KJS::BitOrNode::):
2538         (KJS::BitOrNode::precedence):
2539         (KJS::BitXOrNode::):
2540         (KJS::BitXOrNode::precedence):
2541         * kjs/nodes2string.cpp:
2542         (KJS::LessNode::streamTo):
2543         (KJS::GreaterNode::streamTo):
2544         (KJS::LessEqNode::streamTo):
2545         (KJS::GreaterEqNode::streamTo):
2546         (KJS::InstanceOfNode::streamTo):
2547         (KJS::InNode::streamTo):
2548         (KJS::EqualNode::streamTo):
2549         (KJS::NotEqualNode::streamTo):
2550         (KJS::StrictEqualNode::streamTo):
2551         (KJS::NotStrictEqualNode::streamTo):
2552         (KJS::BitAndNode::streamTo):
2553         (KJS::BitXOrNode::streamTo):
2554         (KJS::BitOrNode::streamTo):
2555
2556 2008-06-14  Darin Adler  <darin@apple.com>
2557
2558         Rubber stamped by Sam.
2559
2560         - rename a bunch of local symbols within the regular expression code to
2561           follow our usual coding style, and do a few other name tweaks
2562
2563         * pcre/pcre_compile.cpp:
2564         (CompileData::CompileData):
2565         (checkEscape):
2566         (readRepeatCounts):
2567         (compileBranch):
2568         (compileBracket):
2569         (calculateCompiledPatternLength):
2570         (returnError):
2571         (jsRegExpCompile):
2572         * pcre/pcre_exec.cpp:
2573         (MatchStack::MatchStack):
2574         (MatchStack::canUseStackBufferForNextFrame):
2575         (MatchStack::popCurrentFrame):
2576         (match):
2577         (tryFirstByteOptimization):
2578         (tryRequiredByteOptimization):
2579         (jsRegExpExecute):
2580         * pcre/pcre_internal.h:
2581
2582 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2583
2584         Reviewed by Darin.
2585
2586         Remove redundant uses of get().
2587
2588         * kjs/nodes.cpp:
2589         (KJS::BracketAccessorNode::emitCode):
2590         (KJS::AddNode::emitCode):
2591         (KJS::SubNode::emitCode):
2592         (KJS::ReadModifyResolveNode::emitCode):
2593         (KJS::AssignDotNode::emitCode):
2594         (KJS::ReadModifyDotNode::emitCode):
2595         (KJS::AssignBracketNode::emitCode):
2596         (KJS::ReadModifyBracketNode::emitCode):
2597
2598 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2599
2600         Reviewed by Maciej.
2601
2602         Make code generation not use a temporary for the left-hand side of an
2603         expression if the right-hand side is a local variable.
2604
2605         * VM/CodeGenerator.cpp:
2606         (KJS::CodeGenerator::isLocal):
2607         * VM/CodeGenerator.h:
2608         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2609         (KJS::CodeGenerator::emitNodeForLeftHandSide):
2610         * kjs/nodes.cpp:
2611         (KJS::ResolveNode::isPure):
2612         (KJS::BracketAccessorNode::emitCode):
2613         (KJS::AddNode::emitCode):
2614         (KJS::SubNode::emitCode):
2615         (KJS::ReadModifyResolveNode::emitCode):
2616         (KJS::AssignDotNode::emitCode):
2617         (KJS::ReadModifyDotNode::emitCode):
2618         (KJS::AssignBracketNode::emitCode):
2619         (KJS::ReadModifyBracketNode::emitCode):
2620         * kjs/nodes.h:
2621         (KJS::ExpressionNode::):
2622         (KJS::BooleanNode::):
2623         (KJS::NumberNode::):
2624         (KJS::StringNode::):
2625
2626 2008-06-14  Darin Adler  <darin@apple.com>
2627
2628         Reviewed by Sam.
2629
2630         - more of https://bugs.webkit.org/show_bug.cgi?id=17257
2631           start ref counts at 1 instead of 0 for speed
2632
2633         * kjs/nodes.cpp:
2634         (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
2635         * kjs/nodes.h: Replaced refcount with hasOneRef.
2636
2637         * wtf/ListRefPtr.h:
2638         (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
2639         refcount, so this class can be used with the RefCounted template.
2640
2641         * wtf/RefCounted.h:
2642         (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
2643         it to be non-const.
2644
2645 2008-06-14  Maciej Stachowiak  <mjs@apple.com>
2646
2647         Reviewed by Oliver.
2648         
2649         - initialize local vars as side effect of call instead of in bytecode
2650         1.004x speedup on SunSpider.
2651
2652         This removes just the dispatch overhead for these loads - in the
2653         future, dead store elimination might be able to eliminate them
2654         entirely.
2655         
2656         * VM/CodeGenerator.cpp:
2657         (KJS::CodeGenerator::CodeGenerator): For function blocks, don't
2658         emit loads of undefined for var initialization.
2659         * VM/Machine.cpp:
2660         (KJS::slideRegisterWindowForCall): Instead, initialize locals
2661         as part of the call.
2662
2663 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2664
2665         Reviewed by Oliver.
2666
2667         Remove helper functions in the parser that are no longer needed.
2668
2669         * kjs/grammar.y:
2670
2671 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2672
2673         Reviewed by Oliver.
2674
2675         Bug 19484: More instructions needs to use temporary registers
2676         <https://bugs.webkit.org/show_bug.cgi?id=19484>
2677
2678         Make code generation for AddNode and SubNode use temporaries when
2679         necessary.
2680
2681         * kjs/grammar.y:
2682         * kjs/nodes.cpp:
2683         (KJS::AddNode::emitCode):
2684         (KJS::SubNode::emitCode):
2685         * kjs/nodes.h:
2686         (KJS::AddNode::):
2687         (KJS::SubNode::):
2688
2689 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2690
2691         Reviewed by Maciej.
2692
2693         Combine TrueNode and FalseNode to make BooleanNode, and remove the
2694         unused class PlaceholderTrueNode.
2695
2696         * kjs/grammar.y:
2697         * kjs/nodes.cpp:
2698         (KJS::BooleanNode::emitCode):
2699         * kjs/nodes.h:
2700         (KJS::BooleanNode::):
2701         (KJS::BooleanNode::precedence):
2702         * kjs/nodes2string.cpp:
2703         (KJS::BooleanNode::streamTo):
2704
2705 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2706
2707         Reviewed by Maciej.
2708
2709         Eliminate the use of temporaries to store the left hand side of an
2710         expression when the right hand side is a constant. This slightly
2711         improves the generated bytecode for a few SunSpider tests, but it is
2712         mostly in preparation for fixing
2713
2714         Bug 19484: More instructions needs to use temporary registers
2715         <https://bugs.webkit.org/show_bug.cgi?id=19484>
2716
2717         * VM/CodeGenerator.h:
2718         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2719         (KJS::CodeGenerator::emitNodeForLeftHandSide):
2720         * kjs/nodes.cpp:
2721         (KJS::BracketAccessorNode::emitCode):
2722         (KJS::ReadModifyResolveNode::emitCode):
2723         (KJS::AssignDotNode::emitCode):
2724         (KJS::ReadModifyDotNode::emitCode):
2725         (KJS::AssignBracketNode::emitCode):
2726         (KJS::ReadModifyBracketNode::emitCode):
2727         * kjs/nodes.h:
2728         (KJS::ExpressionNode::):
2729         (KJS::FalseNode::):
2730         (KJS::TrueNode::):
2731         (KJS::NumberNode::):
2732         (KJS::StringNode::):
2733
2734 2008-06-13  Maciej Stachowiak  <mjs@apple.com>
2735
2736         Reviewed by Oliver.
2737         
2738         - prettify opcode stats output
2739         
2740         I changed things to be a bit more aligned, also there is a new
2741         section listing most common opcodes and most common sequences that
2742         include them.
2743
2744         * VM/Opcode.cpp:
2745         (KJS::OpcodeStats::~OpcodeStats):
2746         * VM/Opcode.h:
2747
2748 2008-06-13  Kevin McCullough  <kmccullough@apple.com>
2749
2750         Reviewed by Geoff.
2751
2752         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
2753         profiler.
2754         - Remove recursion from exclude().  This leaves only focus() to fix.
2755
2756         * JavaScriptCore.exp: Change the signatures of the exported functions.
2757         * profiler/Profile.cpp:
2758         (KJS::Profile::forEach): I added a traverseNextNodePreOrder() function
2759         and so needed to distinguish the other function by labeling it
2760         traverseNextNodePostOrder().
2761         (KJS::Profile::exclude): All new exclude that iteratively walks the tree
2762         * profiler/Profile.h:
2763         (KJS::Profile::focus): Add a null check for m_head.
2764         * profiler/ProfileNode.cpp:
2765         (KJS::ProfileNode::traverseNextNodePostOrder): Renamed
2766         (KJS::ProfileNode::traverseNextNodePreOrder): Walks the tree in pre-
2767         order, where the parent is processed before the children.
2768         (KJS::ProfileNode::setTreeVisible): Iterate over the sub-tree and set
2769         all of the nodes visible value.  This changes another function that used
2770         recursion.
2771         (KJS::ProfileNode::exclude): Remove recursion from this function.
2772         Because we now check for m_visible and we are walking the tree in pre-
2773         order we do not need to check if an excluded node is in an excluded
2774         sub-tree.
2775         * profiler/ProfileNode.h: Added specific selfTime functions to
2776         facilitate exclude().
2777         (KJS::ProfileNode::setSelfTime):
2778         (KJS::ProfileNode::setActualSelfTime):
2779         (KJS::ProfileNode::setVisibleSelfTime):
2780
2781 2008-06-12  Darin Adler  <darin@apple.com>
2782
2783         Reviewed by Maciej.
2784
2785         - https://bugs.webkit.org/show_bug.cgi?id=19434
2786           speed up SunSpider by avoiding some string boxing
2787
2788         Speeds up SunSpider by 1.1%.
2789
2790         Optimized code path for getting built-in properties from strings -- avoid
2791         boxing with a string object in that case. We can make further changes to avoid
2792         even more boxing, but this change alone is a win.
2793
2794         * API/JSCallbackObjectFunctions.h:
2795         (KJS::JSCallbackObject::staticValueGetter): Use isObject instead of inherits
2796         in asssert, since the type of slotBase() is now JSValue, not JSObject.
2797         (KJS::JSCallbackObject::staticFunctionGetter): Ditto.
2798         (KJS::JSCallbackObject::callbackGetter): Ditto.
2799
2800         * kjs/internal.cpp:
2801         (KJS::StringImp::getPrimitiveNumber): Updated for change of data member name.
2802         (KJS::StringImp::toBoolean): Ditto.
2803         (KJS::StringImp::toNumber): Ditto.
2804         (KJS::StringImp::toString): Ditto.
2805         (KJS::StringInstance::create): Added; avoids a bit of cut and paste code.
2806         (KJS::StringImp::toObject): Use StringInstance::create.
2807         (KJS::StringImp::toThisObject): Ditto.
2808         (KJS::StringImp::lengthGetter): Added. Replaces the getter that used to live in
2809         the StringInstance class.
2810         (KJS::StringImp::indexGetter): Ditto.
2811         (KJS::StringImp::indexNumericPropertyGetter): Ditto.
2812         (KJS::StringImp::getOwnPropertySlot): Added. Deals with built in properties of
2813         the string class without creating a StringInstance.
2814
2815         * kjs/internal.h:
2816         (KJS::StringImp::getStringPropertySlot): Added. To be used by both the string
2817         and string object getOwnPropertySlot function.
2818
2819         * kjs/lookup.h:
2820         (KJS::staticFunctionGetter): Updated since slotBase() is now a JSValue rather
2821         than a JSObject.
2822
2823         * kjs/object.h: Removed PropertySlot::slotBase() function, which can now move
2824         back into property_slot.h where it belongs since it doesn't have to cast to
2825         JSObject*.
2826
2827         * kjs/property_slot.cpp:
2828         (KJS::PropertySlot::functionGetter): Updated since slot.slotBase() is now a JSValue*
2829         instead of JSObject*. setGetterSlot still guarantees the base is a JSObject*.
2830         * kjs/property_slot.h:
2831         (KJS::PropertySlot::PropertySlot): Changed base to JSValue* intead of JSCell*.
2832         (KJS::PropertySlot::setStaticEntry): Ditto.
2833         (KJS::PropertySlot::setCustom): Ditto.
2834         (KJS::PropertySlot::setCustomIndex): Ditto.
2835         (KJS::PropertySlot::setCustomNumeric): Ditto.
2836         (KJS::PropertySlot::slotBase): Moved inline here since it no longer involves a
2837         downcast to JSObject*.
2838         (KJS::PropertySlot::setBase): Changed to JSValue*.
2839
2840         * kjs/string_object.cpp:
2841         (KJS::StringInstance::getOwnPropertySlot): Changed to use getStringPropertySlot
2842         instead of coding the properties here. This allows sharing the code with StringImp.
2843
2844         * kjs/string_object.h: Removed inlineGetOwnPropertySlot, lengthGetter, and indexGetter.
2845         Made one of the constructors protected.
2846
2847         * kjs/value.h: Made getOwnPropertySlot private in the JSCell class -- this is better
2848         since it's not the real JSObject getOwnPropertySlot semantic and most callers shouldn't
2849         use it.
2850
2851 2008-06-12  Alexey Proskuryakov  <ap@webkit.org>
2852
2853         Reviewed by Maciej.
2854
2855         Preparation to making JavaScript heap per-thread.
2856
2857         * kjs/collector.cpp:
2858         (KJS::Collector::collect):
2859         * kjs/collector.h:
2860         (KJS::Collector::markListSet):
2861         The collector now holds the list of protected lists itself, to be made per-instance.
2862
2863         * kjs/list.h: Changed to hold a pointer to a mark set this list is in, if any.
2864         (KJS::List::List): Explicitly initialize m_size with zero, as m_vector.size() is
2865         guaranteed to be such anyway.
2866         (KJS::List::append): Changed the fast case to only be executed as long as inline buffer
2867         is used, because otherwise, we now do more expensive checks.
2868
2869         * kjs/list.cpp:
2870         (KJS::List::markLists): Renamed from markProtectedListsSlowCase, made it take the list set
2871         as a parameter.
2872         (KJS::List::slowAppend): If a non-immediate value is appended, the list needs to be added
2873         to an appropriate Heap's protected list. For now, a static Collector::markListSet() is
2874         used, but the code is layed out in preparation to making the switch to multiple heaps.
2875
2876         * JavaScriptCore.exp: Updated export list.
2877
2878 2008-06-12  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2879
2880         Reviewed by Maciej.
2881
2882         Bug 19510: CodeBlock::needsFullScopeChain not always set for global code
2883         <https://bugs.webkit.org/show_bug.cgi?id=19510>
2884
2885         This fixes the symptoms by using CodeGenerator::m_codeType to determine
2886         when to use temporaries instead of CodeBlock::needsFullScopeChain, but
2887         it does not fix the problem itself.
2888
2889         * VM/CodeGenerator.h:
2890         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2891
2892 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2893
2894         Reviewed by Maciej.
2895
2896         Bug 19498: REGRESSION (r34497): crash while loading GMail
2897         <https://bugs.webkit.org/show_bug.cgi?id=19498>
2898
2899         * VM/CodeGenerator.cpp:
2900         (KJS::CodeGenerator::emitJumpIfTrueMayCombine):
2901         (KJS::CodeGenerator::emitJumpIfTrue):
2902         * VM/CodeGenerator.h:
2903         * kjs/nodes.cpp:
2904         (KJS::DoWhileNode::emitCode):
2905         (KJS::WhileNode::emitCode):
2906         (KJS::ForNode::emitCode):
2907         (KJS::CaseBlockNode::emitCodeForBlock):
2908
2909 2008-06-11  Darin Adler  <darin@apple.com>
2910
2911         Reviewed by Maciej.
2912
2913         - a little bit of cleanup and prep for some upcoming optimizations
2914
2915         * JavaScriptCore.exp: Re-sorted this file (with sort command line tool).
2916         * VM/CodeBlock.cpp:
2917         (KJS::CodeBlock::dump): Fixed printf to avoid warnings -- to use %lu we
2918         need to make sure the type is unsigned long.
2919         * kjs/object.cpp:
2920         (KJS::Error::create): Eliminated unused error names array, and also put
2921         the strings into the code since there was already a switch statment.
2922         This also avoids having to contemplate a hypothetical access past the
2923         end of the array.
2924         * kjs/object.h: Got rid of errorNames.
2925         * kjs/property_slot.cpp: Deleted unused ungettableGetter.
2926         * kjs/property_slot.h: Ditto.
2927         * wtf/AlwaysInline.h: Added LIKELY alongside UNLIKELY.
2928
2929 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2930
2931         Reviewed by Darin.
2932
2933         Bug 19457: Create fused opcodes for tests and conditional jumps
2934         <https://bugs.webkit.org/show_bug.cgi?id=19457>
2935
2936         Add a new jless instruction, and modify the code generator to emit it
2937         instead of the pair (less, jtrue).
2938
2939         Gives a 3.6% improvement on SunSpider.
2940
2941         * VM/CodeBlock.cpp:
2942         (KJS::CodeBlock::dump):
2943         * VM/CodeGenerator.cpp:
2944         (KJS::CodeGenerator::CodeGenerator):
2945         (KJS::CodeGenerator::emitOpcode):
2946         (KJS::CodeGenerator::retrieveLastBinaryOp):
2947         (KJS::CodeGenerator::rewindBinaryOp):
2948         (KJS::CodeGenerator::emitJump):
2949         (KJS::CodeGenerator::emitJumpIfTrue):
2950         (KJS::CodeGenerator::emitJumpIfFalse):
2951         (KJS::CodeGenerator::emitMove):
2952         (KJS::CodeGenerator::emitNot):
2953         (KJS::CodeGenerator::emitEqual):
2954         (KJS::CodeGenerator::emitNotEqual):
2955         (KJS::CodeGenerator::emitStrictEqual):
2956         (KJS::CodeGenerator::emitNotStrictEqual):
2957         (KJS::CodeGenerator::emitLess):
2958         (KJS::CodeGenerator::emitLessEq):
2959         (KJS::CodeGenerator::emitPreInc):
2960         (KJS::CodeGenerator::emitPreDec):
2961         (KJS::CodeGenerator::emitPostInc):
2962         (KJS::CodeGenerator::emitPostDec):
2963         (KJS::CodeGenerator::emitToJSNumber):
2964         (KJS::CodeGenerator::emitNegate):
2965         (KJS::CodeGenerator::emitAdd):
2966         (KJS::CodeGenerator::emitMul):
2967         (KJS::CodeGenerator::emitDiv):
2968         (KJS::CodeGenerator::emitMod):
2969         (KJS::CodeGenerator::emitSub):
2970         (KJS::CodeGenerator::emitLeftShift):
2971         (KJS::CodeGenerator::emitRightShift):
2972         (KJS::CodeGenerator::emitUnsignedRightShift):
2973         (KJS::CodeGenerator::emitBitAnd):
2974         (KJS::CodeGenerator::emitBitXOr):
2975         (KJS::CodeGenerator::emitBitOr):
2976         (KJS::CodeGenerator::emitBitNot):
2977         (KJS::CodeGenerator::emitInstanceOf):
2978         (KJS::CodeGenerator::emitTypeOf):
2979         (KJS::CodeGenerator::emitIn):
2980         (KJS::CodeGenerator::emitLoad):
2981         (KJS::CodeGenerator::emitNewObject):
2982         (KJS::CodeGenerator::emitNewArray):
2983         (KJS::CodeGenerator::emitResolve):
2984         (KJS::CodeGenerator::emitGetScopedVar):
2985         (KJS::CodeGenerator::emitPutScopedVar):
2986         (KJS::CodeGenerator::emitResolveBase):
2987         (KJS::CodeGenerator::emitResolveWithBase):
2988         (KJS::CodeGenerator::emitResolveFunction):
2989         (KJS::CodeGenerator::emitGetById):
2990         (KJS::CodeGenerator::emitPutById):
2991         (KJS::CodeGenerator::emitPutGetter):
2992         (KJS::CodeGenerator::emitPutSetter):
2993         (KJS::CodeGenerator::emitDeleteById):
2994         (KJS::CodeGenerator::emitGetByVal):
2995         (KJS::CodeGenerator::emitPutByVal):
2996         (KJS::CodeGenerator::emitDeleteByVal):
2997         (KJS::CodeGenerator::emitPutByIndex):
2998         (KJS::CodeGenerator::emitNewFunction):
2999         (KJS::CodeGenerator::emitNewRegExp):
3000         (KJS::CodeGenerator::emitNewFunctionExpression):
3001         (KJS::CodeGenerator::emitCall):
3002         (KJS::CodeGenerator::emitReturn):
3003         (KJS::CodeGenerator::emitEnd):
3004         (KJS::CodeGenerator::emitConstruct):
3005         (KJS::CodeGenerator::emitPushScope):
3006         (KJS::CodeGenerator::emitPopScope):
3007         (KJS::CodeGenerator::emitDebugHook):
3008         (KJS::CodeGenerator::emitComplexJumpScopes):
3009         (KJS::CodeGenerator::emitJumpScopes):
3010         (KJS::CodeGenerator::emitNextPropertyName):
3011         (KJS::CodeGenerator::emitGetPropertyNames):
3012         (KJS::CodeGenerator::emitCatch):
3013         (KJS::CodeGenerator::emitThrow):
3014         (KJS::CodeGenerator::emitNewError):
3015         (KJS::CodeGenerator::emitJumpSubroutine):
3016         (KJS::CodeGenerator::emitSubroutineReturn):
3017         * VM/CodeGenerator.h:
3018         * VM/Machine.cpp:
3019         (KJS::Machine::privateExecute):
3020         * VM/Opcode.cpp:
3021         * VM/Opcode.h:
3022
3023 2008-06-11  Darin Adler  <darin@apple.com>
3024
3025         Reviewed by Alexey.
3026
3027         - fix https://bugs.webkit.org/show_bug.cgi?id=19442
3028           JavaScript array implementation doesn't maintain m_numValuesInVector when sorting
3029
3030         * kjs/array_instance.cpp:
3031         (KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
3032         consistency checks are turned off.
3033         (KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
3034         (KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
3035         (KJS::ArrayInstance::put): Check consistency before and after.
3036         (KJS::ArrayInstance::deleteProperty): Ditto.
3037         (KJS::ArrayInstance::setLength): Ditto.
3038         (KJS::compareByStringPairForQSort): Use typedef for clarity.
3039         (KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
3040         to set up sorting into two separate passes. Added FIXMEs about various exception
3041         safety issues. Added code to set m_numValuesInVector after sorting.
3042         (KJS::ArrayInstance::compactForSorting): Ditto.
3043
3044         * kjs/array_instance.h: Added a definition of an enum for the types of consistency
3045         check and a declaration of the consistency checking function.
3046
3047 2008-06-10  Kevin Ollivier  <kevino@theolliviers.com>
3048
3049         wx build fix. Link against libedit on Mac since HAVE(READLINE) is defined there.
3050
3051         * jscore.bkl:
3052
3053 2008-06-10  Alexey Proskuryakov  <ap@webkit.org>
3054
3055         Reviewed by Darin.
3056
3057         https://bugs.webkit.org/show_bug.cgi?id=16503
3058         match limit takes at least 13% of the time on the SunSpider regexp-dna test
3059
3060         Make the limit test slightly more efficient. It is not clear how much of a win it is,
3061         as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
3062         apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
3063         0.5%, due to random code generation changes.
3064
3065         * pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
3066
3067 2008-06-09  Alp Toker  <alp@nuanti.com>
3068
3069         gcc3/autotools build fix. Add explicit -O2 -fno-strict-aliasing to
3070         each of the tools since these are no longer set globally.
3071
3072         * GNUmakefile.am:
3073
3074 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3075
3076         Reviewed by Sam.
3077
3078         Add an include for readline/history.h to fix the build for Darwin users
3079         with the GNU readline library installed. Also, clean up the style of
3080         the HAVE(READLINE) check.
3081
3082         * kjs/testkjs.cpp:
3083         (runInteractive):
3084
3085 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3086
3087         Reviewed by Darin.
3088
3089         Bug 17531: Add interactive mode to testkjs
3090         <https://bugs.webkit.org/show_bug.cgi?id=17531>
3091
3092         This is a cleaned up version of Sam's earlier patch to add an
3093         interactive mode to testkjs.
3094
3095         Readline support is only enabled on Darwin platforms for now, but
3096         other ports can enable it by defining HAVE_READLINE in kjs/config.h.
3097
3098         * JavaScriptCore.xcodeproj/project.pbxproj:
3099         * kjs/config.h:
3100         * kjs/testkjs.cpp:
3101         (Options::Options):
3102         (runWithScripts):
3103         (runInteractive):
3104         (printUsageStatement):
3105         (parseArguments):
3106         (kjsmain):
3107
3108 2008-06-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3109
3110         Reviewed by Darin.
3111
3112         Bug 19346: REGRESSION: Mootools 1.2 Class inheritance broken in post-SquirrelFish merge
3113         <https://bugs.webkit.org/show_bug.cgi?id=19346>
3114
3115         A check for whether a function's caller is eval code accidentally included
3116         the case where the caller's caller is native code. Add a CodeType field to
3117         CodeBlock and use this for the eval caller test instead.
3118
3119         * VM/CodeBlock.h:
3120         (KJS::CodeBlock::CodeBlock):
3121         (KJS::ProgramCodeBlock::ProgramCodeBlock):
3122         (KJS::EvalCodeBlock::EvalCodeBlock):
3123         * VM/Machine.cpp:
3124         (KJS::getCallerFunctionOffset):
3125         * kjs/nodes.cpp:
3126         (KJS::FunctionBodyNode::generateCode):
3127         (KJS::ProgramNode::generateCode):
3128
3129 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3130
3131         Reviewed by Dan Bernstein.
3132
3133         Bug 17928: testkjs shouldn't require "-f"
3134         <https://bugs.webkit.org/show_bug.cgi?id=17928>
3135
3136         * kjs/testkjs.cpp:
3137         (printUsageStatement):
3138         (parseArguments):
3139
3140 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3141
3142         Reviewed by Eric.
3143
3144         Bug 17548: JavaScriptCore print(a, b) differs from Spidermonkey Behavior
3145         <https://bugs.webkit.org/show_bug.cgi?id=17548>
3146
3147         * kjs/testkjs.cpp:
3148         (functionPrint):
3149
3150 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3151
3152         Reviewed by Sam.
3153
3154         Bug 17547: JavaScriptCore print() differs from Spidermonkey Behavior
3155         <https://bugs.webkit.org/show_bug.cgi?id=17547>
3156
3157         * kjs/testkjs.cpp:
3158         (functionPrint):
3159
3160 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3161
3162         More build fixes.
3163
3164         * kjs/JSGlobalData.cpp: Fixed an included file name for case-sensitive file systems, fixed
3165         JSGlobalData::threadInstance() for non-multithreaded builds.
3166
3167 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3168
3169         Build fix - actually adding JSGlobalData.cpp to non-Mac builds!
3170
3171         * GNUmakefile.am:
3172         * JavaScriptCore.pri:
3173         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3174         * JavaScriptCoreSources.bkl:
3175
3176 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3177
3178         Try to fix Gtk/gcc 4.3 build.
3179
3180         * kjs/JSGlobalData.h: Include ustring.h instead of forward-declaring UString::Rep.
3181
3182 2008-06-06  Alexey Proskuryakov  <ap@webkit.org>
3183
3184         Reviewed by Darin.
3185
3186         Combine per-thread objects into one, to make it easier to support legacy clients (for
3187         which they shouldn't be really per-thread).
3188
3189         No change on SunSpider total.
3190
3191         * JavaScriptCore.xcodeproj/project.pbxproj: Added JSGlobalData.{h,cpp}
3192
3193         * kjs/JSGlobalData.cpp: Added.
3194         (KJS::JSGlobalData::JSGlobalData):
3195         (KJS::JSGlobalData::~JSGlobalData):
3196         (KJS::JSGlobalData::threadInstance):
3197         * kjs/JSGlobalData.h: Added.
3198         This class encapsulates all data that should be per-thread (or shared between legacy clients).
3199         It will also keep a Heap pointer, but right now, Heap (Collector) methods are all static.
3200
3201         * kjs/identifier.h:
3202         (KJS::Identifier::Identifier):
3203         Added a constructor explicitly taking JSGlobalData to access IdentifierTable. Actually,
3204         all of them should, but this will be a separate patch.
3205
3206         * kjs/identifier.cpp:
3207         (KJS::IdentifierTable::literalTable):
3208         (KJS::createIdentifierTable):
3209         (KJS::deleteIdentifierTable):
3210         (KJS::Identifier::add):
3211         (KJS::Identifier::addSlowCase):
3212         Combined IdentifierTable and LiteralIdentifierTable into a single class for simplicity.
3213
3214         * kjs/grammar.y: kjsyyparse now takes JSGlobalData, not just a Lexer.
3215
3216         * kjs/nodes.cpp:
3217         (KJS::Node::Node):
3218         (KJS::EvalFunctionCallNode::emitCode):
3219         (KJS::ScopeNode::ScopeNode):
3220         Changed to access Lexer and Parser via JSGlobalData::threadInstance(). This is also a
3221         temporary measure, they will need to use JSGlobalData explicitly.
3222
3223         * VM/CodeGenerator.cpp:
3224         (KJS::CodeGenerator::CodeGenerator):
3225         * VM/CodeGenerator.h:
3226         * VM/Machine.cpp:
3227         (KJS::callEval):
3228         * kjs/CommonIdentifiers.cpp:
3229         (KJS::CommonIdentifiers::CommonIdentifiers):
3230         * kjs/CommonIdentifiers.h:
3231         * kjs/DebuggerCallFrame.cpp:
3232         (KJS::DebuggerCallFrame::evaluate):
3233         * kjs/ExecState.cpp:
3234         (KJS::ExecState::ExecState):
3235         * kjs/ExecState.h:
3236         (KJS::ExecState::globalData):
3237         (KJS::ExecState::identifierTable):
3238         (KJS::ExecState::propertyNames):
3239         (KJS::ExecState::emptyList):
3240         (KJS::ExecState::lexer):
3241         (KJS::ExecState::parser):
3242         (KJS::ExecState::arrayTable):
3243         (KJS::ExecState::dateTable):
3244         (KJS::ExecState::mathTable):
3245         (KJS::ExecState::numberTable):
3246         (KJS::ExecState::RegExpImpTable):
3247         (KJS::ExecState::RegExpObjectImpTable):
3248         (KJS::ExecState::stringTable):
3249         * kjs/InitializeThreading.cpp:
3250         (KJS::initializeThreadingOnce):
3251         * kjs/JSGlobalObject.cpp:
3252         (KJS::JSGlobalObject::init):
3253         * kjs/JSGlobalObject.h:
3254         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
3255         (KJS::JSGlobalObject::head):
3256         (KJS::JSGlobalObject::globalData):
3257         * kjs/Parser.cpp:
3258         (KJS::Parser::parse):
3259         * kjs/Parser.h:
3260         * kjs/function.cpp:
3261         (KJS::FunctionImp::getParameterName):
3262         (KJS::IndexToNameMap::unMap):
3263         (KJS::globalFuncEval):
3264         * kjs/function_object.cpp:
3265         (KJS::FunctionObjectImp::construct):
3266         * kjs/interpreter.cpp:
3267         (KJS::Interpreter::checkSyntax):
3268         (KJS::Interpreter::evaluate):
3269         * kjs/lexer.cpp:
3270         (kjsyylex):
3271         * kjs/lexer.h:
3272         * kjs/testkjs.cpp:
3273         (prettyPrintScript):
3274         Updated for the above changes. Most of threadInstance uses here will need to be replaced with
3275         explicitly passed pointers to support legacy JSC clients.
3276
3277         * JavaScriptCore.exp: Removed KJS::parser().
3278
3279 2008-06-06  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3280
3281         Reviewed by Oliver.
3282
3283         Bug 19424: Add support for logging opcode pair counts
3284         <https://bugs.webkit.org/show_bug.cgi?id=19424>
3285
3286         * VM/Machine.cpp:
3287         (KJS::Machine::privateExecute):
3288         * VM/Opcode.cpp:
3289         (KJS::OpcodeStats::OpcodeStats):
3290         (KJS::compareOpcodeIndices):
3291         (KJS::compareOpcodePairIndices):
3292         (KJS::OpcodeStats::~OpcodeStats):
3293         (KJS::OpcodeStats::recordInstruction):
3294         (KJS::OpcodeStats::resetLastInstruction):
3295         * VM/Opcode.h:
3296
3297 2008-06-06  Kevin McCullough  <kmccullough@apple.com>
3298
3299         Reviewed by Adam.
3300
3301         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3302         profiler.
3303         - Change the remaining functions that do not take arguments, from using
3304         recursion to using iteration.
3305
3306         * JavaScriptCore.exp:
3307         * profiler/Profile.cpp:
3308         (KJS::stopProfiling):
3309         (KJS::restoreAll):
3310         (KJS::Profile::stopProfiling): Use foreach instead of recursion.
3311         (KJS::Profile::restoreAll): Ditto.
3312         * profiler/Profile.h:
3313         * profiler/ProfileNode.cpp: Remove recursion.
3314         (KJS::ProfileNode::stopProfiling):
3315         (KJS::ProfileNode::restore):
3316         * profiler/ProfileNode.h:
3317
3318 2008-06-05  Oliver Hunt  <oliver@apple.com>
3319
3320         Reviewed by Alexey.
3321
3322         Fix Greater and GreaterEq nodes to emit code for the left
3323         and right sub-expressions in the correct order.
3324
3325         * kjs/nodes.cpp:
3326         (KJS::GreaterNode::emitCode):
3327         (KJS::GreaterEqNode::emitCode):
3328
3329 2008-06-05  Antti Koivisto  <antti@apple.com>
3330
3331         Reviewed by Alp Toker.
3332         
3333         Fix whitespaces.
3334
3335         * kjs/collector.cpp:
3336         (KJS::getPlatformThreadRegisters):
3337
3338 2008-06-05  Antti Koivisto  <antti@apple.com>
3339
3340         Reviewed by Darin.
3341         
3342         Support compiling JavaScriptCore for ARM.
3343
3344         * kjs/collector.cpp:
3345         (KJS::getPlatformThreadRegisters):
3346         (KJS::otherThreadStackPointer):
3347
3348 2008-06-05  Kevin McCullough  <kmccullough@apple.com>
3349
3350         Reviewed by Jon.
3351
3352         - Name changes.
3353
3354         * JavaScriptCore.exp:
3355         * profiler/Profile.cpp:
3356         (KJS::Profile::Profile):
3357         (KJS::Profile::stopProfiling):
3358         (KJS::Profile::didExecute):
3359         (KJS::Profile::forEach):
3360         (KJS::Profile::debugPrintData):
3361         (KJS::Profile::debugPrintDataSampleStyle):
3362         * profiler/Profile.h:
3363         (KJS::Profile::callTree):
3364         (KJS::Profile::totalTime):
3365         (KJS::Profile::sortTotalTimeDescending):
3366         (KJS::Profile::sortTotalTimeAscending):
3367         (KJS::Profile::sortSelfTimeDescending):
3368         (KJS::Profile::sortSelfTimeAscending):
3369         (KJS::Profile::sortCallsDescending):
3370         (KJS::Profile::sortCallsAscending):
3371         (KJS::Profile::sortFunctionNameDescending):
3372         (KJS::Profile::sortFunctionNameAscending):
3373         (KJS::Profile::focus):
3374         (KJS::Profile::exclude):
3375         (KJS::Profile::restoreAll):
3376
3377 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3378
3379         Reviewed by Stephanie Lewis.
3380
3381         Added the -fno-move-loop-invariants flag to the pcre_exec.cpp build, to
3382         tell GCC not to perform loop invariant motion, since GCC's loop
3383         invariant motion doesn't do very well with computed goto code.
3384         
3385         SunSpider reports no change.
3386
3387 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3388
3389         Reviewed by Stephanie Lewis.
3390         
3391         Added the -fno-tree-pre flag to the Machine.cpp build, to tell GCC not
3392         to perform Partial Redundancy Elimination (PRE) on trees in Machine.cpp,
3393         since GCC's PRE doesn't do very well with computed goto code.
3394         
3395         SunSpider reports a .7% speedup.
3396         
3397 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3398
3399         Reviewed by Stephanie Lewis (or maybe the other way around).
3400         
3401         Minor change to PCRE to help out certain compilers.
3402         
3403         SunSpider reports no change, maybe a small speedup.
3404
3405         * pcre/pcre_exec.cpp:
3406         (match): Use instructionPtr++ a little less, to avoid confusing the
3407         optimizer.
3408
3409 2008-06-05  Alexey Proskuryakov  <ap@webkit.org>
3410
3411         Re-landing an independent part of a previously rolled out threading patch.
3412
3413         * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
3414         (replaced "new T" with "new T()").
3415
3416 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
3417
3418         Reviewed by Hyatt.
3419         
3420         - force inlining of a template function that only has one call site per specialization
3421         1.3% speedup on SunSpider
3422
3423         * kjs/collector.cpp:
3424         (KJS::Collector::heapAllocate): This template function is only
3425         called from allocate() and allocateNumber() (once per
3426         specialization) and the extra call overhead for GC allocation
3427         shows up, so force inlining.
3428
3429 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
3430
3431         Reviewed by Alexey and Oliver.
3432         
3433         - remove profiler fetch hack
3434         I measure an 0.5% progression from this, others show a wash. It seems not needed any more.
3435
3436         * VM/Machine.cpp:
3437         (KJS::Machine::privateExecute):
3438
3439 2008-06-05  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3440
3441         Reviewed by Maciej.
3442
3443         Bug 19400: subscript operator does not protect base when necessary
3444         <https://bugs.webkit.org/show_bug.cgi?id=19400>
3445
3446         Use a temporary for the base in BracketAccessorNode if the subscript
3447         might possibly modify it.
3448
3449         * kjs/grammar.y:
3450         * kjs/nodes.cpp:
3451         (KJS::BracketAccessorNode::emitCode):
3452         * kjs/nodes.h:
3453         (KJS::BracketAccessorNode::):
3454
3455 2008-06-04  Sam Weinig  <sam@webkit.org>
3456
3457         Reviewed by Maciej Stachowiak.
3458
3459         Big cleanup of formatting and whitespace.
3460
3461 2008-06-04  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3462
3463         Reviewed by Oliver.
3464
3465         Add an option to dump statistics on executed instructions.
3466
3467         * VM/Machine.cpp:
3468         (KJS::Machine::privateExecute):
3469         * VM/Opcode.cpp:
3470         (KJS::OpcodeStats::~OpcodeStats):
3471         (KJS::OpcodeStats::recordInstruction):
3472         * VM/Opcode.h:
3473
3474 2008-06-04  Kevin McCullough  <kmccullough@apple.com>
3475
3476         Reviewed by Geoff.
3477
3478         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3479         profiler.
3480         - This patch removes the use of recursion for the sort functions.
3481
3482         * JavaScriptCore.exp: Change the signatures of the functions being
3483         exported.
3484         * profiler/Profile.cpp:
3485         (KJS::Profile::sort): This generic function will accept any of the
3486         static sort functions and apply them to the whole tree.
3487         * profiler/Profile.h: All of the sorting functions now call the new
3488         sort() function.
3489         (KJS::Profile::sortTotalTimeDescending):
3490         (KJS::Profile::sortTotalTimeAscending):
3491         (KJS::Profile::sortSelfTimeDescending):
3492         (KJS::Profile::sortSelfTimeAscending):
3493         (KJS::Profile::sortCallsDescending):
3494         (KJS::Profile::sortCallsAscending):
3495         (KJS::Profile::sortFunctionNameDescending):
3496         (KJS::Profile::sortFunctionNameAscending):
3497         * profiler/ProfileNode.cpp:
3498         (KJS::ProfileNode::ProfileNode): m_head used to point to the head node
3499         if this was the head node.  It now points to null to make iteration easy
3500         (KJS::ProfileNode::willExecute): Now must check if m_head is null, this
3501         check used to happend in the constructor.
3502         (KJS::ProfileNode::stopProfiling): Again the check is slightly different
3503         to determine if this is the head.
3504         (KJS::ProfileNode::traverseNextNode): This function returns the next
3505         node in post order.
3506         (KJS::ProfileNode::sort): This generic function will sort according to
3507         the comparator passed in, then reset the children pointers to macth the
3508         new order.
3509         * profiler/ProfileNode.h: The sorting function were removed from the
3510         definition file and instead use the new generic sort() function
3511         (KJS::ProfileNode::totalPercent): because the head can now be empty we
3512         need to check here too for the head node.
3513         (KJS::ProfileNode::selfPercent): Ditto
3514         (KJS::ProfileNode::firstChild): This function is necessary for the 
3515         iterative algorithm in Profile.cpp.
3516         (KJS::ProfileNode::sortTotalTimeDescending):
3517         (KJS::ProfileNode::sortTotalTimeAscending):
3518         (KJS::ProfileNode::sortSelfTimeDescending):
3519         (KJS::ProfileNode::sortSelfTimeAscending):
3520         (KJS::ProfileNode::sortCallsDescending):
3521         (KJS::ProfileNode::sortCallsAscending):
3522         (KJS::ProfileNode::sortFunctionNameDescending):
3523         (KJS::ProfileNode::sortFunctionNameAscending):
3524         (KJS::ProfileNode::childrenBegin):
3525         (KJS::ProfileNode::childrenEnd):
3526         (KJS::ProfileNode::totalTimeDescendingComparator):
3527         (KJS::ProfileNode::totalTimeAscendingComparator):
3528         (KJS::ProfileNode::selfTimeDescendingComparator):
3529         (KJS::ProfileNode::selfTimeAscendingComparator):
3530         (KJS::ProfileNode::callsDescendingComparator):
3531         (KJS::ProfileNode::callsAscendingComparator):
3532         (KJS::ProfileNode::functionNameDescendingComparator):
3533         (KJS::ProfileNode::functionNameAscendingComparator):
3534
3535 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
3536
3537         Reviewed by Darin.
3538
3539         Fix JSClassCreate to work with old JSCore API threading model.
3540
3541         No change on SunSpider.
3542
3543         * API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): Since JSClass is constructed without
3544         a context, there is no way for it to create Identifiers.
3545         Also, added initializeThreading(), just for good measure.
3546
3547         * API/JSCallbackObjectFunctions.h: (KJS::::getPropertyNames): Make an Identifier out of the
3548         string here, because propertyNames.add() needs that.
3549
3550         * kjs/identifier.cpp:
3551         * kjs/identifier.h:
3552         (KJS::Identifier::equal):
3553         * kjs/ustring.cpp:
3554         (KJS::equal):
3555         Moved equal() from identifier.h to ustring.h, because it's not really about Identifiers,
3556         and to make it possible to use it from StrHash.
3557         Include StrHash.h from ustring.h to avoid having the behavior depend on headers that happen
3558         to be included.
3559
3560         * wtf/StrHash.h: Removed.
3561         * kjs/ustring.h: Made RefPtr<UString::Rep> use the same default hash as UString::Rep* (it
3562         used to default to pointer equality). Moved the whole StrHash header into ustring.h.
3563
3564         * JavaScriptCore.exp: Export equal() for WebCore use (this StrHash is used in c_class.cpp,
3565         jni_class.cpp, and npruntime.cpp).
3566
3567 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
3568
3569         Rubber-stamped by Darin.
3570
3571         Fix spacing in collector.{h,cpp}.
3572
3573         * kjs/collector.cpp:
3574         * kjs/collector.h:
3575
3576 2008-06-03  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3577
3578         Reviewed by Maciej.
3579
3580         Build fix. The cleanup in r34355 missed a method.
3581
3582         * kjs/nodes.cpp:
3583         * kjs/nodes.h:
3584
3585 2008-06-03  Darin Adler  <darin@apple.com>
3586
3587         Reviewed by Geoff.
3588
3589         - https://bugs.webkit.org/show_bug.cgi?id=19269
3590           speed up SunSpider by eliminating the toObject call for most get/put/delete
3591
3592         Makes standalone SunSpider 1.025x as fast as before.
3593
3594         The getOwnPropertySlot virtual function now takes care of the toObject call
3595         for get. Similarly, the put function (and later deleteProperty) does the
3596         same for those operations. To do this, the virtual functions were moved from
3597         the JSObject class to the JSCell class. Also, since the caller no longer knows
3598         the identity of the "original object", which is used by JavaScript-function
3599         based getters, changed the PropertySlot class so the original object is
3600         already stored in the slot when getOwnPropertySlot is called, if the caller
3601         intends to call getValue.
3602
3603         This affected the old interpreter code enough that the easiest thing for me
3604         was to just delete it. While I am not certain the mysterious slowdown is not
3605         still occurring, the net change is definitely a significant speedup.
3606
3607         * JavaScriptCore.exp: Updated.
3608
3609         * VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
3610         (KJS::resolve): Set up the originalObject in the PropertySlot before
3611         calling getPropertySlot. Also removed the originalObject argument from
3612         getValue.
3613         (KJS::resolve_skip): Ditto.
3614         (KJS::resolveBaseAndProperty): Ditto.
3615         (KJS::resolveBaseAndFunc): Ditto.
3616         (KJS::Machine::privateExecute): Removed the toObject calls from the get and
3617         put functions where possible, instead calling directly with JSValue and letting
3618         the JSValue and JSCell calls handle toObject. Same for toThisObject.
3619
3620         * kjs/ExecState.h: Removed OldInterpreterExecState.
3621
3622         * API/JSBase.cpp: Updated includes.
3623
3624         * kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.
3625
3626         * kjs/array_instance.cpp:
3627         (KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
3628         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
3629         setValueSlot. Also use UNLIKELY around the "getting elements past the end of
3630         the array" code path; less common than successfully getting an element.
3631
3632         * kjs/array_object.cpp:
3633         (KJS::getProperty): Initialize the PropertySlot with the original object.
3634         Don't pass the original object to the get function.
3635         (KJS::arrayProtoFuncFilter): Ditto.
3636         (KJS::arrayProtoFuncMap): Ditto.
3637         (KJS::arrayProtoFuncEvery): Ditto.
3638         (KJS::arrayProtoFuncForEach): Ditto.
3639         (KJS::arrayProtoFuncSome): Ditto.
3640
3641         * kjs/function_object.cpp:
3642         (KJS::FunctionObjectImp::construct): Removed an obsolete comment.
3643
3644         * kjs/grammar.y: Eliminated support for some of the node types that were
3645         used to optimize executing from the syntax tree.
3646
3647         * kjs/internal.cpp:
3648         (KJS::StringImp::toThisObject): Added. Same as toObject.
3649         (KJS::NumberImp::toThisObject): Ditto.
3650         (KJS::GetterSetterImp::getOwnPropertySlot): Added. Not reached.
3651         (KJS::GetterSetterImp::put): Ditto.
3652         (KJS::GetterSetterImp::toThisObject): Ditto.
3653
3654         * kjs/internal.h: Added toThisObject to NumberImp for speed.
3655
3656         * kjs/lexer.cpp:
3657         (KJS::Lexer::shift): Changed shift to just do a single character, to unroll
3658         the loop and especially to make the one character case faster.
3659         (KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
3660         (KJS::Lexer::lex): Ditto.
3661         (KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
3662         (KJS::Lexer::scanRegExp): Ditto.
3663         * kjs/lexer.h: Removed the count argument from shift.
3664
3665         * kjs/math_object.cpp:
3666         (KJS::mathProtoFuncPow): Call jsNaN instead of jsNumber(NaN).
3667
3668         * kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
3669         execution model.
3670         (KJS::ForNode::emitCode): Handle cases where some expressions are missing by
3671         not emitting any code at all. The old way was to emit code for "true", but
3672         this is an unnecessary remnant of the old way of doing things.
3673
3674         * kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
3675         execution model.
3676
3677         * kjs/object.cpp:
3678         (KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
3679         function. The old code passed in a base, but it was never used when
3680         actually getting the property; the toThisObject call was pointless. Also
3681         changed to not pass a base for setUndefined.
3682
3683         * kjs/object.h: Added the new JSCell operations to GetterSetterImp.
3684         Never called.
3685         (KJS::JSObject::get): Initialize the object in the PropertySlot and don't
3686         pass it in getValue.
3687         (KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
3688         in calls to setValueSlot.
3689         (KJS::JSObject::getOwnPropertySlot): Ditto.
3690         (KJS::JSValue::get): Added. Here because it calls through to JSObject.
3691         A version of JSObject::get that also handles the other types of JSValue
3692         by creating the appropriate wrapper. Saves the virtual call to toObject.
3693         (KJS::JSValue::put): Ditto.
3694         (KJS::JSValue::deleteProperty): Ditto.
3695
3696         * kjs/property_slot.cpp:
3697         (KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
3698         (KJS::PropertySlot::ungettableGetter): Ditto.
3699         (KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
3700         as the "this" object, which will be set to the original object by the new
3701         PropertySlot initialization code. Also call toThisObject. The old code did
3702         not do this, but needed to so we can properly handle the activation object
3703         like the other similar code paths.
3704
3705         * kjs/property_slot.h:
3706         (KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
3707         object. In debug builds, set the base to 0 if you don't pass one.
3708         (KJS::PropertySlot::getValue): Don't take or pass the originalObject.
3709         (KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
3710         base object in debug builds.
3711         (KJS::PropertySlot::setGetterSlot): Ditto.
3712         (KJS::PropertySlot::setUndefined): Ditto.
3713         (KJS::PropertySlot::setUngettable): Ditto.
3714         (KJS::PropertySlot::slotBase): Assert that a base object is present.
3715         This will fire if someone actually calls the get function without having
3716         passed in a base object and the getter needs it.
3717         (KJS::PropertySlot::setBase): Added. Used by the code that implements
3718         toObject so it can supply the original object after the fact.
3719         (KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
3720         code because it's an error to fetch the base if you don't have a guarantee
3721         it was set.
3722
3723         * API/JSCallbackObject.h:
3724         * API/JSCallbackObjectFunctions.h:
3725         (KJS::JSCallbackObject::cachedValueGetter):
3726         (KJS::JSCallbackObject::staticValueGetter):
3727         (KJS::JSCallbackObject::staticFunctionGetter):
3728         (KJS::JSCallbackObject::callbackGetter):
3729         * kjs/JSActivation.cpp:
3730         (KJS::JSActivation::getOwnPropertySlot):
3731         (KJS::JSActivation::argumentsGetter):
3732         * kjs/JSActivation.h:
3733         * kjs/JSVariableObject.h:
3734         (KJS::JSVariableObject::symbolTableGet):
3735         * kjs/array_instance.h:
3736         * kjs/function.cpp:
3737         (KJS::FunctionImp::argumentsGetter):
3738         (KJS::FunctionImp::callerGetter):
3739         (KJS::FunctionImp::lengthGetter):
3740         (KJS::Arguments::mappedIndexGetter):
3741         * kjs/function.h:
3742         * kjs/lookup.h:
3743         (KJS::staticFunctionGetter):
3744         (KJS::staticValueGetter):
3745         * kjs/string_object.cpp:
3746         (KJS::StringInstance::lengthGetter):
3747         (KJS::StringInstance::indexGetter):
3748         (KJS::stringInstanceNumericPropertyGetter):
3749         * kjs/string_object.h:
3750         Removed originalObject arguments from getters. Don't pass base values to
3751         the various PropertySlot functions that no longer take them.
3752
3753         * kjs/value.cpp:
3754         (KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
3755         This function has to always return true, because the caller can't walk the prototype
3756         chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
3757         for the caller. This is private, only called by getOwnPropertySlotInternal.
3758         (KJS::JSCell::put): Added. Calls toObject and then put.
3759         (KJS::JSCell::toThisObject): Added. Calls toObject.
3760
3761         * kjs/value.h: Added get, put, and toThisObject to both JSValue
3762         and JSCell. These take care of the toObject operation without an additional virtual
3763         function call, and so make the common "already an object" case faster.
3764
3765         * wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
3766         better place later, or rename this header.
3767
3768 2008-06-03  Oliver Hunt  <oliver@apple.com>
3769
3770         Reviewed by Tim.
3771
3772         Bug 12983: Web Inspector break on the debugger keyword
3773         <https://bugs.webkit.org/show_bug.cgi?id=12983>
3774
3775         Added a DebuggerStatementNode to handle codegen, and added a new
3776         DidReachBreakPoint debug event (which will hopefully be useful
3777         if we ever move breakpoint management into JSC proper).  Also
3778         added didReachBreakpoint to Debugger to allow us to actually respond
3779         to this event.
3780
3781         * VM/CodeBlock.cpp:
3782         (KJS::debugHookName):
3783         * VM/Machine.cpp:
3784         (KJS::Machine::debug):
3785         * VM/Machine.h:
3786         * kjs/debugger.h:
3787         * kjs/grammar.y:
3788         * kjs/nodes.cpp:
3789         (KJS::DebuggerStatementNode::emitCode):
3790         (KJS::DebuggerStatementNode::execute):
3791         * kjs/nodes.h:
3792         (KJS::DebuggerStatementNode::):
3793         * kjs/nodes2string.cpp:
3794         (KJS::DebuggerStatementNode::streamTo):
3795
3796 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
3797
3798         Reviewed by Oliver.
3799         
3800         - document remaining opcodes.
3801
3802         * VM/Machine.cpp:
3803         (KJS::Machine::privateExecute): Document call, call_eval,
3804         construct, ret and end opcodes.
3805
3806 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
3807
3808         Reviewed by Oliver.
3809
3810         * VM/Machine.cpp:
3811         (KJS::Machine::privateExecute): Document throw and catch opcodes.
3812
3813 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3814
3815         Reviewed by Alexey Proskuryakov.
3816
3817         Removed JSObject::call, since it just called JSObject::callAsFunction.
3818
3819         SunSpider reports no change.
3820
3821 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3822
3823         Reviewed by Darin Adler.
3824         
3825         A little cleanup in the CodeGenerator.
3826
3827         * VM/CodeGenerator.cpp: A few changes here.
3828
3829         (1) Removed remaining cases of the old hack of putting "this" into the
3830         symbol table; replaced with explicit tracking of m_thisRegister.
3831
3832         (2) Made m_thisRegister behave the same for function, eval, and program
3833         code, removing the static programCodeThis() function.
3834
3835         (3) Added a feature to nix a ScopeNode's declaration stacks when done
3836         compiling, to save memory.
3837
3838         (4) Removed code that copied eval declarations into special vectors: we
3839         just use the originals in the ScopeNode now.
3840         
3841         * VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
3842         constructor: we just use get that data from the ScopeNode now.
3843
3844         * VM/Machine.cpp:
3845         (KJS::Machine::execute): When executing an eval node, don't iterate a
3846         special copy of its declarations; iterate the originals, instead.
3847
3848         * kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
3849         away into the CodeGenerator. Nodes no longer call shrinkCapacity on
3850         their data directly.
3851         
3852         * kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
3853         data stays around even after we've thrown away the AST, unless we explicitly
3854         throw away the declaration data, too. This is useful for eval code, which
3855         needs to reference its declaration data at execution time. (Soon, it will
3856         be useful for program code, too, since program code should do the same.)
3857
3858 2008-06-02  Adam Roben  <aroben@apple.com>
3859
3860         Build fix for non-AllInOne builds
3861
3862         * kjs/array_object.cpp: Added a missing #include.
3863
3864 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
3865
3866         Took out accidental confilct lines I checked in.
3867
3868         * ChangeLog:
3869
3870 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
3871
3872         Reviewed by Darin.
3873
3874         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3875         profiler
3876         Implement Next Sibling pointers as groundwork for removing the recursion
3877         limit in the profiler.
3878
3879         * profiler/ProfileNode.cpp: Also I renamed parentNode and headNode since
3880         'node' is redundant.
3881         (KJS::ProfileNode::ProfileNode): Initialize the nextSibling.
3882         (KJS::ProfileNode::willExecute): If there are already children then the
3883         new child needs to be the nextSibling of the last child.
3884         (KJS::ProfileNode::didExecute):
3885         (KJS::ProfileNode::addChild): Ditto.
3886         (KJS::ProfileNode::stopProfiling):
3887         (KJS::ProfileNode::sortTotalTimeDescending): For all of the sorting
3888         algorithms once the children are sorted their nextSibling pointers need
3889         to be reset to reflect the new order.
3890         (KJS::ProfileNode::sortTotalTimeAscending):
3891         (KJS::ProfileNode::sortSelfTimeDescending):
3892         (KJS::ProfileNode::sortSelfTimeAscending):
3893         (KJS::ProfileNode::sortCallsDescending):
3894         (KJS::ProfileNode::sortCallsAscending):
3895         (KJS::ProfileNode::sortFunctionNameDescending):
3896         (KJS::ProfileNode::sortFunctionNameAscending):
3897         (KJS::ProfileNode::resetChildrensSiblings): This new function simply
3898         loops over all of the children and sets their nextSibling pointers to
3899         the next child in the Vector
3900         (KJS::ProfileNode::debugPrintData):
3901         * profiler/ProfileNode.h:
3902         (KJS::ProfileNode::parent):
3903         (KJS::ProfileNode::setParent):
3904         (KJS::ProfileNode::nextSibling):
3905         (KJS::ProfileNode::setNextSibling):
3906         (KJS::ProfileNode::totalPercent):
3907         (KJS::ProfileNode::selfPercent):
3908
3909 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3910
3911         Reviewed by Maciej Stachowiak.
3912
3913         Removed the recursion limit from JSObject::call, since the VM does
3914         recursion checking now.
3915
3916         This should allow us to remove JSObject::call entirely, netting a small
3917         speedup.
3918
3919         * kjs/object.cpp:
3920         (KJS::JSObject::call):
3921
3922 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3923
3924         Reviewed by Adele Peterson.
3925
3926         Added a specific affordance for avoiding stack overflow when converting
3927         recursive arrays to string, in preparation for removing generic stack
3928         overflow checking from JSObject::call.
3929         
3930         Tested by fast/js/toString-stack-overflow.html.
3931
3932 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3933
3934         Reviewed by Alice Liu.
3935         
3936         Refactored some hand-rolled code to call ScopeChain::globalObject instead.
3937
3938 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3939
3940         Reviewed by Darin Adler.
3941         
3942         Fixed ASSERT due to execution continuing after an exception is thrown
3943         during array sort.
3944
3945         * kjs/array_instance.cpp:
3946         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): Don't call the
3947         custom comparator function if an exception has been thrown. Just return
3948         1 for everything, so the sort completes quickly. (The result will be
3949         thrown away.)
3950
3951 2008-05-30  Timothy Hatcher  <timothy@apple.com>
3952
3953         Made the starting line number of scripts be 1-based throughout the engine.
3954         This cleans up script line numbers so they are all consistent now and fixes
3955         some cases where script execution was shown as off by one line in the debugger.
3956
3957         No change in SunSpider.
3958
3959         Reviewed by Oliver Hunt.
3960
3961         * API/minidom.c:
3962         (main): Pass a line number of 1 instead of 0 to parser().parse().
3963         * API/testapi.c:
3964         (main): Ditto. And removes a FIXME and changed an assertEqualsAsNumber
3965         to use 1 instead of 2 for the line number.
3966         * VM/Machine.cpp:
3967         (KJS::callEval): Pass a line number of 1 instead of 0.
3968         (KJS::Machine::debug): Use firstLine for WillExecuteProgram instead of
3969         lastLine. Use lastLine for DidExecuteProgram instead of firstLine.
3970         * kjs/DebuggerCallFrame.cpp:
3971         (KJS::DebuggerCallFrame::evaluate): Pass a line number of 1 instead of
3972         0 to parser().parse().
3973         * kjs/Parser.cpp:
3974         (KJS::Parser::parse): ASSERT startingLineNumber is greatter than 0. Change
3975         the startingLineNumber to be 1 if it was less than or equal to 0. This is needed
3976         for release builds to maintain compatibility with the JavaScriptCore API.
3977         * kjs/function.cpp:
3978         (KJS::globalFuncEval): Pass a line number of 1 instead of 0 to parser().parse().
3979         * kjs/function_object.cpp:
3980         (FunctionObjectImp::construct): Pass a line number of 1 instead of 0 to construct().
3981         * kjs/lexer.cpp:
3982         (Lexer::setCode): Made yylineno = startingLineNumber instead of adding 1.
3983         * kjs/testkjs.cpp:
3984         (functionRun): Pass a line number of 1 instead of 0 to Interpreter::evaluate().
3985         (functionLoad): Ditto.
3986         (prettyPrintScript): Ditto.
3987         (runWithScripts): Ditto.
3988         * profiler/Profiler.cpp:
3989         (WebCore::createCallIdentifier): Removed a plus 1 of startingLineNumber.
3990
3991 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
3992
3993         Reviewed by Darin.
3994
3995         https://bugs.webkit.org/show_bug.cgi?id=19180
3996         speed up SunSpider by optimizing immediate number cases
3997
3998         Also fixed a JavaScriptCore regression seen on PowerPC - we didn't clip left shift
3999         parameter to 0...31.
4000
4001         0.5% improvement on SunSpider overall, although a 8.5 regression on bitops-3bit-bits-in-byte.
4002
4003         * VM/Machine.cpp:
4004         (KJS::Machine::privateExecute):
4005
4006         * kjs/JSImmediate.h:
4007         (KJS::JSImmediate::toTruncatedUInt32): Added. Same as getTruncatedInt32, but casts the result
4008         to unsigned.
4009
4010 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
4011
4012         Reviewed by Oliver Hunt.
4013
4014         https://bugs.webkit.org/show_bug.cgi?id=19180
4015         speed up SunSpider by optimizing immediate number cases
4016
4017         Also fixed two JavaScriptCore regressions seen on PowerPC - we didn't clip right shift
4018         parameter to 0...31.
4019
4020         1.6% improvement on SunSpider, without significant regressions on any tests.
4021
4022         * VM/Machine.cpp:
4023         (KJS::Machine::privateExecute):
4024         Added fast paths for >>, ==, ===, !=, !==. Changed order of memory accesses in many
4025         cases, making them less dependent on gcc's ability to properly assign registers. With this,
4026         I could move exception checks back into slow code paths, and saw less randomness in general.
4027
4028         * kjs/JSImmediate.h:
4029         (KJS::JSImmediate::rightShiftImmediateNumbers):
4030         Added.
4031
4032 2008-05-29  Maciej Stachowiak  <mjs@apple.com>
4033
4034         Reviewed by Oliver.
4035
4036         - fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com
4037         
4038         Finally blocks could clobber registers that had to remain live
4039         until they returned. This patch takes a conservative approach and
4040         makes sure that finally blocks do not reuse any registers that
4041         were previously allocated for the function. In the future this
4042         could probably be tightened up to be less profligate with the
4043         register allocation.
4044         
4045         * VM/CodeGenerator.cpp:
4046         (KJS::CodeGenerator::highestUsedRegister):
4047         * VM/CodeGenerator.h:
4048         * kjs/nodes.cpp:
4049         (KJS::TryNode::emitCode):
4050
4051 2008-05-29  Steve Falkenburg  <sfalken@apple.com>
4052
4053         Build fix.
4054
4055         * kjs/array_instance.cpp:
4056
4057 2008-05-29  Alexey Proskuryakov  <ap@webkit.org>
4058
4059         Reviewed by Darin.
4060
4061         https://bugs.webkit.org/show_bug.cgi?id=19294
4062         <rdar://problem/5969062> A crash when iterating over a sparse array backwards.
4063
4064         * kjs/array_instance.cpp: Turned sparseArrayCutoff into a macro, so that using max() on it
4065         doesn't cause a PIC branch.
4066         (KJS::ArrayInstance::increaseVectorLength): Added a comment about this function not
4067         preserving class invariants.
4068         (KJS::ArrayInstance::put): Update m_storage after reallocation. Move values that fit to
4069         the vector from the map in all code paths.
4070
4071 2008-05-29  Thiago Macieira  <tjmaciei@trolltech.com>
4072
4073         Reviewed by Simon.
4074
4075         Fix compilation in Solaris with Sun CC
4076
4077         Lots of WebKit code uses C99 functions that, strict as it
4078         is, the Solaris system doesn't provide in C++. So we must define them
4079         for both GCC and the Sun CC.
4080
4081         * wtf/MathExtras.h:
4082
4083 2008-05-28  Oliver Hunt  <oliver@apple.com>
4084
4085         Reviewed by Anders.
4086
4087         Fix codegen for assignment being used as a function.
4088
4089         FunctionCallValueNode::emitCode failed to account for the
4090         potential of the function expression to allocate arbitrary
4091         registers.
4092
4093         * kjs/nodes.cpp:
4094         (KJS::FunctionCallValueNode::emitCode):
4095
4096 2008-05-27  Geoffrey Garen  <ggaren@apple.com>
4097
4098         Reviewed by Tim Hatcher.
4099
4100         Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
4101         REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
4102         clicking button in returnEvent-crash.html
4103
4104         Added two new debugger hooks, willExecuteProgram and didExecuteProgram,
4105         along with code to generate them, code to invoke them when unwinding
4106         due to an exception, and code to dump them.
4107         
4108         SunSpider reports no change.
4109
4110         * VM/CodeBlock.cpp:
4111         (KJS::debugHookName): I had to mark this function NEVER_INLINE to avoid
4112         a .4% performance regression. The mind boggles.
4113
4114 2008-05-28  Adam Roben  <aroben@apple.com>
4115
4116         Fix JavaScriptCore tests on OS X
4117
4118         We were quoting the path to testkjs too late, after it had already
4119         been combined with spaces and other options.
4120
4121         * tests/mozilla/jsDriver.pl:
4122         (top level): Move path quoting from here...
4123         (sub get_kjs_engine_command): ...to here.
4124
4125 2008-05-28  Anders Carlsson  <andersca@apple.com>
4126
4127         Reviewed by Oliver.
4128
4129         <rdar://problem/5968071> "const f" crashes in JavaScriptCore
4130         
4131         Make sure to null check the initializer.
4132         
4133         * kjs/nodes.cpp:
4134         (KJS::ConstDeclNode::emitCodeSingle):
4135
4136 2008-05-28  Adam Roben  <aroben@apple.com>
4137
4138         Make run-javascriptcore-tests work with a space in the path to testkjs
4139
4140         Reviewed by Alexey Proskuryakov.
4141
4142         * tests/mozilla/jsDriver.pl: Quote the path to the engine s