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