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