Reviewed by Sam.
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
2
3         Reviewed by Sam.
4
5         Fix an assertion failure at startup.
6
7         * kjs/JSObject.h: (KJS::JSObject::JSObject): Allow jsNull prototype in an assertion (I had
8         it fixed in a wrong copy of the file, so I wasn't getting the failure).
9
10 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
11
12         Build fix.
13
14         * kjs/collector.cpp:
15         (KJS::Heap::Heap):
16         (KJS::allocateBlock):
17         * kjs/collector.h:
18         No, #if PLATFORM(UNIX) was not right. I've just moved the unsafe initialization back for now,
19         as the platforms that use that code path do not use multiple threads yet.
20
21 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
22
23         Windows and Qt build fixes.
24
25         * kjs/collector.h: 
26         * kjs/collector.cpp:
27         (KJS::Heap::Heap):
28         Wrapped m_pagesize in #if PLATFORM(UNIX), which should better match the sequence of #elifs
29         in allocateBlock(). Changed MIN_ARRAY_SIZE to be explicitly size_t, as this type is different
30         on different platforms.
31
32 2008-06-17  Alexey Proskuryakov  <ap@webkit.org>
33
34         Reviewed by Darin.
35
36         Prepare JavaScript heap for being per-thread.
37
38         * kjs/ExecState.h: Shuffle includes, making it possible to include ExecState.h in JSValue.h.
39         (KJS::ExecState::heap): Added an accessor.
40
41         * API/JSBase.cpp: (JSGarbageCollect): Collect both shared and per-thread heaps.
42
43         * API/JSContextRef.cpp: (JSGlobalContextCreate): When allocating JSGlobalObject, indicate
44         that it belongs to a shared heap.
45
46         * JavaScriptCore.xcodeproj/project.pbxproj:
47         * kjs/AllInOneFile.cpp:
48         Moved JSGlobalObject.cpp to AllInOneFile, as a build fix for inlineAllocate magic.
49
50         * VM/CodeGenerator.h: (KJS::CodeGenerator::globalExec): Added an accessor (working via
51         m_scopeChain).
52
53         * VM/RegisterFile.h:
54         (KJS::RegisterFile::mark):
55         * VM/RegisterFileStack.h:
56         (KJS::RegisterFileStack::mark):
57         Made these pseudo-mark functions take Heap*.
58
59         * kjs/InitializeThreading.cpp:
60         (KJS::initializeThreading): Initialize heap introspector.
61
62         * kjs/JSGlobalData.h: Added Heap to the structure.
63
64         * kjs/JSGlobalData.cpp:
65         (KJS::JSGlobalData::JSGlobalData): Initialize Heap.
66         (KJS::JSGlobalData::sharedInstance): Added a method to access shared global data instance
67         for legacy clients.
68
69         * kjs/JSGlobalObject.cpp:
70         (KJS::JSGlobalObject::~JSGlobalObject): Changed to work with per-thread head; fixed list
71         maintenance logic.
72         (KJS::JSGlobalObject::init): Changed to work with per-thread head.
73         (KJS::JSGlobalObject::put): Assert that a cross-heap operation is not being attempted.
74         (KJS::JSGlobalObject::reset): Pass ExecState* where now required.
75         (KJS::JSGlobalObject::mark): Pass the current heap to RegisterFileStack::mark.
76         (KJS::JSGlobalObject::operator new): Overload operator new to use per-thread or shared heap.
77         * kjs/JSGlobalObject.h: Removed static s_head member.
78
79         * kjs/PropertyMap.h: (KJS::PropertyMap::PropertyMap): Removed unused SavedProperty.
80
81         * kjs/collector.h: Turned Collector into an actual object with its own data, renamed to Heap.
82         (KJS::Heap::initializeHeapIntrospector): Added.
83         (KJS::Heap::heap): Added a method to determine which heap a JSValue is in, if any.
84         (KJS::Heap::allocate): Made non-static.
85         (KJS::Heap::inlineAllocateNumber): Ditto.
86         (KJS::Heap::markListSet): Ditto.
87         (KJS::Heap::cellBlock): Ditto.
88         (KJS::Heap::cellOffset): Ditto.
89         (KJS::Heap::isCellMarked): Ditto.
90         (KJS::Heap::markCell): Ditto.
91         (KJS::Heap::reportExtraMemoryCost): Ditto.
92         (KJS::CollectorBlock): Added a back-reference to Heap for Heap::heap() method.
93         (KJS::SmallCellCollectorBlock): Ditto.
94
95         * kjs/collector.cpp: Changed MIN_ARRAY_SIZE to a #define to avoid a PIC branch. Removed
96         main thread related machinery.
97         (KJS::Heap::Heap): Initialize the newly added data members.
98         (KJS::allocateBlock): Marked NEVER_INLINE, as this is a rare case that uses a PIC branch.
99         Moved static pagesize to the class to make it safely initialized.
100         (KJS::Heap::heapAllocate): Initialize heap back reference after a new block is allocated.
101         (KJS::Heap::registerThread): Removed introspector initialization, as it is now performed
102         in InitializeThreading.cpp.
103         (KJS::Heap::markOtherThreadConservatively): Assert that the "other thread" case only occurs
104         for legacy clients using a shared heap.
105         (KJS::Heap::markStackObjectsConservatively): Moved fastMallocForbid/Allow down here, since
106         it doesn't need to be forbidden during other GC phases.
107
108         * kjs/JSImmediate.h:
109         (KJS::jsUndefined):
110         (KJS::jsNull):
111         (KJS::jsBoolean):
112         Moved from JSvalue.h, to make these usable in files that cannot include JSValue.h (such
113         as list.h).
114
115         * API/JSCallbackObjectFunctions.h:
116         (KJS::::staticFunctionGetter):
117         * API/JSClassRef.cpp:
118         (OpaqueJSClass::prototype):
119         * API/JSObjectRef.cpp:
120         (JSObjectMake):
121         (JSObjectMakeFunctionWithCallback):
122         (JSObjectMakeConstructor):
123         (JSObjectMakeFunction):
124         * API/JSValueRef.cpp:
125         (JSValueMakeNumber):
126         (JSValueMakeString):
127         * JavaScriptCore.exp:
128         * VM/CodeGenerator.cpp:
129         (KJS::CodeGenerator::emitLoad):
130         * VM/JSPropertyNameIterator.cpp:
131         (KJS::JSPropertyNameIterator::create):
132         (KJS::JSPropertyNameIterator::next):
133         * VM/Machine.cpp:
134         (KJS::jsAddSlowCase):
135         (KJS::jsAdd):
136         (KJS::jsTypeStringForValue):
137         (KJS::scopeChainForCall):
138         (KJS::Machine::throwException):
139         (KJS::Machine::execute):
140         (KJS::Machine::privateExecute):
141         (KJS::Machine::retrieveArguments):
142         * kjs/ArrayPrototype.cpp:
143         (KJS::arrayProtoFuncToString):
144         (KJS::arrayProtoFuncToLocaleString):
145         (KJS::arrayProtoFuncJoin):
146         (KJS::arrayProtoFuncConcat):
147         (KJS::arrayProtoFuncPop):
148         (KJS::arrayProtoFuncPush):
149         (KJS::arrayProtoFuncShift):
150         (KJS::arrayProtoFuncSlice):
151         (KJS::arrayProtoFuncSplice):
152         (KJS::arrayProtoFuncUnShift):
153         (KJS::arrayProtoFuncFilter):
154         (KJS::arrayProtoFuncMap):
155         (KJS::arrayProtoFuncEvery):
156         (KJS::arrayProtoFuncForEach):
157         (KJS::arrayProtoFuncSome):
158         (KJS::arrayProtoFuncIndexOf):
159         (KJS::arrayProtoFuncLastIndexOf):
160         (KJS::ArrayConstructor::ArrayConstructor):
161         (KJS::ArrayConstructor::construct):
162         (KJS::ArrayConstructor::callAsFunction):
163         * kjs/BooleanObject.cpp:
164         (KJS::BooleanPrototype::BooleanPrototype):
165         (KJS::booleanProtoFuncToString):
166         (KJS::BooleanConstructor::BooleanConstructor):
167         (KJS::BooleanConstructor::construct):
168         * kjs/FunctionPrototype.cpp:
169         (KJS::FunctionPrototype::FunctionPrototype):
170         (KJS::functionProtoFuncToString):
171         (KJS::FunctionConstructor::FunctionConstructor):
172         (KJS::FunctionConstructor::construct):
173         * kjs/JSActivation.cpp:
174         (KJS::JSActivation::createArgumentsObject):
175         * kjs/JSArray.cpp:
176         (KJS::JSArray::JSArray):
177         (KJS::JSArray::lengthGetter):
178         * kjs/JSFunction.cpp:
179         (KJS::JSFunction::lengthGetter):
180         (KJS::JSFunction::construct):
181         (KJS::Arguments::Arguments):
182         (KJS::encode):
183         (KJS::decode):
184         (KJS::globalFuncParseInt):
185         (KJS::globalFuncParseFloat):
186         (KJS::globalFuncEscape):
187         (KJS::globalFuncUnescape):
188         (KJS::PrototypeFunction::PrototypeFunction):
189         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
190         * kjs/JSImmediate.cpp:
191         (KJS::JSImmediate::toObject):
192         * kjs/JSLock.cpp:
193         (KJS::JSLock::registerThread):
194         * kjs/JSObject.cpp:
195         (KJS::JSObject::put):
196         (KJS::JSObject::defineGetter):
197         (KJS::JSObject::defineSetter):
198         (KJS::Error::create):
199         * kjs/JSObject.h:
200         (KJS::JSObject::putDirect):
201         * kjs/JSString.h:
202         (KJS::JSString::JSString):
203         * kjs/JSValue.cpp:
204         (KJS::JSCell::operator new):
205         (KJS::jsString):
206         (KJS::jsOwnedString):
207         * kjs/JSValue.h:
208         (KJS::JSNumberCell::operator new):
209         (KJS::jsNumberCell):
210         (KJS::jsNaN):
211         (KJS::jsNumber):
212         (KJS::JSCell::marked):
213         (KJS::JSCell::mark):
214         (KJS::JSValue::toJSNumber):
215         * kjs/MathObject.cpp:
216         (KJS::MathObject::getValueProperty):
217         (KJS::mathProtoFuncAbs):
218         (KJS::mathProtoFuncACos):
219         (KJS::mathProtoFuncASin):
220         (KJS::mathProtoFuncATan):
221         (KJS::mathProtoFuncATan2):
222         (KJS::mathProtoFuncCeil):
223         (KJS::mathProtoFuncCos):
224         (KJS::mathProtoFuncExp):
225         (KJS::mathProtoFuncFloor):
226         (KJS::mathProtoFuncLog):
227         (KJS::mathProtoFuncMax):
228         (KJS::mathProtoFuncMin):
229         (KJS::mathProtoFuncPow):
230         (KJS::mathProtoFuncRandom):
231         (KJS::mathProtoFuncRound):
232         (KJS::mathProtoFuncSin):
233         (KJS::mathProtoFuncSqrt):
234         (KJS::mathProtoFuncTan):
235         * kjs/NumberObject.cpp:
236         (KJS::NumberPrototype::NumberPrototype):
237         (KJS::numberProtoFuncToString):
238         (KJS::numberProtoFuncToLocaleString):
239         (KJS::numberProtoFuncToFixed):
240         (KJS::numberProtoFuncToExponential):
241         (KJS::numberProtoFuncToPrecision):
242         (KJS::NumberConstructor::NumberConstructor):
243         (KJS::NumberConstructor::getValueProperty):
244         (KJS::NumberConstructor::construct):
245         (KJS::NumberConstructor::callAsFunction):
246         * kjs/RegExpObject.cpp:
247         (KJS::RegExpPrototype::RegExpPrototype):
248         (KJS::regExpProtoFuncToString):
249         (KJS::RegExpObject::getValueProperty):
250         (KJS::RegExpConstructor::RegExpConstructor):
251         (KJS::RegExpMatchesArray::fillArrayInstance):
252         (KJS::RegExpConstructor::arrayOfMatches):
253         (KJS::RegExpConstructor::getBackref):
254         (KJS::RegExpConstructor::getLastParen):
255         (KJS::RegExpConstructor::getLeftContext):
256         (KJS::RegExpConstructor::getRightContext):
257         (KJS::RegExpConstructor::getValueProperty):
258         (KJS::RegExpConstructor::construct):
259         * kjs/RegExpObject.h:
260         * kjs/Shell.cpp:
261         (GlobalObject::GlobalObject):
262         (functionGC):
263         (functionRun):
264         (functionReadline):
265         (jscmain):
266         * kjs/date_object.cpp:
267         (KJS::formatLocaleDate):
268         (KJS::DatePrototype::DatePrototype):
269         (KJS::DateConstructor::DateConstructor):
270         (KJS::DateConstructor::construct):
271         (KJS::DateConstructor::callAsFunction):
272         (KJS::DateFunction::DateFunction):
273         (KJS::DateFunction::callAsFunction):
274         (KJS::dateProtoFuncToString):
275         (KJS::dateProtoFuncToUTCString):
276         (KJS::dateProtoFuncToDateString):
277         (KJS::dateProtoFuncToTimeString):
278         (KJS::dateProtoFuncToLocaleString):
279         (KJS::dateProtoFuncToLocaleDateString):
280         (KJS::dateProtoFuncToLocaleTimeString):
281         (KJS::dateProtoFuncValueOf):
282         (KJS::dateProtoFuncGetTime):
283         (KJS::dateProtoFuncGetFullYear):
284         (KJS::dateProtoFuncGetUTCFullYear):
285         (KJS::dateProtoFuncToGMTString):
286         (KJS::dateProtoFuncGetMonth):
287         (KJS::dateProtoFuncGetUTCMonth):
288         (KJS::dateProtoFuncGetDate):
289         (KJS::dateProtoFuncGetUTCDate):
290         (KJS::dateProtoFuncGetDay):
291         (KJS::dateProtoFuncGetUTCDay):
292         (KJS::dateProtoFuncGetHours):
293         (KJS::dateProtoFuncGetUTCHours):
294         (KJS::dateProtoFuncGetMinutes):
295         (KJS::dateProtoFuncGetUTCMinutes):
296         (KJS::dateProtoFuncGetSeconds):
297         (KJS::dateProtoFuncGetUTCSeconds):
298         (KJS::dateProtoFuncGetMilliSeconds):
299         (KJS::dateProtoFuncGetUTCMilliseconds):
300         (KJS::dateProtoFuncGetTimezoneOffset):
301         (KJS::dateProtoFuncSetTime):
302         (KJS::setNewValueFromTimeArgs):
303         (KJS::setNewValueFromDateArgs):
304         (KJS::dateProtoFuncSetYear):
305         (KJS::dateProtoFuncGetYear):
306         * kjs/error_object.cpp:
307         (KJS::ErrorPrototype::ErrorPrototype):
308         (KJS::errorProtoFuncToString):
309         (KJS::ErrorConstructor::ErrorConstructor):
310         (KJS::ErrorConstructor::construct):
311         (KJS::NativeErrorPrototype::NativeErrorPrototype):
312         (KJS::NativeErrorConstructor::NativeErrorConstructor):
313         (KJS::NativeErrorConstructor::construct):
314         * kjs/identifier.h:
315         * kjs/internal.cpp:
316         (KJS::StringObject::create):
317         (KJS::JSString::lengthGetter):
318         (KJS::JSString::indexGetter):
319         (KJS::JSString::indexNumericPropertyGetter):
320         * kjs/interpreter.cpp:
321         * kjs/list.cpp:
322         (KJS::ArgList::slowAppend):
323         * kjs/list.h:
324         * kjs/lookup.h:
325         (KJS::staticFunctionGetter):
326         (KJS::cacheGlobalObject):
327         * kjs/nodes.cpp:
328         (KJS::Node::emitThrowError):
329         (KJS::StringNode::emitCode):
330         (KJS::ArrayNode::emitCode):
331         (KJS::FuncDeclNode::makeFunction):
332         (KJS::FuncExprNode::makeFunction):
333         * kjs/nodes.h:
334         * kjs/object_object.cpp:
335         (KJS::ObjectPrototype::ObjectPrototype):
336         (KJS::objectProtoFuncToLocaleString):
337         (KJS::objectProtoFuncToString):
338         (KJS::ObjectConstructor::ObjectConstructor):
339         (KJS::ObjectConstructor::construct):
340         * kjs/protect.h:
341         (KJS::gcProtect):
342         (KJS::gcUnprotect):
343         * kjs/string_object.cpp:
344         (KJS::StringObject::StringObject):
345         (KJS::StringPrototype::StringPrototype):
346         (KJS::replace):
347         (KJS::stringProtoFuncCharAt):
348         (KJS::stringProtoFuncCharCodeAt):
349         (KJS::stringProtoFuncConcat):
350         (KJS::stringProtoFuncIndexOf):
351         (KJS::stringProtoFuncLastIndexOf):
352         (KJS::stringProtoFuncMatch):
353         (KJS::stringProtoFuncSearch):
354         (KJS::stringProtoFuncReplace):
355         (KJS::stringProtoFuncSlice):
356         (KJS::stringProtoFuncSplit):
357         (KJS::stringProtoFuncSubstr):
358         (KJS::stringProtoFuncSubstring):
359         (KJS::stringProtoFuncToLowerCase):
360         (KJS::stringProtoFuncToUpperCase):
361         (KJS::stringProtoFuncToLocaleLowerCase):
362         (KJS::stringProtoFuncToLocaleUpperCase):
363         (KJS::stringProtoFuncLocaleCompare):
364         (KJS::stringProtoFuncBig):
365         (KJS::stringProtoFuncSmall):
366         (KJS::stringProtoFuncBlink):
367         (KJS::stringProtoFuncBold):
368         (KJS::stringProtoFuncFixed):
369         (KJS::stringProtoFuncItalics):
370         (KJS::stringProtoFuncStrike):
371         (KJS::stringProtoFuncSub):
372         (KJS::stringProtoFuncSup):
373         (KJS::stringProtoFuncFontcolor):
374         (KJS::stringProtoFuncFontsize):
375         (KJS::stringProtoFuncAnchor):
376         (KJS::stringProtoFuncLink):
377         (KJS::StringConstructor::StringConstructor):
378         (KJS::StringConstructor::construct):
379         (KJS::StringConstructor::callAsFunction):
380         (KJS::StringConstructorFunction::StringConstructorFunction):
381         (KJS::StringConstructorFunction::callAsFunction):
382         * kjs/string_object.h:
383         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
384         * kjs/ustring.h:
385         Updated for the above changes.
386
387 2008-06-17  Timothy Hatcher  <timothy@apple.com>
388
389         Added a type to DebuggerCallFrame so the under interface can
390         distinguish anonymous functions and program call frames.
391
392         https://bugs.webkit.org/show_bug.cgi?id=19585
393
394         Reviewed by Geoff Garen.
395
396         * JavaScriptCore.exp: Export the DebuggerCallFrame::type symbol.
397         * kjs/DebuggerCallFrame.cpp:
398         (KJS::DebuggerCallFrame::type): Added.
399         * kjs/DebuggerCallFrame.h:
400
401 2008-06-17  Eric Seidel  <eric@webkit.org>
402
403         Reviewed by Tim H.
404         
405         Remove bogus ASSERT which tripped every time for those who use PAC files.
406
407         * kjs/Parser.cpp:
408         (KJS::Parser::parse):
409
410 2008-06-17  Kevin McCullough  <kmccullough@apple.com>
411
412         Reviewed by Geoff.
413
414         <rdar://problem/5951534> JSProfiler: Don't profile console.profile()
415         or console.profileEnd()
416
417         * profiler/Profile.cpp:
418         (KJS::Profile::stopProfiling): Moved the creation of the (idle) node to
419         the Profile (not ProfileNode).  This makes sense since the Profile
420         should be the one to modify the profile tree.  Also each stopProfiling()
421         does not need to check if it's the head node anymore.  Also fixed an
422         oddity where I was using willExecute to create the node.
423         (KJS::Profile::removeProfileStart): Removes the call to console.profile
424         that started this profile.
425         (KJS::Profile::removeProfileEnd): Removes the call to console.profileEnd
426         that ended this profile.
427         * profiler/Profile.h:
428         * profiler/ProfileNode.cpp: Moved the creation of the (idle) node to
429         the Profile object.
430         (KJS::ProfileNode::stopProfiling):
431         * profiler/ProfileNode.h: Added some helper functions and whitespace to
432         facilitate readability and the removal of profile() and profileEnd()
433         from the Profile tree.
434         (KJS::CallIdentifier::operator const char* ):
435         (KJS::ProfileNode::firstChild):
436         (KJS::ProfileNode::lastChild):
437         (KJS::ProfileNode::removeChild):
438         (KJS::ProfileNode::toString):
439
440 2008-06-17  Ariya Hidayat  <ariya.hidayat@trolltech.com>
441
442         Rubber stamped by Adam Roben.
443
444         Include JSGlobalObject.h to fix the build.
445
446         * kjs/ScopeChain.cpp:
447
448 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
449
450         Reviewed by Oliver.
451
452         Reduce code duplication in emitReadModifyAssignment().
453
454         * kjs/nodes.cpp:
455         (KJS::emitReadModifyAssignment):
456
457 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
458
459         Reviewed by Oliver.
460
461         Sort includes alphabetically.
462
463         * kjs/nodes.cpp:
464
465 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
466
467         Reviewed by Maciej.
468
469         Bug 19596: LEAK: Gmail leaks SegmentedVector<RegisterID>
470         <https://bugs.webkit.org/show_bug.cgi?id=19596>
471
472         When growing SegmentedVector, we start adding segments at the position
473         of the last segment, overwriting it. The destructor frees allocated
474         segments starting at the segment of index 1, because the segment of
475         index 0 is assumed to be the initial inline segment. This causes a leak
476         of the segment that is referenced by index 0. Modifying grow() so that
477         it starts adding segments at the position after the last segment fixes
478         the leak.
479
480         Since the initial segment is a special case in the lookup code, this
481         bug never manifested itself via incorrect results.
482
483         * VM/SegmentedVector.h:
484         (KJS::SegmentedVector::grow):
485
486 2008-06-16  Maciej Stachowiak  <mjs@apple.com>
487
488         Reviewed by Alexey.
489         
490         - removed nearly unused types.h and LocalStorageEntry.h headers
491
492         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
493         * JavaScriptCore.xcodeproj/project.pbxproj:
494         * kjs/ExecState.h:
495         * kjs/LocalStorageEntry.h: Removed.
496         * kjs/RegExpObject.cpp:
497         * kjs/error_object.cpp:
498         * kjs/grammar.y:
499         * kjs/nodes.cpp:
500         * kjs/types.h: Removed.
501
502 2008-06-16  Alp Toker  <alp@nuanti.com>
503
504         Rubber-stamped by Geoff.
505
506         Change c++ to c in minidom and testapi emacs mode line comments.
507
508         * API/Node.h:
509         * API/NodeList.c:
510         * API/NodeList.h:
511         * API/testapi.c:
512
513 >>>>>>> .r34623
514 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
515
516         Trying to fix Windows build.
517
518         * kjs/PropertyNameArray.h:
519         * kjs/identifier.cpp:
520         Include ExecState.h
521
522 2008-06-16  Geoffrey Garen  <ggaren@apple.com>
523
524         Reviewed by Oliver Hunt.
525         
526         Slight cleanup to the SymbolTableEntry class.
527         
528         Renamed isEmpty to isNull, since we usually use "empty" to mean "holds
529         the valid, empty value", and "null" to mean "holds no value".
530         
531         Changed an "== 0" to a "!", to match our style guidelines.
532         
533         Added some ASSERTs to verify the (possibly questionable) assumption that
534         all register indexes will have their high two bits set. Also clarified a
535         comment to make that assumption clear.
536
537 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
538
539         Reviewed by Darin.
540
541         Initialize functionQueueMutex in a safe manner.
542
543         * wtf/MainThread.cpp:
544         (WTF::functionQueueMutex): Made it an AtomicallyInitializedStatic.
545
546         (WTF::dispatchFunctionsFromMainThread):
547         (WTF::setMainThreadCallbacksPaused):
548         Assert that the current thread is main, meaning that the callbacksPaused static can be
549         accessed.
550
551 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
552
553         Reviewed by Geoff Garen.
554
555         Make Identifier construction use an explicitly passed IdentifierTable.
556
557         No change on SunSpider total.
558
559         * API/JSCallbackObjectFunctions.h:
560         (KJS::::getOwnPropertySlot):
561         (KJS::::put):
562         (KJS::::deleteProperty):
563         (KJS::::getPropertyNames):
564         * API/JSObjectRef.cpp:
565         (JSObjectMakeFunctionWithCallback):
566         (JSObjectMakeFunction):
567         (JSObjectHasProperty):
568         (JSObjectGetProperty):
569         (JSObjectSetProperty):
570         (JSObjectDeleteProperty):
571         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
572         (JSObjectCopyPropertyNames):
573         * JavaScriptCore.exp:
574         * VM/CodeGenerator.cpp:
575         (KJS::CodeGenerator::CodeGenerator):
576         (KJS::CodeGenerator::registerForLocal):
577         (KJS::CodeGenerator::isLocal):
578         (KJS::CodeGenerator::addConstant):
579         (KJS::CodeGenerator::findScopedProperty):
580         * VM/CodeGenerator.h:
581         (KJS::CodeGenerator::globalData):
582         (KJS::CodeGenerator::propertyNames):
583         * VM/JSPropertyNameIterator.cpp:
584         (KJS::JSPropertyNameIterator::create):
585         * VM/Machine.cpp:
586         (KJS::Machine::throwException):
587         (KJS::Machine::privateExecute):
588         * kjs/ArrayPrototype.cpp:
589         (KJS::ArrayConstructor::ArrayConstructor):
590         * kjs/BooleanObject.cpp:
591         (KJS::BooleanConstructor::BooleanConstructor):
592         * kjs/FunctionPrototype.cpp:
593         (KJS::FunctionConstructor::FunctionConstructor):
594         (KJS::FunctionConstructor::construct):
595         * kjs/JSArray.cpp:
596         (KJS::JSArray::inlineGetOwnPropertySlot):
597         (KJS::JSArray::put):
598         (KJS::JSArray::deleteProperty):
599         (KJS::JSArray::getPropertyNames):
600         * kjs/JSFunction.cpp:
601         (KJS::Arguments::Arguments):
602         * kjs/JSGlobalData.cpp:
603         (KJS::JSGlobalData::JSGlobalData):
604         * kjs/JSGlobalObject.cpp:
605         (KJS::JSGlobalObject::reset):
606         * kjs/JSObject.cpp:
607         (KJS::JSObject::getOwnPropertySlot):
608         (KJS::JSObject::put):
609         (KJS::JSObject::putWithAttributes):
610         (KJS::JSObject::deleteProperty):
611         (KJS::JSObject::findPropertyHashEntry):
612         (KJS::JSObject::getPropertyNames):
613         (KJS::Error::create):
614         * kjs/JSVariableObject.cpp:
615         (KJS::JSVariableObject::getPropertyNames):
616         * kjs/NumberObject.cpp:
617         (KJS::NumberConstructor::NumberConstructor):
618         * kjs/PropertyNameArray.cpp:
619         (KJS::PropertyNameArray::add):
620         * kjs/PropertyNameArray.h:
621         (KJS::PropertyNameArray::PropertyNameArray):
622         (KJS::PropertyNameArray::addKnownUnique):
623         * kjs/PropertySlot.h:
624         (KJS::PropertySlot::getValue):
625         * kjs/RegExpObject.cpp:
626         (KJS::RegExpConstructor::RegExpConstructor):
627         * kjs/ScopeChain.cpp:
628         (KJS::ScopeChainNode::print):
629         * kjs/Shell.cpp:
630         (GlobalObject::GlobalObject):
631         * kjs/date_object.cpp:
632         (KJS::DateConstructor::DateConstructor):
633         * kjs/error_object.cpp:
634         (KJS::ErrorConstructor::ErrorConstructor):
635         (KJS::NativeErrorConstructor::NativeErrorConstructor):
636         * kjs/grammar.y:
637         * kjs/identifier.cpp:
638         (KJS::Identifier::add):
639         (KJS::Identifier::addSlowCase):
640         * kjs/identifier.h:
641         (KJS::Identifier::Identifier):
642         (KJS::Identifier::from):
643         (KJS::Identifier::equal):
644         (KJS::Identifier::add):
645         (KJS::operator==):
646         (KJS::operator!=):
647         * kjs/internal.cpp:
648         (KJS::JSString::getOwnPropertySlot):
649         * kjs/lexer.cpp:
650         (KJS::Lexer::Lexer):
651         (KJS::Lexer::lex):
652         (KJS::Lexer::makeIdentifier):
653         * kjs/lexer.h:
654         * kjs/lookup.cpp:
655         (KJS::HashTable::createTable):
656         * kjs/lookup.h:
657         (KJS::HashTable::initializeIfNeeded):
658         (KJS::HashTable::entry):
659         (KJS::getStaticPropertySlot):
660         (KJS::getStaticFunctionSlot):
661         (KJS::getStaticValueSlot):
662         (KJS::lookupPut):
663         * kjs/object_object.cpp:
664         (KJS::objectProtoFuncHasOwnProperty):
665         (KJS::objectProtoFuncDefineGetter):
666         (KJS::objectProtoFuncDefineSetter):
667         (KJS::objectProtoFuncLookupGetter):
668         (KJS::objectProtoFuncLookupSetter):
669         (KJS::objectProtoFuncPropertyIsEnumerable):
670         (KJS::ObjectConstructor::ObjectConstructor):
671         * kjs/string_object.cpp:
672         (KJS::StringObject::getOwnPropertySlot):
673         (KJS::StringObject::getPropertyNames):
674         (KJS::StringConstructor::StringConstructor):
675         Just pass ExecState or JSGlobalData everywhere. Identifier construction is now always
676         explicit.
677
678         * kjs/nodes.cpp: (KJS::RegExpNode::emitCode): Here, Identifier was created from a non-literal
679         char*, which was incorrect, as that uses the pointer value as a key.
680
681 2008-06-16  Thiago Macieira  <tjmaciei@trolltech.com>
682
683         Reviewed by Darin.
684
685         https://bugs.webkit.org/show_bug.cgi?id=19577
686
687         Fix compilation in C++ environments where C99 headers are not present
688
689         The stdbool.h header is a C99 feature, defining the "_Bool" type as well as the
690         "true" and "false" constants. But it's completely unnecessary in C++ as the
691         language already defines the "bool" type and its two values.
692
693         * API/JSBase.h:
694         * API/JSContextRef.h:
695         * API/JSObjectRef.h:
696         * API/JSStringRef.h:
697         * API/JSValueRef.h:
698
699 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
700
701         Reviewed by John.
702
703         <rdar://problem/6012509> JSProfiler: %s are incorrect if you exclude a
704         top level node like (idle)
705
706         * profiler/Profile.cpp:
707         (KJS::Profile::focus):
708         (KJS::Profile::exclude): Subtract the selfTime from the totalTime of the
709         head since its self time will only be non-zero when one of its children
710         were excluded. Since the head's totalTime is used to calculate %s when
711         its totalTime is the same as the sum of all its visible childrens' times
712         their %s will sum to 100%.
713
714 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
715
716         Reviewed by Sam Weinig.
717
718         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the profiler.
719
720         * profiler/Profile.cpp:
721         (KJS::Profile::willExecute):
722
723 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
724
725         Reviewed by Sam.
726
727         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
728         profiler.
729         - Remove the last of the uses of recursion in the profiler.
730
731         * JavaScriptCore.exp: Export the new function's signature.
732         * profiler/Profile.cpp: 
733         (KJS::calculateVisibleTotalTime): Added a new static method for
734         recalculating the visibleTotalTime of methods after focus has changed
735         which are visible.
736         (KJS::stopProfiling): 
737         (KJS::Profile::focus): Implemented focus without recursion.
738         * profiler/Profile.h: Moved implementation into the definition file.
739         * profiler/ProfileNode.cpp:
740         (KJS::ProfileNode::traverseNextNodePreOrder): Added an argument for
741         whether or not to process the children nodes, this allows focus to skip
742         sub trees which have been set as not visible.
743         (KJS::ProfileNode::calculateVisibleTotalTime): This function set's a
744         node's total visible time to the sum of its self time and its children's
745         total times.
746         (KJS::ProfileNode::focus): Implemented focus without recursion.
747         * profiler/ProfileNode.h:
748         (KJS::CallIdentifier::operator!= ):
749         (KJS::ProfileNode::setActualTotalTime): Expanded setting the total time
750         so that focus could modify only the visible total time.
751         (KJS::ProfileNode::setVisibleTotalTime):
752
753 2008-06-16  Christian Dywan  <christian@twotoasts.de>
754
755         Reviewed by Sam.
756
757         https://bugs.webkit.org/show_bug.cgi?id=19552
758         JavaScriptCore headers use C++ style comments
759
760         Replace all C++ style comments with C style multiline
761         comments and remove all "mode" lines.
762
763         * API/JSBase.h:
764         * API/JSClassRef.h:
765         * API/JSContextRef.h:
766         * API/JSObjectRef.h:
767         * API/JSStringRef.h:
768         * API/JSStringRefBSTR.h:
769         * API/JSStringRefCF.h:
770         * API/JSValueRef.h:
771         * API/JavaScript.h:
772         * API/JavaScriptCore.h:
773
774 2008-06-16  Christian Dywan  <christian@twotoasts.de>
775
776         Reviewed by Sam.
777
778         https://bugs.webkit.org/show_bug.cgi?id=19557
779         (JavaScriptCore) minidom uses C++ style comments
780
781         Use only C style comments in minidom sources
782
783         * API/JSNode.c:
784         (JSNode_appendChild):
785         (JSNode_removeChild):
786         * API/JSNode.h:
787         * API/JSNodeList.c:
788         (JSNodeList_getProperty):
789         * API/JSNodeList.h:
790         * API/Node.c:
791         * API/Node.h:
792         * API/NodeList.c:
793         (NodeList_new):
794         (NodeList_item):
795         * API/NodeList.h:
796         * API/minidom.c:
797         (createStringWithContentsOfFile):
798         * wtf/Assertions.h:
799         * wtf/UnusedParam.h:
800
801 2008-06-16  Adriaan de Groot  <groot@kde.org>
802
803         Reviewed by Simon.
804
805         Fix compilation on Solaris
806
807         On some systems, munmap takes a char* instead of a void* (contrary to POSIX and
808         Single Unix Specification). Since you can always convert from char* to void*
809         but not vice-versa, do the casting to char*.
810
811         * kjs/collector.cpp:
812         (KJS::allocateBlock):
813         (KJS::freeBlock):
814
815 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
816
817         Reviewed by Maciej.
818
819         Make a UnaryOpNode class to reduce boilerplate code for UnaryPlusNode,
820         NegateNode, BitwiseNotNode, and LogicalNotNode.
821
822         * VM/CodeGenerator.h:
823         (KJS::CodeGenerator::emitToJSNumber):
824         * kjs/nodes.cpp:
825         (KJS::UnaryOpNode::emitCode):
826         * kjs/nodes.h:
827         (KJS::UnaryOpNode::UnaryOpNode):
828         (KJS::UnaryPlusNode::):
829         (KJS::NegateNode::):
830         (KJS::NegateNode::precedence):
831         (KJS::BitwiseNotNode::):
832         (KJS::BitwiseNotNode::precedence):
833         (KJS::LogicalNotNode::):
834         (KJS::LogicalNotNode::precedence):
835
836 2008-06-16  Jan Michael Alonzo  <jmalonzo@webkit.org>
837
838         Gtk build fix
839
840         * GNUmakefile.am:
841
842 2008-06-15  Darin Adler  <darin@apple.com>
843
844         - rename KJS::List to KJS::ArgList
845
846         * API/JSCallbackConstructor.cpp:
847         (KJS::JSCallbackConstructor::construct):
848         * API/JSCallbackConstructor.h:
849         * API/JSCallbackFunction.cpp:
850         (KJS::JSCallbackFunction::callAsFunction):
851         * API/JSCallbackFunction.h:
852         * API/JSCallbackObject.h:
853         * API/JSCallbackObjectFunctions.h:
854         (KJS::::construct):
855         (KJS::::callAsFunction):
856         * API/JSObjectRef.cpp:
857         (JSObjectMakeFunction):
858         (JSObjectCallAsFunction):
859         (JSObjectCallAsConstructor):
860         * JavaScriptCore.exp:
861         * VM/Machine.cpp:
862         (KJS::Machine::execute):
863         (KJS::Machine::privateExecute):
864         * VM/Machine.h:
865         * kjs/ArrayPrototype.cpp:
866         (KJS::arrayProtoFuncToString):
867         (KJS::arrayProtoFuncToLocaleString):
868         (KJS::arrayProtoFuncJoin):
869         (KJS::arrayProtoFuncConcat):
870         (KJS::arrayProtoFuncPop):
871         (KJS::arrayProtoFuncPush):
872         (KJS::arrayProtoFuncReverse):
873         (KJS::arrayProtoFuncShift):
874         (KJS::arrayProtoFuncSlice):
875         (KJS::arrayProtoFuncSort):
876         (KJS::arrayProtoFuncSplice):
877         (KJS::arrayProtoFuncUnShift):
878         (KJS::arrayProtoFuncFilter):
879         (KJS::arrayProtoFuncMap):
880         (KJS::arrayProtoFuncEvery):
881         (KJS::arrayProtoFuncForEach):
882         (KJS::arrayProtoFuncSome):
883         (KJS::arrayProtoFuncIndexOf):
884         (KJS::arrayProtoFuncLastIndexOf):
885         (KJS::ArrayConstructor::construct):
886         (KJS::ArrayConstructor::callAsFunction):
887         * kjs/ArrayPrototype.h:
888         * kjs/BooleanObject.cpp:
889         (KJS::booleanProtoFuncToString):
890         (KJS::booleanProtoFuncValueOf):
891         (KJS::BooleanConstructor::construct):
892         (KJS::BooleanConstructor::callAsFunction):
893         * kjs/BooleanObject.h:
894         * kjs/CommonIdentifiers.h:
895         * kjs/ExecState.h:
896         (KJS::ExecState::emptyList):
897         * kjs/FunctionPrototype.cpp:
898         (KJS::FunctionPrototype::callAsFunction):
899         (KJS::functionProtoFuncToString):
900         (KJS::functionProtoFuncApply):
901         (KJS::functionProtoFuncCall):
902         (KJS::FunctionConstructor::construct):
903         (KJS::FunctionConstructor::callAsFunction):
904         * kjs/FunctionPrototype.h:
905         * kjs/JSActivation.cpp:
906         (KJS::JSActivation::createArgumentsObject):
907         * kjs/JSArray.cpp:
908         (KJS::JSArray::JSArray):
909         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
910         * kjs/JSArray.h:
911         * kjs/JSFunction.cpp:
912         (KJS::JSFunction::callAsFunction):
913         (KJS::JSFunction::construct):
914         (KJS::IndexToNameMap::IndexToNameMap):
915         (KJS::Arguments::Arguments):
916         (KJS::encode):
917         (KJS::decode):
918         (KJS::globalFuncEval):
919         (KJS::globalFuncParseInt):
920         (KJS::globalFuncParseFloat):
921         (KJS::globalFuncIsNaN):
922         (KJS::globalFuncIsFinite):
923         (KJS::globalFuncDecodeURI):
924         (KJS::globalFuncDecodeURIComponent):
925         (KJS::globalFuncEncodeURI):
926         (KJS::globalFuncEncodeURIComponent):
927         (KJS::globalFuncEscape):
928         (KJS::globalFuncUnescape):
929         (KJS::globalFuncKJSPrint):
930         (KJS::PrototypeFunction::callAsFunction):
931         (KJS::PrototypeReflexiveFunction::callAsFunction):
932         * kjs/JSFunction.h:
933         * kjs/JSGlobalData.h:
934         * kjs/JSImmediate.cpp:
935         (KJS::JSImmediate::toObject):
936         * kjs/JSNotAnObject.cpp:
937         (KJS::JSNotAnObject::construct):
938         (KJS::JSNotAnObject::callAsFunction):
939         * kjs/JSNotAnObject.h:
940         * kjs/JSObject.cpp:
941         (KJS::JSObject::put):
942         (KJS::JSObject::construct):
943         (KJS::JSObject::callAsFunction):
944         (KJS::Error::create):
945         * kjs/JSObject.h:
946         * kjs/MathObject.cpp:
947         (KJS::mathProtoFuncAbs):
948         (KJS::mathProtoFuncACos):
949         (KJS::mathProtoFuncASin):
950         (KJS::mathProtoFuncATan):
951         (KJS::mathProtoFuncATan2):
952         (KJS::mathProtoFuncCeil):
953         (KJS::mathProtoFuncCos):
954         (KJS::mathProtoFuncExp):
955         (KJS::mathProtoFuncFloor):
956         (KJS::mathProtoFuncLog):
957         (KJS::mathProtoFuncMax):
958         (KJS::mathProtoFuncMin):
959         (KJS::mathProtoFuncPow):
960         (KJS::mathProtoFuncRandom):
961         (KJS::mathProtoFuncRound):
962         (KJS::mathProtoFuncSin):
963         (KJS::mathProtoFuncSqrt):
964         (KJS::mathProtoFuncTan):
965         * kjs/MathObject.h:
966         * kjs/NumberObject.cpp:
967         (KJS::numberProtoFuncToString):
968         (KJS::numberProtoFuncToLocaleString):
969         (KJS::numberProtoFuncValueOf):
970         (KJS::numberProtoFuncToFixed):
971         (KJS::numberProtoFuncToExponential):
972         (KJS::numberProtoFuncToPrecision):
973         (KJS::NumberConstructor::construct):
974         (KJS::NumberConstructor::callAsFunction):
975         * kjs/NumberObject.h:
976         * kjs/RegExpObject.cpp:
977         (KJS::regExpProtoFuncTest):
978         (KJS::regExpProtoFuncExec):
979         (KJS::regExpProtoFuncCompile):
980         (KJS::regExpProtoFuncToString):
981         (KJS::RegExpObject::match):
982         (KJS::RegExpObject::test):
983         (KJS::RegExpObject::exec):
984         (KJS::RegExpObject::callAsFunction):
985         (KJS::RegExpConstructor::construct):
986         (KJS::RegExpConstructor::callAsFunction):
987         * kjs/RegExpObject.h:
988         * kjs/Shell.cpp:
989         (functionPrint):
990         (functionDebug):
991         (functionGC):
992         (functionVersion):
993         (functionRun):
994         (functionLoad):
995         (functionReadline):
996         (functionQuit):
997         * kjs/collector.cpp:
998         (KJS::Collector::collect):
999         * kjs/collector.h:
1000         (KJS::Collector::markListSet):
1001         * kjs/date_object.cpp:
1002         (KJS::formatLocaleDate):
1003         (KJS::fillStructuresUsingTimeArgs):
1004         (KJS::fillStructuresUsingDateArgs):
1005         (KJS::DateConstructor::construct):
1006         (KJS::DateConstructor::callAsFunction):
1007         (KJS::DateFunction::callAsFunction):
1008         (KJS::dateProtoFuncToString):
1009         (KJS::dateProtoFuncToUTCString):
1010         (KJS::dateProtoFuncToDateString):
1011         (KJS::dateProtoFuncToTimeString):
1012         (KJS::dateProtoFuncToLocaleString):
1013         (KJS::dateProtoFuncToLocaleDateString):
1014         (KJS::dateProtoFuncToLocaleTimeString):
1015         (KJS::dateProtoFuncValueOf):
1016         (KJS::dateProtoFuncGetTime):
1017         (KJS::dateProtoFuncGetFullYear):
1018         (KJS::dateProtoFuncGetUTCFullYear):
1019         (KJS::dateProtoFuncToGMTString):
1020         (KJS::dateProtoFuncGetMonth):
1021         (KJS::dateProtoFuncGetUTCMonth):
1022         (KJS::dateProtoFuncGetDate):
1023         (KJS::dateProtoFuncGetUTCDate):
1024         (KJS::dateProtoFuncGetDay):
1025         (KJS::dateProtoFuncGetUTCDay):
1026         (KJS::dateProtoFuncGetHours):
1027         (KJS::dateProtoFuncGetUTCHours):
1028         (KJS::dateProtoFuncGetMinutes):
1029         (KJS::dateProtoFuncGetUTCMinutes):
1030         (KJS::dateProtoFuncGetSeconds):
1031         (KJS::dateProtoFuncGetUTCSeconds):
1032         (KJS::dateProtoFuncGetMilliSeconds):
1033         (KJS::dateProtoFuncGetUTCMilliseconds):
1034         (KJS::dateProtoFuncGetTimezoneOffset):
1035         (KJS::dateProtoFuncSetTime):
1036         (KJS::setNewValueFromTimeArgs):
1037         (KJS::setNewValueFromDateArgs):
1038         (KJS::dateProtoFuncSetMilliSeconds):
1039         (KJS::dateProtoFuncSetUTCMilliseconds):
1040         (KJS::dateProtoFuncSetSeconds):
1041         (KJS::dateProtoFuncSetUTCSeconds):
1042         (KJS::dateProtoFuncSetMinutes):
1043         (KJS::dateProtoFuncSetUTCMinutes):
1044         (KJS::dateProtoFuncSetHours):
1045         (KJS::dateProtoFuncSetUTCHours):
1046         (KJS::dateProtoFuncSetDate):
1047         (KJS::dateProtoFuncSetUTCDate):
1048         (KJS::dateProtoFuncSetMonth):
1049         (KJS::dateProtoFuncSetUTCMonth):
1050         (KJS::dateProtoFuncSetFullYear):
1051         (KJS::dateProtoFuncSetUTCFullYear):
1052         (KJS::dateProtoFuncSetYear):
1053         (KJS::dateProtoFuncGetYear):
1054         * kjs/date_object.h:
1055         * kjs/debugger.h:
1056         * kjs/error_object.cpp:
1057         (KJS::errorProtoFuncToString):
1058         (KJS::ErrorConstructor::construct):
1059         (KJS::ErrorConstructor::callAsFunction):
1060         (KJS::NativeErrorConstructor::construct):
1061         (KJS::NativeErrorConstructor::callAsFunction):
1062         * kjs/error_object.h:
1063         * kjs/internal.cpp:
1064         (KJS::JSNumberCell::toObject):
1065         (KJS::JSNumberCell::toThisObject):
1066         * kjs/list.cpp:
1067         (KJS::ArgList::getSlice):
1068         (KJS::ArgList::markLists):
1069         (KJS::ArgList::slowAppend):
1070         * kjs/list.h:
1071         (KJS::ArgList::ArgList):
1072         (KJS::ArgList::~ArgList):
1073         * kjs/object_object.cpp:
1074         (KJS::objectProtoFuncValueOf):
1075         (KJS::objectProtoFuncHasOwnProperty):
1076         (KJS::objectProtoFuncIsPrototypeOf):
1077         (KJS::objectProtoFuncDefineGetter):
1078         (KJS::objectProtoFuncDefineSetter):
1079         (KJS::objectProtoFuncLookupGetter):
1080         (KJS::objectProtoFuncLookupSetter):
1081         (KJS::objectProtoFuncPropertyIsEnumerable):
1082         (KJS::objectProtoFuncToLocaleString):
1083         (KJS::objectProtoFuncToString):
1084         (KJS::ObjectConstructor::construct):
1085         (KJS::ObjectConstructor::callAsFunction):
1086         * kjs/object_object.h:
1087         * kjs/string_object.cpp:
1088         (KJS::replace):
1089         (KJS::stringProtoFuncToString):
1090         (KJS::stringProtoFuncValueOf):
1091         (KJS::stringProtoFuncCharAt):
1092         (KJS::stringProtoFuncCharCodeAt):
1093         (KJS::stringProtoFuncConcat):
1094         (KJS::stringProtoFuncIndexOf):
1095         (KJS::stringProtoFuncLastIndexOf):
1096         (KJS::stringProtoFuncMatch):
1097         (KJS::stringProtoFuncSearch):
1098         (KJS::stringProtoFuncReplace):
1099         (KJS::stringProtoFuncSlice):
1100         (KJS::stringProtoFuncSplit):
1101         (KJS::stringProtoFuncSubstr):
1102         (KJS::stringProtoFuncSubstring):
1103         (KJS::stringProtoFuncToLowerCase):
1104         (KJS::stringProtoFuncToUpperCase):
1105         (KJS::stringProtoFuncToLocaleLowerCase):
1106         (KJS::stringProtoFuncToLocaleUpperCase):
1107         (KJS::stringProtoFuncLocaleCompare):
1108         (KJS::stringProtoFuncBig):
1109         (KJS::stringProtoFuncSmall):
1110         (KJS::stringProtoFuncBlink):
1111         (KJS::stringProtoFuncBold):
1112         (KJS::stringProtoFuncFixed):
1113         (KJS::stringProtoFuncItalics):
1114         (KJS::stringProtoFuncStrike):
1115         (KJS::stringProtoFuncSub):
1116         (KJS::stringProtoFuncSup):
1117         (KJS::stringProtoFuncFontcolor):
1118         (KJS::stringProtoFuncFontsize):
1119         (KJS::stringProtoFuncAnchor):
1120         (KJS::stringProtoFuncLink):
1121         (KJS::StringConstructor::construct):
1122         (KJS::StringConstructor::callAsFunction):
1123         (KJS::StringConstructorFunction::callAsFunction):
1124         * kjs/string_object.h:
1125
1126 2008-06-15  Darin Adler  <darin@apple.com>
1127
1128         - new names for more JavaScriptCore files
1129
1130         * API/JSCallbackFunction.cpp:
1131         * API/JSObjectRef.cpp:
1132         * DerivedSources.make:
1133         * GNUmakefile.am:
1134         * JavaScriptCore.exp:
1135         * JavaScriptCore.pri:
1136         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1137         * JavaScriptCore.xcodeproj/project.pbxproj:
1138         * JavaScriptCoreSources.bkl:
1139         * VM/Machine.cpp:
1140         * kjs/AllInOneFile.cpp:
1141         * kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
1142         * kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
1143         * kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
1144         * kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
1145         * kjs/ExecState.cpp:
1146         * kjs/ExecState.h:
1147         * kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
1148         * kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
1149         * kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
1150         * kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
1151         * kjs/JSFunction.cpp:
1152         * kjs/JSFunction.h:
1153         * kjs/JSGlobalObject.cpp:
1154         * kjs/JSImmediate.cpp:
1155         * kjs/JSObject.h:
1156         * kjs/JSString.h:
1157         * kjs/JSValue.h:
1158         * kjs/JSVariableObject.cpp:
1159         * kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
1160         * kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
1161         * kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
1162         * kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
1163         * kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
1164         * kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
1165         * kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
1166         * kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
1167         * kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
1168         * kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
1169         * kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
1170         * kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
1171         * kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
1172         * kjs/Shell.cpp:
1173         * kjs/array_instance.cpp: Removed.
1174         * kjs/array_instance.h: Removed.
1175         * kjs/array_object.cpp: Removed.
1176         * kjs/array_object.h: Removed.
1177         * kjs/bool_object.cpp: Removed.
1178         * kjs/bool_object.h: Removed.
1179         * kjs/error_object.h:
1180         * kjs/function_object.cpp: Removed.
1181         * kjs/function_object.h: Removed.
1182         * kjs/internal.cpp:
1183         * kjs/math_object.cpp: Removed.
1184         * kjs/math_object.h: Removed.
1185         * kjs/nodes.cpp:
1186         * kjs/number_object.cpp: Removed.
1187         * kjs/number_object.h: Removed.
1188         * kjs/object_object.cpp:
1189         * kjs/property_map.cpp: Removed.
1190         * kjs/property_map.h: Removed.
1191         * kjs/property_slot.cpp: Removed.
1192         * kjs/property_slot.h: Removed.
1193         * kjs/regexp_object.cpp: Removed.
1194         * kjs/regexp_object.h: Removed.
1195         * kjs/scope_chain.cpp: Removed.
1196         * kjs/scope_chain.h: Removed.
1197         * kjs/scope_chain_mark.h: Removed.
1198         * kjs/string_object.cpp:
1199         * kjs/string_object.h:
1200
1201 2008-06-15  Darin Adler  <darin@apple.com>
1202
1203         - new names for a few key JavaScriptCore files
1204
1205         * API/JSBase.cpp:
1206         * API/JSCallbackConstructor.h:
1207         * API/JSCallbackFunction.cpp:
1208         * API/JSCallbackFunction.h:
1209         * API/JSCallbackObject.h:
1210         * API/JSCallbackObjectFunctions.h:
1211         * API/JSClassRef.h:
1212         * API/JSContextRef.cpp:
1213         * API/JSObjectRef.cpp:
1214         * API/JSStringRef.cpp:
1215         * API/JSStringRefCF.cpp:
1216         * API/JSValueRef.cpp:
1217         * GNUmakefile.am:
1218         * JavaScriptCore.pri:
1219         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1220         * JavaScriptCore.xcodeproj/project.pbxproj:
1221         * JavaScriptCoreSources.bkl:
1222         * VM/CodeBlock.cpp:
1223         * VM/CodeGenerator.cpp:
1224         * VM/ExceptionHelpers.cpp:
1225         * VM/ExceptionHelpers.h:
1226         * VM/JSPropertyNameIterator.cpp:
1227         * VM/JSPropertyNameIterator.h:
1228         * VM/Machine.cpp:
1229         * kjs/AllInOneFile.cpp:
1230         * kjs/DateMath.cpp:
1231         * kjs/DebuggerCallFrame.cpp:
1232         * kjs/ExecState.cpp:
1233         * kjs/JSActivation.cpp:
1234         * kjs/JSFunction.cpp: Copied from JavaScriptCore/kjs/function.cpp.
1235         * kjs/JSFunction.h: Copied from JavaScriptCore/kjs/function.h.
1236         * kjs/JSImmediate.cpp:
1237         * kjs/JSNotAnObject.h:
1238         * kjs/JSObject.cpp: Copied from JavaScriptCore/kjs/object.cpp.
1239         * kjs/JSObject.h: Copied from JavaScriptCore/kjs/object.h.
1240         * kjs/JSString.h: Copied from JavaScriptCore/kjs/internal.h.
1241         * kjs/JSValue.cpp: Copied from JavaScriptCore/kjs/value.cpp.
1242         * kjs/JSValue.h: Copied from JavaScriptCore/kjs/value.h.
1243         * kjs/JSVariableObject.h:
1244         * kjs/JSWrapperObject.h:
1245         * kjs/Shell.cpp:
1246         * kjs/SymbolTable.h:
1247         * kjs/array_instance.h:
1248         * kjs/collector.cpp:
1249         * kjs/date_object.cpp:
1250         * kjs/date_object.h:
1251         * kjs/error_object.cpp:
1252         * kjs/function.cpp: Removed.
1253         * kjs/function.h: Removed.
1254         * kjs/function_object.cpp:
1255         * kjs/function_object.h:
1256         * kjs/grammar.y:
1257         * kjs/internal.cpp:
1258         * kjs/internal.h: Removed.
1259         * kjs/lexer.cpp:
1260         * kjs/list.h:
1261         * kjs/lookup.h:
1262         * kjs/nodes.h:
1263         * kjs/object.cpp: Removed.
1264         * kjs/object.h: Removed.
1265         * kjs/object_object.h:
1266         * kjs/operations.cpp:
1267         * kjs/property_map.cpp:
1268         * kjs/property_slot.cpp:
1269         * kjs/property_slot.h:
1270         * kjs/protect.h:
1271         * kjs/regexp_object.cpp:
1272         * kjs/scope_chain.cpp:
1273         * kjs/string_object.h:
1274         * kjs/ustring.cpp:
1275         * kjs/value.cpp: Removed.
1276         * kjs/value.h: Removed.
1277         * profiler/Profile.cpp:
1278         * profiler/Profiler.cpp:
1279
1280 2008-06-15  Darin Adler  <darin@apple.com>
1281
1282         Rubber stamped by Sam.
1283
1284         - cut down on confusing uses of "Object" and "Imp" in
1285           JavaScriptCore class names
1286
1287         * API/JSCallbackFunction.cpp:
1288         (KJS::JSCallbackFunction::JSCallbackFunction):
1289         * API/JSCallbackFunction.h:
1290         * VM/Machine.cpp:
1291         (KJS::Machine::privateExecute):
1292         * kjs/ExecState.h:
1293         (KJS::ExecState::regExpTable):
1294         (KJS::ExecState::regExpConstructorTable):
1295         * kjs/JSGlobalData.cpp:
1296         (KJS::JSGlobalData::JSGlobalData):
1297         (KJS::JSGlobalData::~JSGlobalData):
1298         * kjs/JSGlobalData.h:
1299         * kjs/JSGlobalObject.cpp:
1300         (KJS::JSGlobalObject::reset):
1301         * kjs/JSGlobalObject.h:
1302         (KJS::JSGlobalObject::objectConstructor):
1303         (KJS::JSGlobalObject::functionConstructor):
1304         (KJS::JSGlobalObject::arrayConstructor):
1305         (KJS::JSGlobalObject::booleanConstructor):
1306         (KJS::JSGlobalObject::stringConstructor):
1307         (KJS::JSGlobalObject::numberConstructor):
1308         (KJS::JSGlobalObject::dateConstructor):
1309         (KJS::JSGlobalObject::regExpConstructor):
1310         (KJS::JSGlobalObject::errorConstructor):
1311         (KJS::JSGlobalObject::evalErrorConstructor):
1312         (KJS::JSGlobalObject::rangeErrorConstructor):
1313         (KJS::JSGlobalObject::referenceErrorConstructor):
1314         (KJS::JSGlobalObject::syntaxErrorConstructor):
1315         (KJS::JSGlobalObject::typeErrorConstructor):
1316         (KJS::JSGlobalObject::URIErrorConstructor):
1317         * kjs/array_object.cpp:
1318         (KJS::ArrayConstructor::ArrayConstructor):
1319         (KJS::ArrayConstructor::getConstructData):
1320         (KJS::ArrayConstructor::construct):
1321         (KJS::ArrayConstructor::callAsFunction):
1322         * kjs/array_object.h:
1323         * kjs/bool_object.cpp:
1324         (KJS::BooleanObject::BooleanObject):
1325         (KJS::BooleanPrototype::BooleanPrototype):
1326         (KJS::booleanProtoFuncToString):
1327         (KJS::booleanProtoFuncValueOf):
1328         (KJS::BooleanConstructor::BooleanConstructor):
1329         (KJS::BooleanConstructor::getConstructData):
1330         (KJS::BooleanConstructor::construct):
1331         (KJS::BooleanConstructor::callAsFunction):
1332         * kjs/bool_object.h:
1333         * kjs/date_object.cpp:
1334         (KJS::DatePrototype::DatePrototype):
1335         (KJS::DateConstructor::DateConstructor):
1336         (KJS::DateConstructor::getConstructData):
1337         (KJS::DateConstructor::construct):
1338         (KJS::DateConstructor::callAsFunction):
1339         (KJS::DateFunction::DateFunction):
1340         (KJS::DateFunction::callAsFunction):
1341         * kjs/date_object.h:
1342         * kjs/error_object.cpp:
1343         (KJS::ErrorPrototype::ErrorPrototype):
1344         (KJS::ErrorConstructor::ErrorConstructor):
1345         (KJS::ErrorConstructor::getConstructData):
1346         (KJS::ErrorConstructor::construct):
1347         (KJS::ErrorConstructor::callAsFunction):
1348         (KJS::NativeErrorConstructor::NativeErrorConstructor):
1349         (KJS::NativeErrorConstructor::getConstructData):
1350         (KJS::NativeErrorConstructor::construct):
1351         (KJS::NativeErrorConstructor::callAsFunction):
1352         (KJS::NativeErrorConstructor::mark):
1353         * kjs/error_object.h:
1354         * kjs/function.cpp:
1355         (KJS::JSFunction::JSFunction):
1356         (KJS::JSFunction::mark):
1357         (KJS::JSFunction::getOwnPropertySlot):
1358         (KJS::JSFunction::put):
1359         (KJS::JSFunction::deleteProperty):
1360         (KJS::PrototypeFunction::PrototypeFunction):
1361         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
1362         (KJS::PrototypeReflexiveFunction::mark):
1363         * kjs/function.h:
1364         * kjs/function_object.cpp:
1365         (KJS::functionProtoFuncToString):
1366         (KJS::FunctionConstructor::FunctionConstructor):
1367         (KJS::FunctionConstructor::getConstructData):
1368         (KJS::FunctionConstructor::construct):
1369         (KJS::FunctionConstructor::callAsFunction):
1370         * kjs/function_object.h:
1371         * kjs/internal.cpp:
1372         (KJS::StringObject::create):
1373         (KJS::JSString::toObject):
1374         (KJS::JSString::toThisObject):
1375         (KJS::JSString::getOwnPropertySlot):
1376         (KJS::InternalFunction::InternalFunction):
1377         (KJS::InternalFunction::getCallData):
1378         (KJS::InternalFunction::implementsHasInstance):
1379         * kjs/math_object.cpp:
1380         (KJS::MathObject::MathObject):
1381         (KJS::MathObject::getOwnPropertySlot):
1382         (KJS::MathObject::getValueProperty):
1383         * kjs/math_object.h:
1384         * kjs/number_object.cpp:
1385         (KJS::NumberObject::NumberObject):
1386         (KJS::NumberPrototype::NumberPrototype):
1387         (KJS::numberProtoFuncToString):
1388         (KJS::numberProtoFuncToLocaleString):
1389         (KJS::numberProtoFuncValueOf):
1390         (KJS::numberProtoFuncToFixed):
1391         (KJS::numberProtoFuncToExponential):
1392         (KJS::numberProtoFuncToPrecision):
1393         (KJS::NumberConstructor::NumberConstructor):
1394         (KJS::NumberConstructor::getOwnPropertySlot):
1395         (KJS::NumberConstructor::getValueProperty):
1396         (KJS::NumberConstructor::getConstructData):
1397         (KJS::NumberConstructor::construct):
1398         (KJS::NumberConstructor::callAsFunction):
1399         * kjs/number_object.h:
1400         * kjs/object.cpp:
1401         (KJS::JSObject::putDirectFunction):
1402         * kjs/object.h:
1403         * kjs/object_object.cpp:
1404         (KJS::ObjectConstructor::ObjectConstructor):
1405         (KJS::ObjectConstructor::getConstructData):
1406         (KJS::ObjectConstructor::construct):
1407         (KJS::ObjectConstructor::callAsFunction):
1408         * kjs/object_object.h:
1409         * kjs/regexp.cpp:
1410         (KJS::RegExp::RegExp):
1411         * kjs/regexp_object.cpp:
1412         (KJS::regExpProtoFuncTest):
1413         (KJS::regExpProtoFuncExec):
1414         (KJS::regExpProtoFuncCompile):
1415         (KJS::regExpProtoFuncToString):
1416         (KJS::RegExpObject::RegExpObject):
1417         (KJS::RegExpObject::~RegExpObject):
1418         (KJS::RegExpObject::getOwnPropertySlot):
1419         (KJS::RegExpObject::getValueProperty):
1420         (KJS::RegExpObject::put):
1421         (KJS::RegExpObject::putValueProperty):
1422         (KJS::RegExpObject::match):
1423         (KJS::RegExpObject::test):
1424         (KJS::RegExpObject::exec):
1425         (KJS::RegExpObject::getCallData):
1426         (KJS::RegExpObject::callAsFunction):
1427         (KJS::RegExpConstructorPrivate::RegExpConstructorPrivate):
1428         (KJS::RegExpConstructor::RegExpConstructor):
1429         (KJS::RegExpConstructor::performMatch):
1430         (KJS::RegExpMatchesArray::RegExpMatchesArray):
1431         (KJS::RegExpMatchesArray::~RegExpMatchesArray):
1432         (KJS::RegExpMatchesArray::fillArrayInstance):
1433         (KJS::RegExpConstructor::arrayOfMatches):
1434         (KJS::RegExpConstructor::getBackref):
1435         (KJS::RegExpConstructor::getLastParen):
1436         (KJS::RegExpConstructor::getLeftContext):
1437         (KJS::RegExpConstructor::getRightContext):
1438         (KJS::RegExpConstructor::getOwnPropertySlot):
1439         (KJS::RegExpConstructor::getValueProperty):
1440         (KJS::RegExpConstructor::put):
1441         (KJS::RegExpConstructor::putValueProperty):
1442         (KJS::RegExpConstructor::getConstructData):
1443         (KJS::RegExpConstructor::construct):
1444         (KJS::RegExpConstructor::callAsFunction):
1445         (KJS::RegExpConstructor::input):
1446         * kjs/regexp_object.h:
1447         * kjs/string_object.cpp:
1448         (KJS::StringObject::StringObject):
1449         (KJS::StringObject::getOwnPropertySlot):
1450         (KJS::StringObject::put):
1451         (KJS::StringObject::deleteProperty):
1452         (KJS::StringObject::getPropertyNames):
1453         (KJS::StringPrototype::StringPrototype):
1454         (KJS::StringPrototype::getOwnPropertySlot):
1455         (KJS::replace):
1456         (KJS::stringProtoFuncToString):
1457         (KJS::stringProtoFuncValueOf):
1458         (KJS::stringProtoFuncCharAt):
1459         (KJS::stringProtoFuncCharCodeAt):
1460         (KJS::stringProtoFuncConcat):
1461         (KJS::stringProtoFuncIndexOf):
1462         (KJS::stringProtoFuncLastIndexOf):
1463         (KJS::stringProtoFuncMatch):
1464         (KJS::stringProtoFuncSearch):
1465         (KJS::stringProtoFuncReplace):
1466         (KJS::stringProtoFuncSlice):
1467         (KJS::stringProtoFuncSplit):
1468         (KJS::stringProtoFuncSubstr):
1469         (KJS::stringProtoFuncSubstring):
1470         (KJS::stringProtoFuncToLowerCase):
1471         (KJS::stringProtoFuncToUpperCase):
1472         (KJS::stringProtoFuncToLocaleLowerCase):
1473         (KJS::stringProtoFuncToLocaleUpperCase):
1474         (KJS::stringProtoFuncLocaleCompare):
1475         (KJS::stringProtoFuncBig):
1476         (KJS::stringProtoFuncSmall):
1477         (KJS::stringProtoFuncBlink):
1478         (KJS::stringProtoFuncBold):
1479         (KJS::stringProtoFuncFixed):
1480         (KJS::stringProtoFuncItalics):
1481         (KJS::stringProtoFuncStrike):
1482         (KJS::stringProtoFuncSub):
1483         (KJS::stringProtoFuncSup):
1484         (KJS::stringProtoFuncFontcolor):
1485         (KJS::stringProtoFuncFontsize):
1486         (KJS::stringProtoFuncAnchor):
1487         (KJS::stringProtoFuncLink):
1488         (KJS::StringConstructor::StringConstructor):
1489         (KJS::StringConstructor::getConstructData):
1490         (KJS::StringConstructor::construct):
1491         (KJS::StringConstructor::callAsFunction):
1492         (KJS::StringConstructorFunction::StringConstructorFunction):
1493         (KJS::StringConstructorFunction::callAsFunction):
1494         * kjs/string_object.h:
1495         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1496         * profiler/Profiler.cpp:
1497         (KJS::createCallIdentifier):
1498
1499 2008-06-15  Darin Adler  <darin@apple.com>
1500
1501         Rubber stamped by Sam.
1502
1503         - use JS prefix and simpler names for basic JavaScriptCore types,
1504           to complement JSValue and JSObject
1505
1506         * JavaScriptCore.exp:
1507         * VM/Machine.cpp:
1508         (KJS::jsLess):
1509         (KJS::jsLessEq):
1510         (KJS::jsAdd):
1511         (KJS::callEval):
1512         (KJS::Machine::execute):
1513         (KJS::Machine::retrieveArguments):
1514         (KJS::Machine::retrieveCaller):
1515         (KJS::Machine::getCallFrame):
1516         (KJS::Machine::getFunctionAndArguments):
1517         * VM/Machine.h:
1518         * VM/Register.h:
1519         * kjs/DebuggerCallFrame.cpp:
1520         (KJS::DebuggerCallFrame::functionName):
1521         * kjs/ExecState.h:
1522         * kjs/JSActivation.cpp:
1523         (KJS::JSActivation::createArgumentsObject):
1524         * kjs/array_instance.cpp:
1525         (KJS::JSArray::checkConsistency):
1526         (KJS::JSArray::JSArray):
1527         (KJS::JSArray::~JSArray):
1528         (KJS::JSArray::getItem):
1529         (KJS::JSArray::lengthGetter):
1530         (KJS::JSArray::inlineGetOwnPropertySlot):
1531         (KJS::JSArray::getOwnPropertySlot):
1532         (KJS::JSArray::put):
1533         (KJS::JSArray::deleteProperty):
1534         (KJS::JSArray::getPropertyNames):
1535         (KJS::JSArray::increaseVectorLength):
1536         (KJS::JSArray::setLength):
1537         (KJS::JSArray::mark):
1538         (KJS::JSArray::sort):
1539         (KJS::JSArray::compactForSorting):
1540         (KJS::JSArray::lazyCreationData):
1541         (KJS::JSArray::setLazyCreationData):
1542         * kjs/array_instance.h:
1543         * kjs/array_object.cpp:
1544         (KJS::ArrayPrototype::ArrayPrototype):
1545         (KJS::ArrayPrototype::getOwnPropertySlot):
1546         (KJS::arrayProtoFuncToString):
1547         (KJS::arrayProtoFuncToLocaleString):
1548         (KJS::arrayProtoFuncConcat):
1549         (KJS::arrayProtoFuncSort):
1550         (KJS::ArrayObjectImp::construct):
1551         * kjs/array_object.h:
1552         * kjs/completion.h:
1553         * kjs/function.cpp:
1554         (KJS::JSFunction::JSFunction):
1555         (KJS::JSFunction::mark):
1556         (KJS::JSFunction::getCallData):
1557         (KJS::JSFunction::callAsFunction):
1558         (KJS::JSFunction::argumentsGetter):
1559         (KJS::JSFunction::callerGetter):
1560         (KJS::JSFunction::lengthGetter):
1561         (KJS::JSFunction::getOwnPropertySlot):
1562         (KJS::JSFunction::put):
1563         (KJS::JSFunction::deleteProperty):
1564         (KJS::JSFunction::getParameterName):
1565         (KJS::JSFunction::getConstructData):
1566         (KJS::JSFunction::construct):
1567         (KJS::IndexToNameMap::IndexToNameMap):
1568         (KJS::Arguments::Arguments):
1569         * kjs/function.h:
1570         * kjs/function_object.cpp:
1571         (KJS::functionProtoFuncToString):
1572         (KJS::functionProtoFuncApply):
1573         (KJS::FunctionObjectImp::construct):
1574         * kjs/internal.cpp:
1575         (KJS::JSString::toPrimitive):
1576         (KJS::JSString::getPrimitiveNumber):
1577         (KJS::JSString::toBoolean):
1578         (KJS::JSString::toNumber):
1579         (KJS::JSString::toString):
1580         (KJS::StringInstance::create):
1581         (KJS::JSString::toObject):
1582         (KJS::JSString::toThisObject):
1583         (KJS::JSString::lengthGetter):
1584         (KJS::JSString::indexGetter):
1585         (KJS::JSString::indexNumericPropertyGetter):
1586         (KJS::JSString::getOwnPropertySlot):
1587         (KJS::JSNumberCell::type):
1588         (KJS::JSNumberCell::toPrimitive):
1589         (KJS::JSNumberCell::getPrimitiveNumber):
1590         (KJS::JSNumberCell::toBoolean):
1591         (KJS::JSNumberCell::toNumber):
1592         (KJS::JSNumberCell::toString):
1593         (KJS::JSNumberCell::toObject):
1594         (KJS::JSNumberCell::toThisObject):
1595         (KJS::JSNumberCell::getUInt32):
1596         (KJS::JSNumberCell::getTruncatedInt32):
1597         (KJS::JSNumberCell::getTruncatedUInt32):
1598         (KJS::GetterSetter::mark):
1599         (KJS::GetterSetter::toPrimitive):
1600         (KJS::GetterSetter::getPrimitiveNumber):
1601         (KJS::GetterSetter::toBoolean):
1602         (KJS::GetterSetter::toNumber):
1603         (KJS::GetterSetter::toString):
1604         (KJS::GetterSetter::toObject):
1605         (KJS::GetterSetter::getOwnPropertySlot):
1606         (KJS::GetterSetter::put):
1607         (KJS::GetterSetter::toThisObject):
1608         * kjs/internal.h:
1609         (KJS::JSString::JSString):
1610         (KJS::JSString::getStringPropertySlot):
1611         * kjs/nodes.cpp:
1612         (KJS::FuncDeclNode::makeFunction):
1613         (KJS::FuncExprNode::makeFunction):
1614         * kjs/nodes.h:
1615         * kjs/object.cpp:
1616         (KJS::JSObject::put):
1617         (KJS::JSObject::deleteProperty):
1618         (KJS::JSObject::defineGetter):
1619         (KJS::JSObject::defineSetter):
1620         (KJS::JSObject::lookupGetter):
1621         (KJS::JSObject::lookupSetter):
1622         (KJS::JSObject::fillGetterPropertySlot):
1623         * kjs/object.h:
1624         (KJS::GetterSetter::GetterSetter):
1625         * kjs/operations.cpp:
1626         (KJS::equal):
1627         (KJS::strictEqual):
1628         * kjs/property_map.cpp:
1629         (KJS::PropertyMap::containsGettersOrSetters):
1630         * kjs/regexp_object.cpp:
1631         (KJS::RegExpMatchesArray::getOwnPropertySlot):
1632         (KJS::RegExpMatchesArray::put):
1633         (KJS::RegExpMatchesArray::deleteProperty):
1634         (KJS::RegExpMatchesArray::getPropertyNames):
1635         (KJS::RegExpMatchesArray::RegExpMatchesArray):
1636         (KJS::RegExpMatchesArray::fillArrayInstance):
1637         * kjs/string_object.cpp:
1638         (KJS::StringInstance::StringInstance):
1639         (KJS::replace):
1640         (KJS::stringProtoFuncReplace):
1641         (KJS::stringProtoFuncToLowerCase):
1642         (KJS::stringProtoFuncToUpperCase):
1643         (KJS::stringProtoFuncToLocaleLowerCase):
1644         (KJS::stringProtoFuncToLocaleUpperCase):
1645         * kjs/string_object.h:
1646         (KJS::StringInstance::internalValue):
1647         * kjs/value.cpp:
1648         (KJS::JSCell::getNumber):
1649         (KJS::JSCell::getString):
1650         (KJS::JSCell::getObject):
1651         (KJS::jsString):
1652         (KJS::jsOwnedString):
1653         * kjs/value.h:
1654         (KJS::JSNumberCell::JSNumberCell):
1655         (KJS::jsNumberCell):
1656         (KJS::JSValue::uncheckedGetNumber):
1657         * profiler/Profiler.cpp:
1658         (KJS::createCallIdentifier):
1659         (KJS::createCallIdentifierFromFunctionImp):
1660
1661 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
1662
1663         Reviewed by Alexey.
1664         
1665         - add emitUnaryOp, emitNullaryOp and emitUnaryOpNoDst; use them
1666         
1667         This removes some boilerplate code and also reduces the number of
1668         places that will need to be changed to do on-demand emit of
1669         loads (and thus support k operands).
1670
1671         * VM/CodeGenerator.cpp:
1672         (KJS::CodeGenerator::emitUnaryOp):
1673         (KJS::CodeGenerator::emitNullaryOp):
1674         (KJS::CodeGenerator::emitUnaryOpNoDst):
1675         (KJS::CodeGenerator::emitPushScope):
1676         * VM/CodeGenerator.h:
1677         (KJS::CodeGenerator::emitNewObject):
1678         (KJS::CodeGenerator::emitNewArray):
1679         (KJS::CodeGenerator::emitNot):
1680         (KJS::CodeGenerator::emitBitNot):
1681         (KJS::CodeGenerator::emitToJSNumber):
1682         (KJS::CodeGenerator::emitNegate):
1683         (KJS::CodeGenerator::emitInstanceOf):
1684         (KJS::CodeGenerator::emitTypeOf):
1685         (KJS::CodeGenerator::emitIn):
1686         (KJS::CodeGenerator::emitReturn):
1687         (KJS::CodeGenerator::emitEnd):
1688         (KJS::CodeGenerator::emitGetPropertyNames):
1689
1690 2008-06-15  Alp Toker  <alp@nuanti.com>
1691
1692         Rubber-stamped by Maciej.
1693
1694         Install 'jsc' application by default.
1695
1696         * GNUmakefile.am:
1697
1698 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
1699
1700         Reviewed by Oliver.
1701         
1702         - rename testkjs to jsc
1703
1704         * GNUmakefile.am:
1705         * JavaScriptCore.vcproj/JavaScriptCore.sln:
1706         * JavaScriptCore.vcproj/jsc: Added.
1707         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Copied from JavaScriptCore.vcproj/testkjs/testkjs.vcproj.
1708         * JavaScriptCore.vcproj/testkjs: Removed.
1709         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Removed.
1710         * JavaScriptCore.xcodeproj/project.pbxproj:
1711         * jscore.bkl:
1712         * kjs/Shell.cpp: Copied from kjs/testkjs.cpp.
1713         (main):
1714         (printUsageStatement):
1715         (jscmain):
1716         * kjs/jsc.pro: Copied from kjs/testkjs.pro.
1717         * kjs/testkjs.cpp: Removed.
1718         * kjs/testkjs.pro: Removed.
1719         * tests/mozilla/expected.html:
1720         * tests/mozilla/js1_2/Array/tostring_1.js:
1721         * tests/mozilla/js1_2/Array/tostring_2.js:
1722         * tests/mozilla/jsDriver.pl:
1723
1724 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1725
1726         Reviewed by Maciej.
1727
1728         Mac build fix.
1729
1730         * JavaScriptCore.xcodeproj/project.pbxproj:
1731         * kjs/nodes.h:
1732
1733 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1734
1735         Reviewed by Maciej.
1736
1737         Change the spelling of PrecMultiplicitave to PrecMultiplicative.
1738
1739         * kjs/nodes.h:
1740         (KJS::MultNode::precedence):
1741         (KJS::DivNode::precedence):
1742         (KJS::ModNode::precedence):
1743
1744 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1745
1746         Reviewed by Maciej.
1747
1748         Remove unused preprocessor macros related to exceptions in the old
1749         interpreter.
1750
1751         * kjs/nodes.cpp:
1752
1753 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1754
1755         Reviewed by Maciej.
1756
1757         Bug 19484: More instructions needs to use temporary registers
1758         <https://bugs.webkit.org/show_bug.cgi?id=19484>
1759
1760         Fix codegen for all binary operations so that temporaries are used if
1761         necessary. This was done by making BinaryOpNode and ReverseBinaryOpNode
1762         subclasses of ExpressionNode, and eliminating the custom emitCode()
1763         methods for the individual node classes.
1764
1765         This only adds 3 new instructions to SunSpider code, and there is no
1766         difference in SunSpider execution time.
1767
1768         * VM/CodeGenerator.cpp:
1769         (KJS::CodeGenerator::emitBitNot):
1770         (KJS::CodeGenerator::emitBinaryOp):
1771         * VM/CodeGenerator.h:
1772         * kjs/grammar.y:
1773         * kjs/nodes.cpp:
1774         (KJS::PreIncResolveNode::emitCode):
1775         (KJS::PreDecResolveNode::emitCode):
1776         (KJS::BinaryOpNode::emitCode):
1777         (KJS::ReverseBinaryOpNode::emitCode):
1778         (KJS::emitReadModifyAssignment):
1779         (KJS::CaseBlockNode::emitCodeForBlock):
1780         * kjs/nodes.h:
1781         (KJS::BinaryOpNode::BinaryOpNode):
1782         (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
1783         (KJS::MultNode::):
1784         (KJS::DivNode::):
1785         (KJS::DivNode::precedence):
1786         (KJS::ModNode::):
1787         (KJS::ModNode::precedence):
1788         (KJS::AddNode::):
1789         (KJS::AddNode::precedence):
1790         (KJS::SubNode::):
1791         (KJS::SubNode::precedence):
1792         (KJS::LeftShiftNode::):
1793         (KJS::LeftShiftNode::precedence):
1794         (KJS::RightShiftNode::):
1795         (KJS::RightShiftNode::precedence):
1796         (KJS::UnsignedRightShiftNode::):
1797         (KJS::UnsignedRightShiftNode::precedence):
1798         (KJS::LessNode::):
1799         (KJS::LessNode::precedence):
1800         (KJS::GreaterNode::):
1801         (KJS::GreaterNode::precedence):
1802         (KJS::LessEqNode::):
1803         (KJS::LessEqNode::precedence):
1804         (KJS::GreaterEqNode::):
1805         (KJS::GreaterEqNode::precedence):
1806         (KJS::InstanceOfNode::):
1807         (KJS::InstanceOfNode::precedence):
1808         (KJS::InNode::):
1809         (KJS::InNode::precedence):
1810         (KJS::EqualNode::):
1811         (KJS::EqualNode::precedence):
1812         (KJS::NotEqualNode::):
1813         (KJS::NotEqualNode::precedence):
1814         (KJS::StrictEqualNode::):
1815         (KJS::StrictEqualNode::precedence):
1816         (KJS::NotStrictEqualNode::):
1817         (KJS::NotStrictEqualNode::precedence):
1818         (KJS::BitAndNode::):
1819         (KJS::BitAndNode::precedence):
1820         (KJS::BitOrNode::):
1821         (KJS::BitOrNode::precedence):
1822         (KJS::BitXOrNode::):
1823         (KJS::BitXOrNode::precedence):
1824         * kjs/nodes2string.cpp:
1825         (KJS::LessNode::streamTo):
1826         (KJS::GreaterNode::streamTo):
1827         (KJS::LessEqNode::streamTo):
1828         (KJS::GreaterEqNode::streamTo):
1829         (KJS::InstanceOfNode::streamTo):
1830         (KJS::InNode::streamTo):
1831         (KJS::EqualNode::streamTo):
1832         (KJS::NotEqualNode::streamTo):
1833         (KJS::StrictEqualNode::streamTo):
1834         (KJS::NotStrictEqualNode::streamTo):
1835         (KJS::BitAndNode::streamTo):
1836         (KJS::BitXOrNode::streamTo):
1837         (KJS::BitOrNode::streamTo):
1838
1839 2008-06-14  Darin Adler  <darin@apple.com>
1840
1841         Rubber stamped by Sam.
1842
1843         - rename a bunch of local symbols within the regular expression code to
1844           follow our usual coding style, and do a few other name tweaks
1845
1846         * pcre/pcre_compile.cpp:
1847         (CompileData::CompileData):
1848         (checkEscape):
1849         (readRepeatCounts):
1850         (compileBranch):
1851         (compileBracket):
1852         (calculateCompiledPatternLength):
1853         (returnError):
1854         (jsRegExpCompile):
1855         * pcre/pcre_exec.cpp:
1856         (MatchStack::MatchStack):
1857         (MatchStack::canUseStackBufferForNextFrame):
1858         (MatchStack::popCurrentFrame):
1859         (match):
1860         (tryFirstByteOptimization):
1861         (tryRequiredByteOptimization):
1862         (jsRegExpExecute):
1863         * pcre/pcre_internal.h:
1864
1865 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1866
1867         Reviewed by Darin.
1868
1869         Remove redundant uses of get().
1870
1871         * kjs/nodes.cpp:
1872         (KJS::BracketAccessorNode::emitCode):
1873         (KJS::AddNode::emitCode):
1874         (KJS::SubNode::emitCode):
1875         (KJS::ReadModifyResolveNode::emitCode):
1876         (KJS::AssignDotNode::emitCode):
1877         (KJS::ReadModifyDotNode::emitCode):
1878         (KJS::AssignBracketNode::emitCode):
1879         (KJS::ReadModifyBracketNode::emitCode):
1880
1881 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1882
1883         Reviewed by Maciej.
1884
1885         Make code generation not use a temporary for the left-hand side of an
1886         expression if the right-hand side is a local variable.
1887
1888         * VM/CodeGenerator.cpp:
1889         (KJS::CodeGenerator::isLocal):
1890         * VM/CodeGenerator.h:
1891         (KJS::CodeGenerator::leftHandSideNeedsCopy):
1892         (KJS::CodeGenerator::emitNodeForLeftHandSide):
1893         * kjs/nodes.cpp:
1894         (KJS::ResolveNode::isPure):
1895         (KJS::BracketAccessorNode::emitCode):
1896         (KJS::AddNode::emitCode):
1897         (KJS::SubNode::emitCode):
1898         (KJS::ReadModifyResolveNode::emitCode):
1899         (KJS::AssignDotNode::emitCode):
1900         (KJS::ReadModifyDotNode::emitCode):
1901         (KJS::AssignBracketNode::emitCode):
1902         (KJS::ReadModifyBracketNode::emitCode):
1903         * kjs/nodes.h:
1904         (KJS::ExpressionNode::):
1905         (KJS::BooleanNode::):
1906         (KJS::NumberNode::):
1907         (KJS::StringNode::):
1908
1909 2008-06-14  Darin Adler  <darin@apple.com>
1910
1911         Reviewed by Sam.
1912
1913         - more of https://bugs.webkit.org/show_bug.cgi?id=17257
1914           start ref counts at 1 instead of 0 for speed
1915
1916         * kjs/nodes.cpp:
1917         (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
1918         * kjs/nodes.h: Replaced refcount with hasOneRef.
1919
1920         * wtf/ListRefPtr.h:
1921         (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
1922         refcount, so this class can be used with the RefCounted template.
1923
1924         * wtf/RefCounted.h:
1925         (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
1926         it to be non-const.
1927
1928 2008-06-14  Maciej Stachowiak  <mjs@apple.com>
1929
1930         Reviewed by Oliver.
1931         
1932         - initialize local vars as side effect of call instead of in bytecode
1933         1.004x speedup on SunSpider.
1934
1935         This removes just the dispatch overhead for these loads - in the
1936         future, dead store elimination might be able to eliminate them
1937         entirely.
1938         
1939         * VM/CodeGenerator.cpp:
1940         (KJS::CodeGenerator::CodeGenerator): For function blocks, don't
1941         emit loads of undefined for var initialization.
1942         * VM/Machine.cpp:
1943         (KJS::slideRegisterWindowForCall): Instead, initialize locals
1944         as part of the call.
1945
1946 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1947
1948         Reviewed by Oliver.
1949
1950         Remove helper functions in the parser that are no longer needed.
1951
1952         * kjs/grammar.y:
1953
1954 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1955
1956         Reviewed by Oliver.
1957
1958         Bug 19484: More instructions needs to use temporary registers
1959         <https://bugs.webkit.org/show_bug.cgi?id=19484>
1960
1961         Make code generation for AddNode and SubNode use temporaries when
1962         necessary.
1963
1964         * kjs/grammar.y:
1965         * kjs/nodes.cpp:
1966         (KJS::AddNode::emitCode):
1967         (KJS::SubNode::emitCode):
1968         * kjs/nodes.h:
1969         (KJS::AddNode::):
1970         (KJS::SubNode::):
1971
1972 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1973
1974         Reviewed by Maciej.
1975
1976         Combine TrueNode and FalseNode to make BooleanNode, and remove the
1977         unused class PlaceholderTrueNode.
1978
1979         * kjs/grammar.y:
1980         * kjs/nodes.cpp:
1981         (KJS::BooleanNode::emitCode):
1982         * kjs/nodes.h:
1983         (KJS::BooleanNode::):
1984         (KJS::BooleanNode::precedence):
1985         * kjs/nodes2string.cpp:
1986         (KJS::BooleanNode::streamTo):
1987
1988 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1989
1990         Reviewed by Maciej.
1991
1992         Eliminate the use of temporaries to store the left hand side of an
1993         expression when the right hand side is a constant. This slightly
1994         improves the generated bytecode for a few SunSpider tests, but it is
1995         mostly in preparation for fixing
1996
1997         Bug 19484: More instructions needs to use temporary registers
1998         <https://bugs.webkit.org/show_bug.cgi?id=19484>
1999
2000         * VM/CodeGenerator.h:
2001         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2002         (KJS::CodeGenerator::emitNodeForLeftHandSide):
2003         * kjs/nodes.cpp:
2004         (KJS::BracketAccessorNode::emitCode):
2005         (KJS::ReadModifyResolveNode::emitCode):
2006         (KJS::AssignDotNode::emitCode):
2007         (KJS::ReadModifyDotNode::emitCode):
2008         (KJS::AssignBracketNode::emitCode):
2009         (KJS::ReadModifyBracketNode::emitCode):
2010         * kjs/nodes.h:
2011         (KJS::ExpressionNode::):
2012         (KJS::FalseNode::):
2013         (KJS::TrueNode::):
2014         (KJS::NumberNode::):
2015         (KJS::StringNode::):
2016
2017 2008-06-13  Maciej Stachowiak  <mjs@apple.com>
2018
2019         Reviewed by Oliver.
2020         
2021         - prettify opcode stats output
2022         
2023         I changed things to be a bit more aligned, also there is a new
2024         section listing most common opcodes and most common sequences that
2025         include them.
2026
2027         * VM/Opcode.cpp:
2028         (KJS::OpcodeStats::~OpcodeStats):
2029         * VM/Opcode.h:
2030
2031 2008-06-13  Kevin McCullough  <kmccullough@apple.com>
2032
2033         Reviewed by Geoff.
2034
2035         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
2036         profiler.
2037         - Remove recursion from exclude().  This leaves only focus() to fix.
2038
2039         * JavaScriptCore.exp: Change the signatures of the exported functions.
2040         * profiler/Profile.cpp:
2041         (KJS::Profile::forEach): I added a traverseNextNodePreOrder() function
2042         and so needed to distinguish the other function by labeling it
2043         traverseNextNodePostOrder().
2044         (KJS::Profile::exclude): All new exclude that iteratively walks the tree
2045         * profiler/Profile.h:
2046         (KJS::Profile::focus): Add a null check for m_head.
2047         * profiler/ProfileNode.cpp:
2048         (KJS::ProfileNode::traverseNextNodePostOrder): Renamed
2049         (KJS::ProfileNode::traverseNextNodePreOrder): Walks the tree in pre-
2050         order, where the parent is processed before the children.
2051         (KJS::ProfileNode::setTreeVisible): Iterate over the sub-tree and set
2052         all of the nodes visible value.  This changes another function that used
2053         recursion.
2054         (KJS::ProfileNode::exclude): Remove recursion from this function.
2055         Because we now check for m_visible and we are walking the tree in pre-
2056         order we do not need to check if an excluded node is in an excluded
2057         sub-tree.
2058         * profiler/ProfileNode.h: Added specific selfTime functions to
2059         facilitate exclude().
2060         (KJS::ProfileNode::setSelfTime):
2061         (KJS::ProfileNode::setActualSelfTime):
2062         (KJS::ProfileNode::setVisibleSelfTime):
2063
2064 2008-06-12  Darin Adler  <darin@apple.com>
2065
2066         Reviewed by Maciej.
2067
2068         - https://bugs.webkit.org/show_bug.cgi?id=19434
2069           speed up SunSpider by avoiding some string boxing
2070
2071         Speeds up SunSpider by 1.1%.
2072
2073         Optimized code path for getting built-in properties from strings -- avoid
2074         boxing with a string object in that case. We can make further changes to avoid
2075         even more boxing, but this change alone is a win.
2076
2077         * API/JSCallbackObjectFunctions.h:
2078         (KJS::JSCallbackObject::staticValueGetter): Use isObject instead of inherits
2079         in asssert, since the type of slotBase() is now JSValue, not JSObject.
2080         (KJS::JSCallbackObject::staticFunctionGetter): Ditto.
2081         (KJS::JSCallbackObject::callbackGetter): Ditto.
2082
2083         * kjs/internal.cpp:
2084         (KJS::StringImp::getPrimitiveNumber): Updated for change of data member name.
2085         (KJS::StringImp::toBoolean): Ditto.
2086         (KJS::StringImp::toNumber): Ditto.
2087         (KJS::StringImp::toString): Ditto.
2088         (KJS::StringInstance::create): Added; avoids a bit of cut and paste code.
2089         (KJS::StringImp::toObject): Use StringInstance::create.
2090         (KJS::StringImp::toThisObject): Ditto.
2091         (KJS::StringImp::lengthGetter): Added. Replaces the getter that used to live in
2092         the StringInstance class.
2093         (KJS::StringImp::indexGetter): Ditto.
2094         (KJS::StringImp::indexNumericPropertyGetter): Ditto.
2095         (KJS::StringImp::getOwnPropertySlot): Added. Deals with built in properties of
2096         the string class without creating a StringInstance.
2097
2098         * kjs/internal.h:
2099         (KJS::StringImp::getStringPropertySlot): Added. To be used by both the string
2100         and string object getOwnPropertySlot function.
2101
2102         * kjs/lookup.h:
2103         (KJS::staticFunctionGetter): Updated since slotBase() is now a JSValue rather
2104         than a JSObject.
2105
2106         * kjs/object.h: Removed PropertySlot::slotBase() function, which can now move
2107         back into property_slot.h where it belongs since it doesn't have to cast to
2108         JSObject*.
2109
2110         * kjs/property_slot.cpp:
2111         (KJS::PropertySlot::functionGetter): Updated since slot.slotBase() is now a JSValue*
2112         instead of JSObject*. setGetterSlot still guarantees the base is a JSObject*.
2113         * kjs/property_slot.h:
2114         (KJS::PropertySlot::PropertySlot): Changed base to JSValue* intead of JSCell*.
2115         (KJS::PropertySlot::setStaticEntry): Ditto.
2116         (KJS::PropertySlot::setCustom): Ditto.
2117         (KJS::PropertySlot::setCustomIndex): Ditto.
2118         (KJS::PropertySlot::setCustomNumeric): Ditto.
2119         (KJS::PropertySlot::slotBase): Moved inline here since it no longer involves a
2120         downcast to JSObject*.
2121         (KJS::PropertySlot::setBase): Changed to JSValue*.
2122
2123         * kjs/string_object.cpp:
2124         (KJS::StringInstance::getOwnPropertySlot): Changed to use getStringPropertySlot
2125         instead of coding the properties here. This allows sharing the code with StringImp.
2126
2127         * kjs/string_object.h: Removed inlineGetOwnPropertySlot, lengthGetter, and indexGetter.
2128         Made one of the constructors protected.
2129
2130         * kjs/value.h: Made getOwnPropertySlot private in the JSCell class -- this is better
2131         since it's not the real JSObject getOwnPropertySlot semantic and most callers shouldn't
2132         use it.
2133
2134 2008-06-12  Alexey Proskuryakov  <ap@webkit.org>
2135
2136         Reviewed by Maciej.
2137
2138         Preparation to making JavaScript heap per-thread.
2139
2140         * kjs/collector.cpp:
2141         (KJS::Collector::collect):
2142         * kjs/collector.h:
2143         (KJS::Collector::markListSet):
2144         The collector now holds the list of protected lists itself, to be made per-instance.
2145
2146         * kjs/list.h: Changed to hold a pointer to a mark set this list is in, if any.
2147         (KJS::List::List): Explicitly initialize m_size with zero, as m_vector.size() is
2148         guaranteed to be such anyway.
2149         (KJS::List::append): Changed the fast case to only be executed as long as inline buffer
2150         is used, because otherwise, we now do more expensive checks.
2151
2152         * kjs/list.cpp:
2153         (KJS::List::markLists): Renamed from markProtectedListsSlowCase, made it take the list set
2154         as a parameter.
2155         (KJS::List::slowAppend): If a non-immediate value is appended, the list needs to be added
2156         to an appropriate Heap's protected list. For now, a static Collector::markListSet() is
2157         used, but the code is layed out in preparation to making the switch to multiple heaps.
2158
2159         * JavaScriptCore.exp: Updated export list.
2160
2161 2008-06-12  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2162
2163         Reviewed by Maciej.
2164
2165         Bug 19510: CodeBlock::needsFullScopeChain not always set for global code
2166         <https://bugs.webkit.org/show_bug.cgi?id=19510>
2167
2168         This fixes the symptoms by using CodeGenerator::m_codeType to determine
2169         when to use temporaries instead of CodeBlock::needsFullScopeChain, but
2170         it does not fix the problem itself.
2171
2172         * VM/CodeGenerator.h:
2173         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2174
2175 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2176
2177         Reviewed by Maciej.
2178
2179         Bug 19498: REGRESSION (r34497): crash while loading GMail
2180         <https://bugs.webkit.org/show_bug.cgi?id=19498>
2181
2182         * VM/CodeGenerator.cpp:
2183         (KJS::CodeGenerator::emitJumpIfTrueMayCombine):
2184         (KJS::CodeGenerator::emitJumpIfTrue):
2185         * VM/CodeGenerator.h:
2186         * kjs/nodes.cpp:
2187         (KJS::DoWhileNode::emitCode):
2188         (KJS::WhileNode::emitCode):
2189         (KJS::ForNode::emitCode):
2190         (KJS::CaseBlockNode::emitCodeForBlock):
2191
2192 2008-06-11  Darin Adler  <darin@apple.com>
2193
2194         Reviewed by Maciej.
2195
2196         - a little bit of cleanup and prep for some upcoming optimizations
2197
2198         * JavaScriptCore.exp: Re-sorted this file (with sort command line tool).
2199         * VM/CodeBlock.cpp:
2200         (KJS::CodeBlock::dump): Fixed printf to avoid warnings -- to use %lu we
2201         need to make sure the type is unsigned long.
2202         * kjs/object.cpp:
2203         (KJS::Error::create): Eliminated unused error names array, and also put
2204         the strings into the code since there was already a switch statment.
2205         This also avoids having to contemplate a hypothetical access past the
2206         end of the array.
2207         * kjs/object.h: Got rid of errorNames.
2208         * kjs/property_slot.cpp: Deleted unused ungettableGetter.
2209         * kjs/property_slot.h: Ditto.
2210         * wtf/AlwaysInline.h: Added LIKELY alongside UNLIKELY.
2211
2212 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2213
2214         Reviewed by Darin.
2215
2216         Bug 19457: Create fused opcodes for tests and conditional jumps
2217         <https://bugs.webkit.org/show_bug.cgi?id=19457>
2218
2219         Add a new jless instruction, and modify the code generator to emit it
2220         instead of the pair (less, jtrue).
2221
2222         Gives a 3.6% improvement on SunSpider.
2223
2224         * VM/CodeBlock.cpp:
2225         (KJS::CodeBlock::dump):
2226         * VM/CodeGenerator.cpp:
2227         (KJS::CodeGenerator::CodeGenerator):
2228         (KJS::CodeGenerator::emitOpcode):
2229         (KJS::CodeGenerator::retrieveLastBinaryOp):
2230         (KJS::CodeGenerator::rewindBinaryOp):
2231         (KJS::CodeGenerator::emitJump):
2232         (KJS::CodeGenerator::emitJumpIfTrue):
2233         (KJS::CodeGenerator::emitJumpIfFalse):
2234         (KJS::CodeGenerator::emitMove):
2235         (KJS::CodeGenerator::emitNot):
2236         (KJS::CodeGenerator::emitEqual):
2237         (KJS::CodeGenerator::emitNotEqual):
2238         (KJS::CodeGenerator::emitStrictEqual):
2239         (KJS::CodeGenerator::emitNotStrictEqual):
2240         (KJS::CodeGenerator::emitLess):
2241         (KJS::CodeGenerator::emitLessEq):
2242         (KJS::CodeGenerator::emitPreInc):
2243         (KJS::CodeGenerator::emitPreDec):
2244         (KJS::CodeGenerator::emitPostInc):
2245         (KJS::CodeGenerator::emitPostDec):
2246         (KJS::CodeGenerator::emitToJSNumber):
2247         (KJS::CodeGenerator::emitNegate):
2248         (KJS::CodeGenerator::emitAdd):
2249         (KJS::CodeGenerator::emitMul):
2250         (KJS::CodeGenerator::emitDiv):
2251         (KJS::CodeGenerator::emitMod):
2252         (KJS::CodeGenerator::emitSub):
2253         (KJS::CodeGenerator::emitLeftShift):
2254         (KJS::CodeGenerator::emitRightShift):
2255         (KJS::CodeGenerator::emitUnsignedRightShift):
2256         (KJS::CodeGenerator::emitBitAnd):
2257         (KJS::CodeGenerator::emitBitXOr):
2258         (KJS::CodeGenerator::emitBitOr):
2259         (KJS::CodeGenerator::emitBitNot):
2260         (KJS::CodeGenerator::emitInstanceOf):
2261         (KJS::CodeGenerator::emitTypeOf):
2262         (KJS::CodeGenerator::emitIn):
2263         (KJS::CodeGenerator::emitLoad):
2264         (KJS::CodeGenerator::emitNewObject):
2265         (KJS::CodeGenerator::emitNewArray):
2266         (KJS::CodeGenerator::emitResolve):
2267         (KJS::CodeGenerator::emitGetScopedVar):
2268         (KJS::CodeGenerator::emitPutScopedVar):
2269         (KJS::CodeGenerator::emitResolveBase):
2270         (KJS::CodeGenerator::emitResolveWithBase):
2271         (KJS::CodeGenerator::emitResolveFunction):
2272         (KJS::CodeGenerator::emitGetById):
2273         (KJS::CodeGenerator::emitPutById):
2274         (KJS::CodeGenerator::emitPutGetter):
2275         (KJS::CodeGenerator::emitPutSetter):
2276         (KJS::CodeGenerator::emitDeleteById):
2277         (KJS::CodeGenerator::emitGetByVal):
2278         (KJS::CodeGenerator::emitPutByVal):
2279         (KJS::CodeGenerator::emitDeleteByVal):
2280         (KJS::CodeGenerator::emitPutByIndex):
2281         (KJS::CodeGenerator::emitNewFunction):
2282         (KJS::CodeGenerator::emitNewRegExp):
2283         (KJS::CodeGenerator::emitNewFunctionExpression):
2284         (KJS::CodeGenerator::emitCall):
2285         (KJS::CodeGenerator::emitReturn):
2286         (KJS::CodeGenerator::emitEnd):
2287         (KJS::CodeGenerator::emitConstruct):
2288         (KJS::CodeGenerator::emitPushScope):
2289         (KJS::CodeGenerator::emitPopScope):
2290         (KJS::CodeGenerator::emitDebugHook):
2291         (KJS::CodeGenerator::emitComplexJumpScopes):
2292         (KJS::CodeGenerator::emitJumpScopes):
2293         (KJS::CodeGenerator::emitNextPropertyName):
2294         (KJS::CodeGenerator::emitGetPropertyNames):
2295         (KJS::CodeGenerator::emitCatch):
2296         (KJS::CodeGenerator::emitThrow):
2297         (KJS::CodeGenerator::emitNewError):
2298         (KJS::CodeGenerator::emitJumpSubroutine):
2299         (KJS::CodeGenerator::emitSubroutineReturn):
2300         * VM/CodeGenerator.h:
2301         * VM/Machine.cpp:
2302         (KJS::Machine::privateExecute):
2303         * VM/Opcode.cpp:
2304         * VM/Opcode.h:
2305
2306 2008-06-11  Darin Adler  <darin@apple.com>
2307
2308         Reviewed by Alexey.
2309
2310         - fix https://bugs.webkit.org/show_bug.cgi?id=19442
2311           JavaScript array implementation doesn't maintain m_numValuesInVector when sorting
2312
2313         * kjs/array_instance.cpp:
2314         (KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
2315         consistency checks are turned off.
2316         (KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
2317         (KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
2318         (KJS::ArrayInstance::put): Check consistency before and after.
2319         (KJS::ArrayInstance::deleteProperty): Ditto.
2320         (KJS::ArrayInstance::setLength): Ditto.
2321         (KJS::compareByStringPairForQSort): Use typedef for clarity.
2322         (KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
2323         to set up sorting into two separate passes. Added FIXMEs about various exception
2324         safety issues. Added code to set m_numValuesInVector after sorting.
2325         (KJS::ArrayInstance::compactForSorting): Ditto.
2326
2327         * kjs/array_instance.h: Added a definition of an enum for the types of consistency
2328         check and a declaration of the consistency checking function.
2329
2330 2008-06-10  Kevin Ollivier  <kevino@theolliviers.com>
2331
2332         wx build fix. Link against libedit on Mac since HAVE(READLINE) is defined there.
2333
2334         * jscore.bkl:
2335
2336 2008-06-10  Alexey Proskuryakov  <ap@webkit.org>
2337
2338         Reviewed by Darin.
2339
2340         https://bugs.webkit.org/show_bug.cgi?id=16503
2341         match limit takes at least 13% of the time on the SunSpider regexp-dna test
2342
2343         Make the limit test slightly more efficient. It is not clear how much of a win it is,
2344         as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
2345         apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
2346         0.5%, due to random code generation changes.
2347
2348         * pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
2349
2350 2008-06-09  Alp Toker  <alp@nuanti.com>
2351
2352         gcc3/autotools build fix. Add explicit -O2 -fno-strict-aliasing to
2353         each of the tools since these are no longer set globally.
2354
2355         * GNUmakefile.am:
2356
2357 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2358
2359         Reviewed by Sam.
2360
2361         Add an include for readline/history.h to fix the build for Darwin users
2362         with the GNU readline library installed. Also, clean up the style of
2363         the HAVE(READLINE) check.
2364
2365         * kjs/testkjs.cpp:
2366         (runInteractive):
2367
2368 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2369
2370         Reviewed by Darin.
2371
2372         Bug 17531: Add interactive mode to testkjs
2373         <https://bugs.webkit.org/show_bug.cgi?id=17531>
2374
2375         This is a cleaned up version of Sam's earlier patch to add an
2376         interactive mode to testkjs.
2377
2378         Readline support is only enabled on Darwin platforms for now, but
2379         other ports can enable it by defining HAVE_READLINE in kjs/config.h.
2380
2381         * JavaScriptCore.xcodeproj/project.pbxproj:
2382         * kjs/config.h:
2383         * kjs/testkjs.cpp:
2384         (Options::Options):
2385         (runWithScripts):
2386         (runInteractive):
2387         (printUsageStatement):
2388         (parseArguments):
2389         (kjsmain):
2390
2391 2008-06-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2392
2393         Reviewed by Darin.
2394
2395         Bug 19346: REGRESSION: Mootools 1.2 Class inheritance broken in post-SquirrelFish merge
2396         <https://bugs.webkit.org/show_bug.cgi?id=19346>
2397
2398         A check for whether a function's caller is eval code accidentally included
2399         the case where the caller's caller is native code. Add a CodeType field to
2400         CodeBlock and use this for the eval caller test instead.
2401
2402         * VM/CodeBlock.h:
2403         (KJS::CodeBlock::CodeBlock):
2404         (KJS::ProgramCodeBlock::ProgramCodeBlock):
2405         (KJS::EvalCodeBlock::EvalCodeBlock):
2406         * VM/Machine.cpp:
2407         (KJS::getCallerFunctionOffset):
2408         * kjs/nodes.cpp:
2409         (KJS::FunctionBodyNode::generateCode):
2410         (KJS::ProgramNode::generateCode):
2411
2412 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2413
2414         Reviewed by Dan Bernstein.
2415
2416         Bug 17928: testkjs shouldn't require "-f"
2417         <https://bugs.webkit.org/show_bug.cgi?id=17928>
2418
2419         * kjs/testkjs.cpp:
2420         (printUsageStatement):
2421         (parseArguments):
2422
2423 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2424
2425         Reviewed by Eric.
2426
2427         Bug 17548: JavaScriptCore print(a, b) differs from Spidermonkey Behavior
2428         <https://bugs.webkit.org/show_bug.cgi?id=17548>
2429
2430         * kjs/testkjs.cpp:
2431         (functionPrint):
2432
2433 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2434
2435         Reviewed by Sam.
2436
2437         Bug 17547: JavaScriptCore print() differs from Spidermonkey Behavior
2438         <https://bugs.webkit.org/show_bug.cgi?id=17547>
2439
2440         * kjs/testkjs.cpp:
2441         (functionPrint):
2442
2443 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
2444
2445         More build fixes.
2446
2447         * kjs/JSGlobalData.cpp: Fixed an included file name for case-sensitive file systems, fixed
2448         JSGlobalData::threadInstance() for non-multithreaded builds.
2449
2450 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
2451
2452         Build fix - actually adding JSGlobalData.cpp to non-Mac builds!
2453
2454         * GNUmakefile.am:
2455         * JavaScriptCore.pri:
2456         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2457         * JavaScriptCoreSources.bkl:
2458
2459 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
2460
2461         Try to fix Gtk/gcc 4.3 build.
2462
2463         * kjs/JSGlobalData.h: Include ustring.h instead of forward-declaring UString::Rep.
2464
2465 2008-06-06  Alexey Proskuryakov  <ap@webkit.org>
2466
2467         Reviewed by Darin.
2468
2469         Combine per-thread objects into one, to make it easier to support legacy clients (for
2470         which they shouldn't be really per-thread).
2471
2472         No change on SunSpider total.
2473
2474         * JavaScriptCore.xcodeproj/project.pbxproj: Added JSGlobalData.{h,cpp}
2475
2476         * kjs/JSGlobalData.cpp: Added.
2477         (KJS::JSGlobalData::JSGlobalData):
2478         (KJS::JSGlobalData::~JSGlobalData):
2479         (KJS::JSGlobalData::threadInstance):
2480         * kjs/JSGlobalData.h: Added.
2481         This class encapsulates all data that should be per-thread (or shared between legacy clients).
2482         It will also keep a Heap pointer, but right now, Heap (Collector) methods are all static.
2483
2484         * kjs/identifier.h:
2485         (KJS::Identifier::Identifier):
2486         Added a constructor explicitly taking JSGlobalData to access IdentifierTable. Actually,
2487         all of them should, but this will be a separate patch.
2488
2489         * kjs/identifier.cpp:
2490         (KJS::IdentifierTable::literalTable):
2491         (KJS::createIdentifierTable):
2492         (KJS::deleteIdentifierTable):
2493         (KJS::Identifier::add):
2494         (KJS::Identifier::addSlowCase):
2495         Combined IdentifierTable and LiteralIdentifierTable into a single class for simplicity.
2496
2497         * kjs/grammar.y: kjsyyparse now takes JSGlobalData, not just a Lexer.
2498
2499         * kjs/nodes.cpp:
2500         (KJS::Node::Node):
2501         (KJS::EvalFunctionCallNode::emitCode):
2502         (KJS::ScopeNode::ScopeNode):
2503         Changed to access Lexer and Parser via JSGlobalData::threadInstance(). This is also a
2504         temporary measure, they will need to use JSGlobalData explicitly.
2505
2506         * VM/CodeGenerator.cpp:
2507         (KJS::CodeGenerator::CodeGenerator):
2508         * VM/CodeGenerator.h:
2509         * VM/Machine.cpp:
2510         (KJS::callEval):
2511         * kjs/CommonIdentifiers.cpp:
2512         (KJS::CommonIdentifiers::CommonIdentifiers):
2513         * kjs/CommonIdentifiers.h:
2514         * kjs/DebuggerCallFrame.cpp:
2515         (KJS::DebuggerCallFrame::evaluate):
2516         * kjs/ExecState.cpp:
2517         (KJS::ExecState::ExecState):
2518         * kjs/ExecState.h:
2519         (KJS::ExecState::globalData):
2520         (KJS::ExecState::identifierTable):
2521         (KJS::ExecState::propertyNames):
2522         (KJS::ExecState::emptyList):
2523         (KJS::ExecState::lexer):
2524         (KJS::ExecState::parser):
2525         (KJS::ExecState::arrayTable):
2526         (KJS::ExecState::dateTable):
2527         (KJS::ExecState::mathTable):
2528         (KJS::ExecState::numberTable):
2529         (KJS::ExecState::RegExpImpTable):
2530         (KJS::ExecState::RegExpObjectImpTable):
2531         (KJS::ExecState::stringTable):
2532         * kjs/InitializeThreading.cpp:
2533         (KJS::initializeThreadingOnce):
2534         * kjs/JSGlobalObject.cpp:
2535         (KJS::JSGlobalObject::init):
2536         * kjs/JSGlobalObject.h:
2537         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
2538         (KJS::JSGlobalObject::head):
2539         (KJS::JSGlobalObject::globalData):
2540         * kjs/Parser.cpp:
2541         (KJS::Parser::parse):
2542         * kjs/Parser.h:
2543         * kjs/function.cpp:
2544         (KJS::FunctionImp::getParameterName):
2545         (KJS::IndexToNameMap::unMap):
2546         (KJS::globalFuncEval):
2547         * kjs/function_object.cpp:
2548         (KJS::FunctionObjectImp::construct):
2549         * kjs/interpreter.cpp:
2550         (KJS::Interpreter::checkSyntax):
2551         (KJS::Interpreter::evaluate):
2552         * kjs/lexer.cpp:
2553         (kjsyylex):
2554         * kjs/lexer.h:
2555         * kjs/testkjs.cpp:
2556         (prettyPrintScript):
2557         Updated for the above changes. Most of threadInstance uses here will need to be replaced with
2558         explicitly passed pointers to support legacy JSC clients.
2559
2560         * JavaScriptCore.exp: Removed KJS::parser().
2561
2562 2008-06-06  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2563
2564         Reviewed by Oliver.
2565
2566         Bug 19424: Add support for logging opcode pair counts
2567         <https://bugs.webkit.org/show_bug.cgi?id=19424>
2568
2569         * VM/Machine.cpp:
2570         (KJS::Machine::privateExecute):
2571         * VM/Opcode.cpp:
2572         (KJS::OpcodeStats::OpcodeStats):
2573         (KJS::compareOpcodeIndices):
2574         (KJS::compareOpcodePairIndices):
2575         (KJS::OpcodeStats::~OpcodeStats):
2576         (KJS::OpcodeStats::recordInstruction):
2577         (KJS::OpcodeStats::resetLastInstruction):
2578         * VM/Opcode.h:
2579
2580 2008-06-06  Kevin McCullough  <kmccullough@apple.com>
2581
2582         Reviewed by Adam.
2583
2584         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
2585         profiler.
2586         - Change the remaining functions that do not take arguments, from using
2587         recursion to using iteration.
2588
2589         * JavaScriptCore.exp:
2590         * profiler/Profile.cpp:
2591         (KJS::stopProfiling):
2592         (KJS::restoreAll):
2593         (KJS::Profile::stopProfiling): Use foreach instead of recursion.
2594         (KJS::Profile::restoreAll): Ditto.
2595         * profiler/Profile.h:
2596         * profiler/ProfileNode.cpp: Remove recursion.
2597         (KJS::ProfileNode::stopProfiling):
2598         (KJS::ProfileNode::restore):
2599         * profiler/ProfileNode.h:
2600
2601 2008-06-05  Oliver Hunt  <oliver@apple.com>
2602
2603         Reviewed by Alexey.
2604
2605         Fix Greater and GreaterEq nodes to emit code for the left
2606         and right sub-expressions in the correct order.
2607
2608         * kjs/nodes.cpp:
2609         (KJS::GreaterNode::emitCode):
2610         (KJS::GreaterEqNode::emitCode):
2611
2612 2008-06-05  Antti Koivisto  <antti@apple.com>
2613
2614         Reviewed by Alp Toker.
2615         
2616         Fix whitespaces.
2617
2618         * kjs/collector.cpp:
2619         (KJS::getPlatformThreadRegisters):
2620
2621 2008-06-05  Antti Koivisto  <antti@apple.com>
2622
2623         Reviewed by Darin.
2624         
2625         Support compiling JavaScriptCore for ARM.
2626
2627         * kjs/collector.cpp:
2628         (KJS::getPlatformThreadRegisters):
2629         (KJS::otherThreadStackPointer):
2630
2631 2008-06-05  Kevin McCullough  <kmccullough@apple.com>
2632
2633         Reviewed by Jon.
2634
2635         - Name changes.
2636
2637         * JavaScriptCore.exp:
2638         * profiler/Profile.cpp:
2639         (KJS::Profile::Profile):
2640         (KJS::Profile::stopProfiling):
2641         (KJS::Profile::didExecute):
2642         (KJS::Profile::forEach):
2643         (KJS::Profile::debugPrintData):
2644         (KJS::Profile::debugPrintDataSampleStyle):
2645         * profiler/Profile.h:
2646         (KJS::Profile::callTree):
2647         (KJS::Profile::totalTime):
2648         (KJS::Profile::sortTotalTimeDescending):
2649         (KJS::Profile::sortTotalTimeAscending):
2650         (KJS::Profile::sortSelfTimeDescending):
2651         (KJS::Profile::sortSelfTimeAscending):
2652         (KJS::Profile::sortCallsDescending):
2653         (KJS::Profile::sortCallsAscending):
2654         (KJS::Profile::sortFunctionNameDescending):
2655         (KJS::Profile::sortFunctionNameAscending):
2656         (KJS::Profile::focus):
2657         (KJS::Profile::exclude):
2658         (KJS::Profile::restoreAll):
2659
2660 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
2661
2662         Reviewed by Stephanie Lewis.
2663
2664         Added the -fno-move-loop-invariants flag to the pcre_exec.cpp build, to
2665         tell GCC not to perform loop invariant motion, since GCC's loop
2666         invariant motion doesn't do very well with computed goto code.
2667         
2668         SunSpider reports no change.
2669
2670 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
2671
2672         Reviewed by Stephanie Lewis.
2673         
2674         Added the -fno-tree-pre flag to the Machine.cpp build, to tell GCC not
2675         to perform Partial Redundancy Elimination (PRE) on trees in Machine.cpp,
2676         since GCC's PRE doesn't do very well with computed goto code.
2677         
2678         SunSpider reports a .7% speedup.
2679         
2680 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
2681
2682         Reviewed by Stephanie Lewis (or maybe the other way around).
2683         
2684         Minor change to PCRE to help out certain compilers.
2685         
2686         SunSpider reports no change, maybe a small speedup.
2687
2688         * pcre/pcre_exec.cpp:
2689         (match): Use instructionPtr++ a little less, to avoid confusing the
2690         optimizer.
2691
2692 2008-06-05  Alexey Proskuryakov  <ap@webkit.org>
2693
2694         Re-landing an independent part of a previously rolled out threading patch.
2695
2696         * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
2697         (replaced "new T" with "new T()").
2698
2699 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
2700
2701         Reviewed by Hyatt.
2702         
2703         - force inlining of a template function that only has one call site per specialization
2704         1.3% speedup on SunSpider
2705
2706         * kjs/collector.cpp:
2707         (KJS::Collector::heapAllocate): This template function is only
2708         called from allocate() and allocateNumber() (once per
2709         specialization) and the extra call overhead for GC allocation
2710         shows up, so force inlining.
2711
2712 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
2713
2714         Reviewed by Alexey and Oliver.
2715         
2716         - remove profiler fetch hack
2717         I measure an 0.5% progression from this, others show a wash. It seems not needed any more.
2718
2719         * VM/Machine.cpp:
2720         (KJS::Machine::privateExecute):
2721
2722 2008-06-05  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2723
2724         Reviewed by Maciej.
2725
2726         Bug 19400: subscript operator does not protect base when necessary
2727         <https://bugs.webkit.org/show_bug.cgi?id=19400>
2728
2729         Use a temporary for the base in BracketAccessorNode if the subscript
2730         might possibly modify it.
2731
2732         * kjs/grammar.y:
2733         * kjs/nodes.cpp:
2734         (KJS::BracketAccessorNode::emitCode):
2735         * kjs/nodes.h:
2736         (KJS::BracketAccessorNode::):
2737
2738 2008-06-04  Sam Weinig  <sam@webkit.org>
2739
2740         Reviewed by Maciej Stachowiak.
2741
2742         Big cleanup of formatting and whitespace.
2743
2744 2008-06-04  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2745
2746         Reviewed by Oliver.
2747
2748         Add an option to dump statistics on executed instructions.
2749
2750         * VM/Machine.cpp:
2751         (KJS::Machine::privateExecute):
2752         * VM/Opcode.cpp:
2753         (KJS::OpcodeStats::~OpcodeStats):
2754         (KJS::OpcodeStats::recordInstruction):
2755         * VM/Opcode.h:
2756
2757 2008-06-04  Kevin McCullough  <kmccullough@apple.com>
2758
2759         Reviewed by Geoff.
2760
2761         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
2762         profiler.
2763         - This patch removes the use of recursion for the sort functions.
2764
2765         * JavaScriptCore.exp: Change the signatures of the functions being
2766         exported.
2767         * profiler/Profile.cpp:
2768         (KJS::Profile::sort): This generic function will accept any of the
2769         static sort functions and apply them to the whole tree.
2770         * profiler/Profile.h: All of the sorting functions now call the new
2771         sort() function.
2772         (KJS::Profile::sortTotalTimeDescending):
2773         (KJS::Profile::sortTotalTimeAscending):
2774         (KJS::Profile::sortSelfTimeDescending):
2775         (KJS::Profile::sortSelfTimeAscending):
2776         (KJS::Profile::sortCallsDescending):
2777         (KJS::Profile::sortCallsAscending):
2778         (KJS::Profile::sortFunctionNameDescending):
2779         (KJS::Profile::sortFunctionNameAscending):
2780         * profiler/ProfileNode.cpp:
2781         (KJS::ProfileNode::ProfileNode): m_head used to point to the head node
2782         if this was the head node.  It now points to null to make iteration easy
2783         (KJS::ProfileNode::willExecute): Now must check if m_head is null, this
2784         check used to happend in the constructor.
2785         (KJS::ProfileNode::stopProfiling): Again the check is slightly different
2786         to determine if this is the head.
2787         (KJS::ProfileNode::traverseNextNode): This function returns the next
2788         node in post order.
2789         (KJS::ProfileNode::sort): This generic function will sort according to
2790         the comparator passed in, then reset the children pointers to macth the
2791         new order.
2792         * profiler/ProfileNode.h: The sorting function were removed from the
2793         definition file and instead use the new generic sort() function
2794         (KJS::ProfileNode::totalPercent): because the head can now be empty we
2795         need to check here too for the head node.
2796         (KJS::ProfileNode::selfPercent): Ditto
2797         (KJS::ProfileNode::firstChild): This function is necessary for the 
2798         iterative algorithm in Profile.cpp.
2799         (KJS::ProfileNode::sortTotalTimeDescending):
2800         (KJS::ProfileNode::sortTotalTimeAscending):
2801         (KJS::ProfileNode::sortSelfTimeDescending):
2802         (KJS::ProfileNode::sortSelfTimeAscending):
2803         (KJS::ProfileNode::sortCallsDescending):
2804         (KJS::ProfileNode::sortCallsAscending):
2805         (KJS::ProfileNode::sortFunctionNameDescending):
2806         (KJS::ProfileNode::sortFunctionNameAscending):
2807         (KJS::ProfileNode::childrenBegin):
2808         (KJS::ProfileNode::childrenEnd):
2809         (KJS::ProfileNode::totalTimeDescendingComparator):
2810         (KJS::ProfileNode::totalTimeAscendingComparator):
2811         (KJS::ProfileNode::selfTimeDescendingComparator):
2812         (KJS::ProfileNode::selfTimeAscendingComparator):
2813         (KJS::ProfileNode::callsDescendingComparator):
2814         (KJS::ProfileNode::callsAscendingComparator):
2815         (KJS::ProfileNode::functionNameDescendingComparator):
2816         (KJS::ProfileNode::functionNameAscendingComparator):
2817
2818 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
2819
2820         Reviewed by Darin.
2821
2822         Fix JSClassCreate to work with old JSCore API threading model.
2823
2824         No change on SunSpider.
2825
2826         * API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): Since JSClass is constructed without
2827         a context, there is no way for it to create Identifiers.
2828         Also, added initializeThreading(), just for good measure.
2829
2830         * API/JSCallbackObjectFunctions.h: (KJS::::getPropertyNames): Make an Identifier out of the
2831         string here, because propertyNames.add() needs that.
2832
2833         * kjs/identifier.cpp:
2834         * kjs/identifier.h:
2835         (KJS::Identifier::equal):
2836         * kjs/ustring.cpp:
2837         (KJS::equal):
2838         Moved equal() from identifier.h to ustring.h, because it's not really about Identifiers,
2839         and to make it possible to use it from StrHash.
2840         Include StrHash.h from ustring.h to avoid having the behavior depend on headers that happen
2841         to be included.
2842
2843         * wtf/StrHash.h: Removed.
2844         * kjs/ustring.h: Made RefPtr<UString::Rep> use the same default hash as UString::Rep* (it
2845         used to default to pointer equality). Moved the whole StrHash header into ustring.h.
2846
2847         * JavaScriptCore.exp: Export equal() for WebCore use (this StrHash is used in c_class.cpp,
2848         jni_class.cpp, and npruntime.cpp).
2849
2850 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
2851
2852         Rubber-stamped by Darin.
2853
2854         Fix spacing in collector.{h,cpp}.
2855
2856         * kjs/collector.cpp:
2857         * kjs/collector.h:
2858
2859 2008-06-03  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2860
2861         Reviewed by Maciej.
2862
2863         Build fix. The cleanup in r34355 missed a method.
2864
2865         * kjs/nodes.cpp:
2866         * kjs/nodes.h:
2867
2868 2008-06-03  Darin Adler  <darin@apple.com>
2869
2870         Reviewed by Geoff.
2871
2872         - https://bugs.webkit.org/show_bug.cgi?id=19269
2873           speed up SunSpider by eliminating the toObject call for most get/put/delete
2874
2875         Makes standalone SunSpider 1.025x as fast as before.
2876
2877         The getOwnPropertySlot virtual function now takes care of the toObject call
2878         for get. Similarly, the put function (and later deleteProperty) does the
2879         same for those operations. To do this, the virtual functions were moved from
2880         the JSObject class to the JSCell class. Also, since the caller no longer knows
2881         the identity of the "original object", which is used by JavaScript-function
2882         based getters, changed the PropertySlot class so the original object is
2883         already stored in the slot when getOwnPropertySlot is called, if the caller
2884         intends to call getValue.
2885
2886         This affected the old interpreter code enough that the easiest thing for me
2887         was to just delete it. While I am not certain the mysterious slowdown is not
2888         still occurring, the net change is definitely a significant speedup.
2889
2890         * JavaScriptCore.exp: Updated.
2891
2892         * VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
2893         (KJS::resolve): Set up the originalObject in the PropertySlot before
2894         calling getPropertySlot. Also removed the originalObject argument from
2895         getValue.
2896         (KJS::resolve_skip): Ditto.
2897         (KJS::resolveBaseAndProperty): Ditto.
2898         (KJS::resolveBaseAndFunc): Ditto.
2899         (KJS::Machine::privateExecute): Removed the toObject calls from the get and
2900         put functions where possible, instead calling directly with JSValue and letting
2901         the JSValue and JSCell calls handle toObject. Same for toThisObject.
2902
2903         * kjs/ExecState.h: Removed OldInterpreterExecState.
2904
2905         * API/JSBase.cpp: Updated includes.
2906
2907         * kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.
2908
2909         * kjs/array_instance.cpp:
2910         (KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
2911         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
2912         setValueSlot. Also use UNLIKELY around the "getting elements past the end of
2913         the array" code path; less common than successfully getting an element.
2914
2915         * kjs/array_object.cpp:
2916         (KJS::getProperty): Initialize the PropertySlot with the original object.
2917         Don't pass the original object to the get function.
2918         (KJS::arrayProtoFuncFilter): Ditto.
2919         (KJS::arrayProtoFuncMap): Ditto.
2920         (KJS::arrayProtoFuncEvery): Ditto.
2921         (KJS::arrayProtoFuncForEach): Ditto.
2922         (KJS::arrayProtoFuncSome): Ditto.
2923
2924         * kjs/function_object.cpp:
2925         (KJS::FunctionObjectImp::construct): Removed an obsolete comment.
2926
2927         * kjs/grammar.y: Eliminated support for some of the node types that were
2928         used to optimize executing from the syntax tree.
2929
2930         * kjs/internal.cpp:
2931         (KJS::StringImp::toThisObject): Added. Same as toObject.
2932         (KJS::NumberImp::toThisObject): Ditto.
2933         (KJS::GetterSetterImp::getOwnPropertySlot): Added. Not reached.
2934         (KJS::GetterSetterImp::put): Ditto.
2935         (KJS::GetterSetterImp::toThisObject): Ditto.
2936
2937         * kjs/internal.h: Added toThisObject to NumberImp for speed.
2938
2939         * kjs/lexer.cpp:
2940         (KJS::Lexer::shift): Changed shift to just do a single character, to unroll
2941         the loop and especially to make the one character case faster.
2942         (KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
2943         (KJS::Lexer::lex): Ditto.
2944         (KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
2945         (KJS::Lexer::scanRegExp): Ditto.
2946         * kjs/lexer.h: Removed the count argument from shift.
2947
2948         * kjs/math_object.cpp:
2949         (KJS::mathProtoFuncPow): Call jsNaN instead of jsNumber(NaN).
2950
2951         * kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
2952         execution model.
2953         (KJS::ForNode::emitCode): Handle cases where some expressions are missing by
2954         not emitting any code at all. The old way was to emit code for "true", but
2955         this is an unnecessary remnant of the old way of doing things.
2956
2957         * kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
2958         execution model.
2959
2960         * kjs/object.cpp:
2961         (KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
2962         function. The old code passed in a base, but it was never used when
2963         actually getting the property; the toThisObject call was pointless. Also
2964         changed to not pass a base for setUndefined.
2965
2966         * kjs/object.h: Added the new JSCell operations to GetterSetterImp.
2967         Never called.
2968         (KJS::JSObject::get): Initialize the object in the PropertySlot and don't
2969         pass it in getValue.
2970         (KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
2971         in calls to setValueSlot.
2972         (KJS::JSObject::getOwnPropertySlot): Ditto.
2973         (KJS::JSValue::get): Added. Here because it calls through to JSObject.
2974         A version of JSObject::get that also handles the other types of JSValue
2975         by creating the appropriate wrapper. Saves the virtual call to toObject.
2976         (KJS::JSValue::put): Ditto.
2977         (KJS::JSValue::deleteProperty): Ditto.
2978
2979         * kjs/property_slot.cpp:
2980         (KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
2981         (KJS::PropertySlot::ungettableGetter): Ditto.
2982         (KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
2983         as the "this" object, which will be set to the original object by the new
2984         PropertySlot initialization code. Also call toThisObject. The old code did
2985         not do this, but needed to so we can properly handle the activation object
2986         like the other similar code paths.
2987
2988         * kjs/property_slot.h:
2989         (KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
2990         object. In debug builds, set the base to 0 if you don't pass one.
2991         (KJS::PropertySlot::getValue): Don't take or pass the originalObject.
2992         (KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
2993         base object in debug builds.
2994         (KJS::PropertySlot::setGetterSlot): Ditto.
2995         (KJS::PropertySlot::setUndefined): Ditto.
2996         (KJS::PropertySlot::setUngettable): Ditto.
2997         (KJS::PropertySlot::slotBase): Assert that a base object is present.
2998         This will fire if someone actually calls the get function without having
2999         passed in a base object and the getter needs it.
3000         (KJS::PropertySlot::setBase): Added. Used by the code that implements
3001         toObject so it can supply the original object after the fact.
3002         (KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
3003         code because it's an error to fetch the base if you don't have a guarantee
3004         it was set.
3005
3006         * API/JSCallbackObject.h:
3007         * API/JSCallbackObjectFunctions.h:
3008         (KJS::JSCallbackObject::cachedValueGetter):
3009         (KJS::JSCallbackObject::staticValueGetter):
3010         (KJS::JSCallbackObject::staticFunctionGetter):
3011         (KJS::JSCallbackObject::callbackGetter):
3012         * kjs/JSActivation.cpp:
3013         (KJS::JSActivation::getOwnPropertySlot):
3014         (KJS::JSActivation::argumentsGetter):
3015         * kjs/JSActivation.h:
3016         * kjs/JSVariableObject.h:
3017         (KJS::JSVariableObject::symbolTableGet):
3018         * kjs/array_instance.h:
3019         * kjs/function.cpp:
3020         (KJS::FunctionImp::argumentsGetter):
3021         (KJS::FunctionImp::callerGetter):
3022         (KJS::FunctionImp::lengthGetter):
3023         (KJS::Arguments::mappedIndexGetter):
3024         * kjs/function.h:
3025         * kjs/lookup.h:
3026         (KJS::staticFunctionGetter):
3027         (KJS::staticValueGetter):
3028         * kjs/string_object.cpp:
3029         (KJS::StringInstance::lengthGetter):
3030         (KJS::StringInstance::indexGetter):
3031         (KJS::stringInstanceNumericPropertyGetter):
3032         * kjs/string_object.h:
3033         Removed originalObject arguments from getters. Don't pass base values to
3034         the various PropertySlot functions that no longer take them.
3035
3036         * kjs/value.cpp:
3037         (KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
3038         This function has to always return true, because the caller can't walk the prototype
3039         chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
3040         for the caller. This is private, only called by getOwnPropertySlotInternal.
3041         (KJS::JSCell::put): Added. Calls toObject and then put.
3042         (KJS::JSCell::toThisObject): Added. Calls toObject.
3043
3044         * kjs/value.h: Added get, put, and toThisObject to both JSValue
3045         and JSCell. These take care of the toObject operation without an additional virtual
3046         function call, and so make the common "already an object" case faster.
3047
3048         * wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
3049         better place later, or rename this header.
3050
3051 2008-06-03  Oliver Hunt  <oliver@apple.com>
3052
3053         Reviewed by Tim.
3054
3055         Bug 12983: Web Inspector break on the debugger keyword
3056         <https://bugs.webkit.org/show_bug.cgi?id=12983>
3057
3058         Added a DebuggerStatementNode to handle codegen, and added a new
3059         DidReachBreakPoint debug event (which will hopefully be useful
3060         if we ever move breakpoint management into JSC proper).  Also
3061         added didReachBreakpoint to Debugger to allow us to actually respond
3062         to this event.
3063
3064         * VM/CodeBlock.cpp:
3065         (KJS::debugHookName):
3066         * VM/Machine.cpp:
3067         (KJS::Machine::debug):
3068         * VM/Machine.h:
3069         * kjs/debugger.h:
3070         * kjs/grammar.y:
3071         * kjs/nodes.cpp:
3072         (KJS::DebuggerStatementNode::emitCode):
3073         (KJS::DebuggerStatementNode::execute):
3074         * kjs/nodes.h:
3075         (KJS::DebuggerStatementNode::):
3076         * kjs/nodes2string.cpp:
3077         (KJS::DebuggerStatementNode::streamTo):
3078
3079 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
3080
3081         Reviewed by Oliver.
3082         
3083         - document remaining opcodes.
3084
3085         * VM/Machine.cpp:
3086         (KJS::Machine::privateExecute): Document call, call_eval,
3087         construct, ret and end opcodes.
3088
3089 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
3090
3091         Reviewed by Oliver.
3092
3093         * VM/Machine.cpp:
3094         (KJS::Machine::privateExecute): Document throw and catch opcodes.
3095
3096 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3097
3098         Reviewed by Alexey Proskuryakov.
3099
3100         Removed JSObject::call, since it just called JSObject::callAsFunction.
3101
3102         SunSpider reports no change.
3103
3104 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3105
3106         Reviewed by Darin Adler.
3107         
3108         A little cleanup in the CodeGenerator.
3109
3110         * VM/CodeGenerator.cpp: A few changes here.
3111
3112         (1) Removed remaining cases of the old hack of putting "this" into the
3113         symbol table; replaced with explicit tracking of m_thisRegister.
3114
3115         (2) Made m_thisRegister behave the same for function, eval, and program
3116         code, removing the static programCodeThis() function.
3117
3118         (3) Added a feature to nix a ScopeNode's declaration stacks when done
3119         compiling, to save memory.
3120
3121         (4) Removed code that copied eval declarations into special vectors: we
3122         just use the originals in the ScopeNode now.
3123         
3124         * VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
3125         constructor: we just use get that data from the ScopeNode now.
3126
3127         * VM/Machine.cpp:
3128         (KJS::Machine::execute): When executing an eval node, don't iterate a
3129         special copy of its declarations; iterate the originals, instead.
3130
3131         * kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
3132         away into the CodeGenerator. Nodes no longer call shrinkCapacity on
3133         their data directly.
3134         
3135         * kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
3136         data stays around even after we've thrown away the AST, unless we explicitly
3137         throw away the declaration data, too. This is useful for eval code, which
3138         needs to reference its declaration data at execution time. (Soon, it will
3139         be useful for program code, too, since program code should do the same.)
3140
3141 2008-06-02  Adam Roben  <aroben@apple.com>
3142
3143         Build fix for non-AllInOne builds
3144
3145         * kjs/array_object.cpp: Added a missing #include.
3146
3147 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
3148
3149         Took out accidental confilct lines I checked in.
3150
3151         * ChangeLog:
3152
3153 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
3154
3155         Reviewed by Darin.
3156
3157         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3158         profiler
3159         Implement Next Sibling pointers as groundwork for removing the recursion
3160         limit in the profiler.
3161
3162         * profiler/ProfileNode.cpp: Also I renamed parentNode and headNode since
3163         'node' is redundant.
3164         (KJS::ProfileNode::ProfileNode): Initialize the nextSibling.
3165         (KJS::ProfileNode::willExecute): If there are already children then the
3166         new child needs to be the nextSibling of the last child.
3167         (KJS::ProfileNode::didExecute):
3168         (KJS::ProfileNode::addChild): Ditto.
3169         (KJS::ProfileNode::stopProfiling):
3170         (KJS::ProfileNode::sortTotalTimeDescending): For all of the sorting
3171         algorithms once the children are sorted their nextSibling pointers need
3172         to be reset to reflect the new order.
3173         (KJS::ProfileNode::sortTotalTimeAscending):
3174         (KJS::ProfileNode::sortSelfTimeDescending):
3175         (KJS::ProfileNode::sortSelfTimeAscending):
3176         (KJS::ProfileNode::sortCallsDescending):
3177         (KJS::ProfileNode::sortCallsAscending):
3178         (KJS::ProfileNode::sortFunctionNameDescending):
3179         (KJS::ProfileNode::sortFunctionNameAscending):
3180         (KJS::ProfileNode::resetChildrensSiblings): This new function simply
3181         loops over all of the children and sets their nextSibling pointers to
3182         the next child in the Vector
3183         (KJS::ProfileNode::debugPrintData):
3184         * profiler/ProfileNode.h:
3185         (KJS::ProfileNode::parent):
3186         (KJS::ProfileNode::setParent):
3187         (KJS::ProfileNode::nextSibling):
3188         (KJS::ProfileNode::setNextSibling):
3189         (KJS::ProfileNode::totalPercent):
3190         (KJS::ProfileNode::selfPercent):
3191
3192 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3193
3194         Reviewed by Maciej Stachowiak.
3195
3196         Removed the recursion limit from JSObject::call, since the VM does
3197         recursion checking now.
3198
3199         This should allow us to remove JSObject::call entirely, netting a small
3200         speedup.
3201
3202         * kjs/object.cpp:
3203         (KJS::JSObject::call):
3204
3205 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3206
3207         Reviewed by Adele Peterson.
3208
3209         Added a specific affordance for avoiding stack overflow when converting
3210         recursive arrays to string, in preparation for removing generic stack
3211         overflow checking from JSObject::call.
3212         
3213         Tested by fast/js/toString-stack-overflow.html.
3214
3215 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3216
3217         Reviewed by Alice Liu.
3218         
3219         Refactored some hand-rolled code to call ScopeChain::globalObject instead.
3220
3221 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
3222
3223         Reviewed by Darin Adler.
3224         
3225         Fixed ASSERT due to execution continuing after an exception is thrown
3226         during array sort.
3227
3228         * kjs/array_instance.cpp:
3229         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): Don't call the
3230         custom comparator function if an exception has been thrown. Just return
3231         1 for everything, so the sort completes quickly. (The result will be
3232         thrown away.)
3233
3234 2008-05-30  Timothy Hatcher  <timothy@apple.com>
3235
3236         Made the starting line number of scripts be 1-based throughout the engine.
3237         This cleans up script line numbers so they are all consistent now and fixes
3238         some cases where script execution was shown as off by one line in the debugger.
3239
3240         No change in SunSpider.
3241
3242         Reviewed by Oliver Hunt.
3243
3244         * API/minidom.c:
3245         (main): Pass a line number of 1 instead of 0 to parser().parse().
3246         * API/testapi.c:
3247         (main): Ditto. And removes a FIXME and changed an assertEqualsAsNumber
3248         to use 1 instead of 2 for the line number.
3249         * VM/Machine.cpp:
3250         (KJS::callEval): Pass a line number of 1 instead of 0.
3251         (KJS::Machine::debug): Use firstLine for WillExecuteProgram instead of
3252         lastLine. Use lastLine for DidExecuteProgram instead of firstLine.
3253         * kjs/DebuggerCallFrame.cpp:
3254         (KJS::DebuggerCallFrame::evaluate): Pass a line number of 1 instead of
3255         0 to parser().parse().
3256         * kjs/Parser.cpp:
3257         (KJS::Parser::parse): ASSERT startingLineNumber is greatter than 0. Change
3258         the startingLineNumber to be 1 if it was less than or equal to 0. This is needed
3259         for release builds to maintain compatibility with the JavaScriptCore API.
3260         * kjs/function.cpp:
3261         (KJS::globalFuncEval): Pass a line number of 1 instead of 0 to parser().parse().
3262         * kjs/function_object.cpp:
3263         (FunctionObjectImp::construct): Pass a line number of 1 instead of 0 to construct().
3264         * kjs/lexer.cpp:
3265         (Lexer::setCode): Made yylineno = startingLineNumber instead of adding 1.
3266         * kjs/testkjs.cpp:
3267         (functionRun): Pass a line number of 1 instead of 0 to Interpreter::evaluate().
3268         (functionLoad): Ditto.
3269         (prettyPrintScript): Ditto.
3270         (runWithScripts): Ditto.
3271         * profiler/Profiler.cpp:
3272         (WebCore::createCallIdentifier): Removed a plus 1 of startingLineNumber.
3273
3274 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
3275
3276         Reviewed by Darin.
3277
3278         https://bugs.webkit.org/show_bug.cgi?id=19180
3279         speed up SunSpider by optimizing immediate number cases
3280
3281         Also fixed a JavaScriptCore regression seen on PowerPC - we didn't clip left shift
3282         parameter to 0...31.
3283
3284         0.5% improvement on SunSpider overall, although a 8.5 regression on bitops-3bit-bits-in-byte.
3285
3286         * VM/Machine.cpp:
3287         (KJS::Machine::privateExecute):
3288
3289         * kjs/JSImmediate.h:
3290         (KJS::JSImmediate::toTruncatedUInt32): Added. Same as getTruncatedInt32, but casts the result
3291         to unsigned.
3292
3293 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
3294
3295         Reviewed by Oliver Hunt.
3296
3297         https://bugs.webkit.org/show_bug.cgi?id=19180
3298         speed up SunSpider by optimizing immediate number cases
3299
3300         Also fixed two JavaScriptCore regressions seen on PowerPC - we didn't clip right shift
3301         parameter to 0...31.
3302
3303         1.6% improvement on SunSpider, without significant regressions on any tests.
3304
3305         * VM/Machine.cpp:
3306         (KJS::Machine::privateExecute):
3307         Added fast paths for >>, ==, ===, !=, !==. Changed order of memory accesses in many
3308         cases, making them less dependent on gcc's ability to properly assign registers. With this,
3309         I could move exception checks back into slow code paths, and saw less randomness in general.
3310
3311         * kjs/JSImmediate.h:
3312         (KJS::JSImmediate::rightShiftImmediateNumbers):
3313         Added.
3314
3315 2008-05-29  Maciej Stachowiak  <mjs@apple.com>
3316
3317         Reviewed by Oliver.
3318
3319         - fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com
3320         
3321         Finally blocks could clobber registers that had to remain live
3322         until they returned. This patch takes a conservative approach and
3323         makes sure that finally blocks do not reuse any registers that
3324         were previously allocated for the function. In the future this
3325         could probably be tightened up to be less profligate with the
3326         register allocation.
3327         
3328         * VM/CodeGenerator.cpp:
3329         (KJS::CodeGenerator::highestUsedRegister):
3330         * VM/CodeGenerator.h:
3331         * kjs/nodes.cpp:
3332         (KJS::TryNode::emitCode):
3333
3334 2008-05-29  Steve Falkenburg  <sfalken@apple.com>
3335
3336         Build fix.
3337
3338         * kjs/array_instance.cpp:
3339
3340 2008-05-29  Alexey Proskuryakov  <ap@webkit.org>
3341
3342         Reviewed by Darin.
3343
3344         https://bugs.webkit.org/show_bug.cgi?id=19294
3345         <rdar://problem/5969062> A crash when iterating over a sparse array backwards.
3346
3347         * kjs/array_instance.cpp: Turned sparseArrayCutoff into a macro, so that using max() on it
3348         doesn't cause a PIC branch.
3349         (KJS::ArrayInstance::increaseVectorLength): Added a comment about this function not
3350         preserving class invariants.
3351         (KJS::ArrayInstance::put): Update m_storage after reallocation. Move values that fit to
3352         the vector from the map in all code paths.
3353
3354 2008-05-29  Thiago Macieira  <tjmaciei@trolltech.com>
3355
3356         Reviewed by Simon.
3357
3358         Fix compilation in Solaris with Sun CC
3359
3360         Lots of WebKit code uses C99 functions that, strict as it
3361         is, the Solaris system doesn't provide in C++. So we must define them
3362         for both GCC and the Sun CC.
3363
3364         * wtf/MathExtras.h:
3365
3366 2008-05-28  Oliver Hunt  <oliver@apple.com>
3367
3368         Reviewed by Anders.
3369
3370         Fix codegen for assignment being used as a function.
3371
3372         FunctionCallValueNode::emitCode failed to account for the
3373         potential of the function expression to allocate arbitrary
3374         registers.
3375
3376         * kjs/nodes.cpp:
3377         (KJS::FunctionCallValueNode::emitCode):
3378
3379 2008-05-27  Geoffrey Garen  <ggaren@apple.com>
3380
3381         Reviewed by Tim Hatcher.
3382
3383         Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
3384         REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
3385         clicking button in returnEvent-crash.html
3386
3387         Added two new debugger hooks, willExecuteProgram and didExecuteProgram,
3388         along with code to generate them, code to invoke them when unwinding
3389         due to an exception, and code to dump them.
3390         
3391         SunSpider reports no change.
3392
3393         * VM/CodeBlock.cpp:
3394         (KJS::debugHookName): I had to mark this function NEVER_INLINE to avoid
3395         a .4% performance regression. The mind boggles.
3396
3397 2008-05-28  Adam Roben  <aroben@apple.com>
3398
3399         Fix JavaScriptCore tests on OS X
3400
3401         We were quoting the path to testkjs too late, after it had already
3402         been combined with spaces and other options.
3403
3404         * tests/mozilla/jsDriver.pl:
3405         (top level): Move path quoting from here...
3406         (sub get_kjs_engine_command): ...to here.
3407
3408 2008-05-28  Anders Carlsson  <andersca@apple.com>
3409
3410         Reviewed by Oliver.
3411
3412         <rdar://problem/5968071> "const f" crashes in JavaScriptCore
3413         
3414         Make sure to null check the initializer.
3415         
3416         * kjs/nodes.cpp:
3417         (KJS::ConstDeclNode::emitCodeSingle):
3418
3419 2008-05-28  Adam Roben  <aroben@apple.com>
3420
3421         Make run-javascriptcore-tests work with a space in the path to testkjs
3422
3423         Reviewed by Alexey Proskuryakov.
3424
3425         * tests/mozilla/jsDriver.pl: Quote the path to the engine so that
3426         spaces will be interpreted correctly.
3427
3428 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
3429
3430         Fixed a misguiding comment - my measurement for negative numbers only included cases
3431         where both operands were negative, which is not very interesting.
3432
3433         * VM/Machine.cpp:
3434
3435 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
3436
3437         Reviewed by Maciej.
3438
3439         Based on a patch by Oliver Hunt.
3440
3441         https://bugs.webkit.org/show_bug.cgi?id=19180
3442         speed up SunSpider by optimizing immediate number cases
3443
3444         1.4% speedup on SunSpider.
3445
3446         * VM/Machine.cpp:
3447         (KJS::Machine::privateExecute):
3448         * kjs/JSImmediate.h:
3449         (KJS::JSImmediate::incImmediateNumber):
3450         (KJS::JSImmediate::decImmediateNumber):
3451         Added fast paths for ++ and --.
3452
3453         (KJS::JSImmediate::canDoFastAdditiveOperations): Corrected a comment.
3454
3455 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
3456
3457         Reviewed by Darin.
3458
3459         https://bugs.webkit.org/show_bug.cgi?id=19180
3460         speed up SunSpider by optimizing immediate number cases
3461
3462         2% speedup overall, maximum 10% on controlflow-recursive and bitops-3bit-bits-in-byte,
3463         but a 4% regression on bitops-bits-in-byte and bitops-bitwise-and.
3464
3465         * kjs/JSImmediate.h:
3466         (KJS::JSImmediate::canDoFastAdditiveOperations):
3467         (KJS::JSImmediate::addImmediateNumbers):
3468         (KJS::JSImmediate::subImmediateNumbers):
3469         Added fast cases that work with positive values less than 2^30.
3470
3471         * VM/Machine.cpp:
3472         (KJS::Machine::privateExecute): Use the above operations. Also updated SunSpider frequencies
3473         with my results (looks like tag values have changed, not sure what caused the minor variation
3474         in actual frequencies).
3475
3476 2008-05-27  Adam Roben  <aroben@apple.com>
3477
3478         Windows build fix
3479
3480         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3481         Remove code that appended Cygwin's /bin directory to PATH.
3482         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
3483         Prepend Cygwin's /bin directory to PATH. We prepend instead of append
3484         so that Cygwin's utilities will win out over Win32 versions of the
3485         same utilities (particularly perl). We do the prepend here instead of
3486         in the Makefile because nmake doesn't seem to like prepending to PATH
3487         inside the Makefile. This also matches the way WebCoreGenerated works.
3488
3489 2008-05-27  Adam Roben  <aroben@apple.com>
3490
3491         Roll out r34163
3492
3493         A better fix is on the way.
3494
3495         * DerivedSources.make:
3496         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
3497
3498 2008-05-27  Adam Roben  <aroben@apple.com>
3499
3500         Windows build fix
3501
3502         * DerivedSources.make: Don't generate the bytecode docs if
3503         OMIT_BYTECODE_DOCS is set to 1.
3504         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Set
3505         OMIT_BYTECODE_DOCS for production builds.
3506
3507 2008-05-27  Anders Carlsson  <andersca@apple.com>
3508
3509         Reviewed by Geoff and Maciej.
3510
3511         <rdar://problem/5806428> 
3512         https://bugs.webkit.org/show_bug.cgi?id=17925
3513         Crash in KJS::JSObject::put after setting this.__proto__
3514
3515         Set slotIsWriteable to false for __proto__, we want setting __proto__ to go through JSObject::put instead.
3516         
3517         * kjs/object.h:
3518         (KJS::JSObject::getOwnPropertySlotForWrite):
3519
3520 2008-05-27  Kevin Ollivier  <kevino@theolliviers.com>
3521
3522         wx build fixes to catch up with SquirrelFish, etc.
3523
3524         * JavaScriptCoreSources.bkl:
3525         * jscore.bkl:
3526  &n