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