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