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