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