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