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