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