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