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