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