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