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