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