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