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