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